diff --git a/src/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakData.java b/src/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakData.java index dba65b5d..974479ec 100644 --- a/src/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakData.java +++ b/src/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakData.java @@ -70,7 +70,7 @@ public class BlockBreakData extends ACheckData { public double fastBreakVL; public double noSwingVL; public double reachVL; - public double wrongBlockVL; + public final ActionFrequency wrongBlockVL; // Shared data. public int clickedX; @@ -94,6 +94,7 @@ public class BlockBreakData extends ACheckData { public BlockBreakData(BlockBreakConfig cc) { fastBreakBuffer = cc.fastBreakBuffer; fastBreakPenalties = new ActionFrequency(cc.fastBreakBuckets, cc.fastBreakBucketDur); + wrongBlockVL = new ActionFrequency(6, 20000); } } diff --git a/src/fr/neatmonster/nocheatplus/checks/blockbreak/WrongBlock.java b/src/fr/neatmonster/nocheatplus/checks/blockbreak/WrongBlock.java index 91ef6cff..3f790a18 100644 --- a/src/fr/neatmonster/nocheatplus/checks/blockbreak/WrongBlock.java +++ b/src/fr/neatmonster/nocheatplus/checks/blockbreak/WrongBlock.java @@ -19,10 +19,11 @@ public class WrongBlock extends Check { boolean cancel = false; if (data.clickedX != block.getX() || data.clickedZ != block.getZ() || data.clickedY != block.getY()){ - data.wrongBlockVL += 1D; - if (executeActions(player, data.wrongBlockVL, 1D, cc.wrongBlockActions)) + final long now = System.currentTimeMillis(); + data.wrongBlockVL.add(now, 1f); + if (executeActions(player, data.wrongBlockVL.getScore(0.9f), 1D, cc.wrongBlockActions)) cancel = true; - if (Improbable.check(player, 5.0f, System.currentTimeMillis())) + if (Improbable.check(player, 5.0f, now)) cancel = true; }