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
@ -188,6 +188,26 @@ public class PlayerLocation {
|
|||||||
public final boolean isSameBlock(final PlayerLocation other) {
|
public final boolean isSameBlock(final PlayerLocation other) {
|
||||||
return blockX == other.getBlockX() && blockZ == other.getBlockZ() && blockY == other.getBlockY();
|
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).
|
* Compares exact coordinates (not the world).
|
||||||
|
Loading…
Reference in New Issue
Block a user