Add ITool.canUse check

Adds a check for canUse for tools which might relay on power or other reasons why a tool should not be used
This commit is contained in:
The Temportalist committed 2015-12-21 17:37:45 -05:00
1 parent 88a5ee2411
commit 1d5b202be0
1 file changed
+1 -1
@@ -33,7 +33,7 @@ public abstract class BlockEio extends BlockEnder {
TileEntity te = world.getTileEntity(x, y, z);
ITool tool = ToolUtil.getEquippedTool(entityPlayer);
if(tool != null && !entityPlayer.isSneaking()) {
if(tool != null && !entityPlayer.isSneaking() && tool.canUse(entityPlayer.getCurrentEquippedItem(), entityPlayer, x, y, z)) {
if(te instanceof AbstractMachineEntity) {
((AbstractMachineEntity) te).toggleIoModeForFace(ForgeDirection.getOrientation(side));
world.markBlockForUpdate(x, y, z);