mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-14 03:21:24 +01:00
Random safeguard for breaking-time (fastbreak).
This commit is contained in:
parent
6a70f0a010
commit
944f3469d0
@ -56,9 +56,9 @@ public class FastBreak extends Check {
|
|||||||
final int id = block.getTypeId();
|
final int id = block.getTypeId();
|
||||||
if (player.getGameMode() == GameMode.CREATIVE)
|
if (player.getGameMode() == GameMode.CREATIVE)
|
||||||
// Modifier defaults to 0, the Frequency check is responsible for those.
|
// 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
|
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 (!).
|
// fastBreakfirstDamage is the first interact on block (!).
|
||||||
final long elapsedTime;
|
final long elapsedTime;
|
||||||
// TODO: Should it be breakingTime instead of 0 for inconsistencies?
|
// TODO: Should it be breakingTime instead of 0 for inconsistencies?
|
||||||
|
Loading…
Reference in New Issue
Block a user