From 04303914460a3b5e921af4720ece5d683cc5b396 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Sun, 5 Oct 2014 17:42:43 +0200 Subject: [PATCH] Fix autosmelt smelting even if the black can't be harvested with the tool #1053 --- src/main/java/tconstruct/tools/TActiveOmniMod.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/tconstruct/tools/TActiveOmniMod.java b/src/main/java/tconstruct/tools/TActiveOmniMod.java index cbf506a6dee..f14cf51be63 100644 --- a/src/main/java/tconstruct/tools/TActiveOmniMod.java +++ b/src/main/java/tconstruct/tools/TActiveOmniMod.java @@ -11,6 +11,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import tconstruct.library.ActiveToolMod; import tconstruct.library.tools.*; import tconstruct.util.config.PHConstruct; @@ -63,6 +64,10 @@ private boolean autoSmelt (ToolCore tool, NBTTagCompound tags, ItemStack stack, return false; int meta = world.getBlockMetadata(x, y, z); + + if(!block.getMaterial().isToolNotRequired() && !ForgeHooks.canToolHarvestBlock(block, meta, stack)) + return false; + meta = block.damageDropped(meta); if (tags.getBoolean("Lava") && block.quantityDropped(meta, 0, random) != 0)