From 339e6baa20331ed246c3c1c23c693ebcd0af367f Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Sat, 21 Feb 2015 21:05:41 +0100 Subject: [PATCH] Fix autosmelt smelting blocks that weren't effective (like sand with a hammer) --- src/main/java/tconstruct/tools/TActiveOmniMod.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/tools/TActiveOmniMod.java b/src/main/java/tconstruct/tools/TActiveOmniMod.java index 05481b8c..c0e1fccf 100644 --- a/src/main/java/tconstruct/tools/TActiveOmniMod.java +++ b/src/main/java/tconstruct/tools/TActiveOmniMod.java @@ -82,7 +82,16 @@ public class TActiveOmniMod extends ActiveToolMod int blockMeta = world.getBlockMetadata(x, y, z); - if(!block.getMaterial().isToolNotRequired() && !ForgeHooks.canToolHarvestBlock(block, blockMeta, stack)) + if(block.getMaterial().isToolNotRequired()) { + // only if effective tool + if(tool instanceof HarvestTool) { + if (!((HarvestTool) tool).isEffective(block, blockMeta)) + return false; + } + else + return false; + } + else if(!ForgeHooks.canToolHarvestBlock(block, blockMeta, stack)) return false; if (tags.getBoolean("Lava") && block.quantityDropped(blockMeta, 0, random) > 0)