Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean isInSpace(Player p) {
- final Location l = p.getLocation();
- boolean air1 = true;
- boolean air2 = true;
- final int x = l.getBlockX();
- final int y = l.getBlockY();
- final int z = l.getBlockZ();
- final World w = l.getWorld();
- int height = 40;
- if (w.getName().equalsIgnoreCase("Regalis") && this.isInSpawn(p)) {
- height = 130;
- }
- for (int i = 0; i < height; i++) {
- final int id1 = w.getBlockTypeIdAt(x, y + i + 1, z);
- final int id2 = w.getBlockTypeIdAt(x, y - i, z);
- if (id1 != 0) {
- air1 = false;
- }
- if (id2 != 0) {
- air2 = false;
- }
- }
- if ((!air1) && (!air2))
- return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement