mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 03:02:11 +01:00
Fix isSameBlock(Location), add convenience methods isBlockAbove.
This commit is contained in:
parent
1264cdb240
commit
29f5a153a5
@ -218,7 +218,25 @@ public class PlayerLocation {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public final boolean isSameBlock(final Location loc) {
|
public final boolean isSameBlock(final Location loc) {
|
||||||
return x == loc.getBlockX() && z == loc.getBlockZ() && y == loc.getBlockY();
|
return blockX == loc.getBlockX() && blockZ == loc.getBlockZ() && blockY == loc.getBlockY();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if this location is above the given one (blockY + 1).
|
||||||
|
* @param loc
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isBlockAbove(final PlayerLocation loc){
|
||||||
|
return blockY == loc.getBlockY() + 1 && blockX == loc.getBlockX() && blockZ == loc.getBlockZ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if this location is above the given one (blockY + 1).
|
||||||
|
* @param loc
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isBlockAbove(final Location loc){
|
||||||
|
return blockY == loc.getBlockY() + 1 && blockX == loc.getBlockX() && blockZ == loc.getBlockZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user