diff --git a/src/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakData.java b/src/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakData.java index 24227a41..d58562fb 100644 --- a/src/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakData.java +++ b/src/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakData.java @@ -86,7 +86,7 @@ public class BlockBreakData extends ACheckData { public int fastBreakBuffer; public long fastBreakBreakTime = System.currentTimeMillis() - 1000L; /** Old check sets this to the last interact time, new check sets to first interact time for one block. */ - public long fastBreakDamageTime = System.currentTimeMillis(); + public long fastBreakfirstDamage = System.currentTimeMillis(); public final ActionFrequency frequencyBuckets; diff --git a/src/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakListener.java b/src/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakListener.java index c7b69af2..773aed54 100644 --- a/src/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakListener.java +++ b/src/fr/neatmonster/nocheatplus/checks/blockbreak/BlockBreakListener.java @@ -108,7 +108,7 @@ public class BlockBreakListener implements Listener { if (cancelled){ event.setCancelled(cancelled); // Reset damage position: - data.fastBreakDamageTime = now; + data.fastBreakfirstDamage = now; data.clickedX = block.getX(); data.clickedY = block.getY(); data.clickedZ = block.getZ(); @@ -150,7 +150,7 @@ public class BlockBreakListener implements Listener { * the event */ @EventHandler( - ignoreCancelled = false, priority = EventPriority.MONITOR) + ignoreCancelled = false, priority = EventPriority.LOWEST) public void onPlayerInteract(final PlayerInteractEvent event) { /* * ____ _ ___ _ _ @@ -168,11 +168,12 @@ public class BlockBreakListener implements Listener { // (Allows right click to be ignored.) if (event.getAction() != Action.LEFT_CLICK_BLOCK) return; + final long now = System.currentTimeMillis(); final BlockBreakData data = BlockBreakData.getData(player); if (event.isCancelled()){ // Reset the time, to avoid certain kinds of cheating. - data.fastBreakDamageTime = System.currentTimeMillis(); + data.fastBreakfirstDamage = now; data.clickedX = Integer.MAX_VALUE; // Should be enough to reset that one. return; } @@ -182,12 +183,13 @@ public class BlockBreakListener implements Listener { if (block == null) return; - if (data.clickedX == block.getX() && data.clickedZ == block.getZ() && data.clickedY == block.getY()) return; +// if (data.clickedX == block.getX() && data.clickedZ == block.getZ() && data.clickedY == block.getY()) return; // Only record first damage: - data.fastBreakDamageTime = System.currentTimeMillis(); + data.fastBreakfirstDamage = now; // Also set last clicked blocks position. data.clickedX = block.getX(); data.clickedY = block.getY(); data.clickedZ = block.getZ(); } + } diff --git a/src/fr/neatmonster/nocheatplus/checks/blockbreak/FastBreak.java b/src/fr/neatmonster/nocheatplus/checks/blockbreak/FastBreak.java index bcd29e08..fd67134d 100644 --- a/src/fr/neatmonster/nocheatplus/checks/blockbreak/FastBreak.java +++ b/src/fr/neatmonster/nocheatplus/checks/blockbreak/FastBreak.java @@ -53,8 +53,8 @@ public class FastBreak extends Check { if (player.getGameMode() == GameMode.CREATIVE) breakingTime = Math.round((double) cc.fastBreakModCreative / 100D * (double) 95); - // fastBreakDamageTime is now first interact on block (!). - final long elapsedTime = now - data.fastBreakDamageTime; + // fastBreakfirstDamage is now first interact on block (!). + final long elapsedTime = now - data.fastBreakfirstDamage; // Check if the time used time is lower than expected. if (elapsedTime + cc.fastBreakDelay < breakingTime){ diff --git a/src/fr/neatmonster/nocheatplus/checks/blockbreak/Reach.java b/src/fr/neatmonster/nocheatplus/checks/blockbreak/Reach.java index 11a56986..15d87f15 100644 --- a/src/fr/neatmonster/nocheatplus/checks/blockbreak/Reach.java +++ b/src/fr/neatmonster/nocheatplus/checks/blockbreak/Reach.java @@ -8,7 +8,6 @@ import fr.neatmonster.nocheatplus.actions.ParameterName; import fr.neatmonster.nocheatplus.checks.Check; import fr.neatmonster.nocheatplus.checks.CheckType; import fr.neatmonster.nocheatplus.checks.ViolationData; -import fr.neatmonster.nocheatplus.checks.combined.Improbable; import fr.neatmonster.nocheatplus.utilities.CheckUtils; /* @@ -72,11 +71,11 @@ public class Reach extends Check { // Player passed the check, reward him. data.reachVL *= 0.9D; - // Check if improbable - if (distance > -0.3){ - if (Improbable.check(player, 2.0f, System.currentTimeMillis())) - cancel = true; - } +// // Check if improbable +// if (distance > -0.1){ +// if (Improbable.check(player, 1.0f, System.currentTimeMillis())) +// cancel = true; +// } } return cancel; diff --git a/src/fr/neatmonster/nocheatplus/checks/blockbreak/WrongBlock.java b/src/fr/neatmonster/nocheatplus/checks/blockbreak/WrongBlock.java index fc326178..be2c7346 100644 --- a/src/fr/neatmonster/nocheatplus/checks/blockbreak/WrongBlock.java +++ b/src/fr/neatmonster/nocheatplus/checks/blockbreak/WrongBlock.java @@ -31,7 +31,7 @@ public class WrongBlock extends Check { data.wrongBlockVL.add(now, 1f); if (executeActions(player, data.wrongBlockVL.getScore(0.9f), 1D, cc.wrongBlockActions)) cancel = true; - if (Improbable.check(player, 5.0f, now)) + if (Improbable.check(player, 2.0f, now)) cancel = true; }