From 944f3469d0b9d401f16679c1f3eb25ca625381be Mon Sep 17 00:00:00 2001 From: asofold Date: Wed, 23 Jan 2013 18:30:30 +0100 Subject: [PATCH] Random safeguard for breaking-time (fastbreak). --- .../neatmonster/nocheatplus/checks/blockbreak/FastBreak.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/blockbreak/FastBreak.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/blockbreak/FastBreak.java index 261f1f1a..07992047 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/blockbreak/FastBreak.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/blockbreak/FastBreak.java @@ -56,9 +56,9 @@ public class FastBreak extends Check { final int id = block.getTypeId(); if (player.getGameMode() == GameMode.CREATIVE) // Modifier defaults to 0, the Frequency check is responsible for those. - breakingTime = Math.round((double) cc.fastBreakModCreative / 100D * (double) 100); + breakingTime = Math.max(0, Math.round((double) cc.fastBreakModCreative / 100D * (double) 100)); else - breakingTime = Math.round((double) cc.fastBreakModSurvival / 100D * (double) BlockProperties.getBreakingDuration(id, player)); + breakingTime = Math.max(0, Math.round((double) cc.fastBreakModSurvival / 100D * (double) BlockProperties.getBreakingDuration(id, player))); // fastBreakfirstDamage is the first interact on block (!). final long elapsedTime; // TODO: Should it be breakingTime instead of 0 for inconsistencies?