mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-18 18:01:17 +02:00
Use manhattan method for WrongBlock (not a change for the logic).
This commit is contained in:
parent
3f78497fde
commit
a198133cfa
@ -7,6 +7,7 @@ import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.combined.Improbable;
|
||||
import fr.neatmonster.nocheatplus.permissions.Permissions;
|
||||
import fr.neatmonster.nocheatplus.utilities.TrigUtil;
|
||||
|
||||
public class WrongBlock extends Check {
|
||||
|
||||
@ -30,7 +31,7 @@ public class WrongBlock extends Check {
|
||||
boolean cancel = false;
|
||||
|
||||
final boolean wrongTime = data.fastBreakfirstDamage < data.fastBreakBreakTime;
|
||||
final int dist = Math.abs(data.clickedX - block.getX()) + Math.abs(data.clickedY - block.getY()) + Math.abs(data.clickedZ - block.getZ());
|
||||
final int dist = TrigUtil.manhattan(data.clickedX, data.clickedY, data.clickedZ, block);
|
||||
final boolean wrongBlock;
|
||||
final long now = System.currentTimeMillis();
|
||||
if (dist == 0){
|
||||
|
Loading…
Reference in New Issue
Block a user