Aether Tools now given repair materials
This commit is contained in:
parent
ccd4637ba6
commit
212611a889
3 changed files with 28 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
package com.legacy.aether.common.items.tools;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
@ -9,6 +10,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
import com.legacy.aether.common.blocks.BlocksAether;
|
||||
import com.legacy.aether.common.entities.block.EntityFloatingBlock;
|
||||
import com.legacy.aether.common.items.util.EnumAetherToolType;
|
||||
|
||||
|
@ -21,11 +23,18 @@ public class ItemGravititeTool extends ItemAetherTool
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
|
||||
{
|
||||
return repair.getItem() == Item.getItemFromBlock(BlocksAether.enchanted_gravitite);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if ((this.getStrVsBlock(stack, world.getBlockState(pos)) == this.efficiencyOnProperMaterial || ForgeHooks.isToolEffective(world, pos, stack)) && world.isAirBlock(pos.up()))
|
||||
{
|
||||
if (world.getTileEntity(pos) != null)
|
||||
if (world.getTileEntity(pos) != null || world.getBlockState(pos).getBlock().getBlockHardness(world.getBlockState(pos), world, pos) == -1.0F)
|
||||
{
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package com.legacy.aether.common.items.tools;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.legacy.aether.common.blocks.BlocksAether;
|
||||
import com.legacy.aether.common.items.util.EnumAetherToolType;
|
||||
|
||||
public class ItemSkyrootTool extends ItemAetherTool
|
||||
|
@ -10,4 +14,10 @@ public class ItemSkyrootTool extends ItemAetherTool
|
|||
super(ToolMaterial.WOOD, toolType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
|
||||
{
|
||||
return repair.getItem() == Item.getItemFromBlock(BlocksAether.skyroot_plank);
|
||||
}
|
||||
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.legacy.aether.common.items.tools;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.legacy.aether.common.items.ItemsAether;
|
||||
import com.legacy.aether.common.items.util.EnumAetherToolType;
|
||||
|
||||
public class ItemZaniteTool extends ItemAetherTool
|
||||
|
@ -15,6 +16,12 @@ public class ItemZaniteTool extends ItemAetherTool
|
|||
super(ToolMaterial.IRON, toolType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
|
||||
{
|
||||
return repair.getItem() == ItemsAether.zanite_gemstone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack stack, IBlockState state)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue