mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-23 21:39:40 +00:00
Added IToolHammer support
This commit is contained in:
1 parent
ec5793dc4d
commit
db5c2c3d2c
2 files changed
+57
-4
No files matched your search
@@ -16,8 +16,8 @@ import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
import mekanism.common.tile.TileEntityElectricChest;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -27,13 +27,13 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import cofh.api.item.IToolHammer;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
|
||||
@Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraftAPI|tools")
|
||||
public class ItemConfigurator extends ItemEnergized implements IMekWrench, IToolWrench
|
||||
public class ItemConfigurator extends ItemEnergized implements IMekWrench, IToolWrench, IToolHammer
|
||||
{
|
||||
public final int ENERGY_PER_CONFIGURE = 400;
|
||||
public final int ENERGY_PER_ITEM_DUMP = 8;
|
||||
@@ -275,4 +275,13 @@ public class ItemConfigurator extends ItemEnergized implements IMekWrench, ITool
|
||||
{
|
||||
return getState(player.getCurrentEquippedItem()) == 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUsable(ItemStack item, EntityLivingBase user, int x, int y, int z)
|
||||
{
|
||||
return user instanceof EntityPlayer && canUseWrench((EntityPlayer)user, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toolUsed(ItemStack item, EntityLivingBase user, int x, int y, int z) {}
|
||||
}
|
||||
Reference in new issue
Block a user