Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean isOutsideOfBorder(Player p) {
- Location loc = p.getLocation();
- WorldBorder border = p.getWorld().getWorldBorder();
- double size = border.getSize()/2;
- Location center = border.getCenter();
- double x = loc.getX() - center.getX(), z = loc.getZ() - center.getZ();
- return ((x > size || (-x) > size) || (z > size || (-z) > size));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement