From 040c5e27ab07fdd5082af84107811d849d727943 Mon Sep 17 00:00:00 2001 From: asofold Date: Sat, 29 Sep 2012 15:47:18 +0200 Subject: [PATCH] Workarounds for soulsand (passable) and chest/workbench (fastbreak). --- .../neatmonster/nocheatplus/utilities/BlockProperties.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java b/src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java index 1a22cd30..db01b699 100644 --- a/src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java +++ b/src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java @@ -585,6 +585,10 @@ public class BlockProperties { // 450, 200 , 100 , 50 , 0 return 450 / (long) Math.pow(2, efficiency - 1); } + else if (blockProps == chestType){ + // TODO: The no tool time might be reference anyway for some block types. + return (long) ((double )blockProps.breakingTimes[0] / 5f / efficiency); + } } long duration; @@ -595,7 +599,7 @@ public class BlockProperties { // appropriate tool duration = blockProps.breakingTimes[toolProps.materialBase.index]; if (efficiency > 0){ - duration = (long) (duration / blockProps.efficiencyMod); + duration = (long) (duration / blockProps.efficiencyMod / efficiency); } } else{ @@ -820,6 +824,7 @@ public class BlockProperties { } else if (fy >= 0.5) return true; } + else if (id == Material.SOUL_SAND.getId() && fy >= 0.875) return true; else if ((id == Material.IRON_FENCE.getId() || id == Material.THIN_GLASS.getId()) && block.maxX == 1.0 && block.maxZ == 1.0 && block.minX == 0.0 && block.minZ == 0.0){ if (Math.abs(0.5 - fx) > 0.1 && Math.abs(0.5 - fz) > 0.1) return true;