mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-06 18:50:54 +01:00
Add convenience methods for block coordinate comparison.
This commit is contained in:
parent
484c61e9aa
commit
d5136dc788
@ -189,6 +189,26 @@ public class PlayerLocation {
|
||||
return blockX == other.getBlockX() && blockZ == other.getBlockZ() && blockY == other.getBlockY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Block coordinate comparison.
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return
|
||||
*/
|
||||
public final boolean isSameBlock(final int x, final int y, final int z) {
|
||||
return blockX == x && blockZ == z && blockY == y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares block coordinates (not the world).
|
||||
* @param loc
|
||||
* @return
|
||||
*/
|
||||
public final boolean isSameBlock(final Location loc) {
|
||||
return x == loc.getBlockX() && z == loc.getBlockZ() && y == loc.getBlockY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares exact coordinates (not the world).
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user