diff --git a/src/main/java/tconstruct/library/tools/HarvestTool.java b/src/main/java/tconstruct/library/tools/HarvestTool.java index a6f8b971..269f67c1 100644 --- a/src/main/java/tconstruct/library/tools/HarvestTool.java +++ b/src/main/java/tconstruct/library/tools/HarvestTool.java @@ -229,9 +229,14 @@ public abstract class HarvestTool extends ToolCore { Block refBlock = world.getBlock(refX, refY, refZ); float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ); float strength = ForgeHooks.blockStrength(block, player, world, x, y, z); + if (strength <= 0) strength = 0.00001F; // don't div by zero or go below 0. // only harvestable blocks that aren't impossibly slow to harvest - if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength / strength > 10f) return; + // don't exclude blocks that would be broken in 1-2 ticks, regardless of hardness diff + // blocks are instantly broken if the mining speed is more than 30x the block hardness/strength + if (!ForgeHooks.canHarvestBlock(block, player, meta) + || (refStrength / strength > PHConstruct.HarvestToolAOERelativeStrength && strength * 2 < 1)) + return; // the Forgehooks method returns mining speed / hardness / 30 // send the blockbreak event BlockEvent.BreakEvent event = ForgeHooks diff --git a/src/main/java/tconstruct/util/config/PHConstruct.java b/src/main/java/tconstruct/util/config/PHConstruct.java index 8f0aeb25..3f6e2be2 100644 --- a/src/main/java/tconstruct/util/config/PHConstruct.java +++ b/src/main/java/tconstruct/util/config/PHConstruct.java @@ -71,6 +71,12 @@ public class PHConstruct { miningLevelIncrease = config.get("Difficulty Changes", "Modifiers increase Mining Level", true) .getBoolean(true); denyMattock = config.get("Difficulty Changes", "Deny creation of non-metal mattocks", false).getBoolean(false); + HarvestToolAOERelativeStrength = config.get( + "general", + "AOE Harvest Max Relative Strength", + 10, + "The maximum relative strength of the blocks in the aoe of the tool compared to the broken block to still mine them") + .getDouble(10); craftEndstone = config.get("Difficulty Changes", "Allow creation of endstone", true).getBoolean(true); redstoneFaucet = config.get("Difficulty Changes", "Allow Faucets to be activated by Redstone", true) .getBoolean(true); @@ -439,6 +445,7 @@ public class PHConstruct { public static boolean consumeXPBerryStacks; public static boolean disableAllRecipes; + public static double HarvestToolAOERelativeStrength; // Mobs public static int naturalSlimeSpawn;