temporary hack
This commit is contained in:
@@ -167,6 +167,18 @@ public class Headstone {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean blockIsAllowed(Block block) {
|
||||||
|
Material material = block.getType();
|
||||||
|
|
||||||
|
if (material != Material.AIR && material != Material.CAVE_AIR)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (block.getWorld().getName().equals("world_the_end") && block.getY() < 60)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private @Nullable Block checkForSafeBlock() {
|
private @Nullable Block checkForSafeBlock() {
|
||||||
int playerX = this.location.getBlockX();
|
int playerX = this.location.getBlockX();
|
||||||
int playerY = this.location.getBlockY();
|
int playerY = this.location.getBlockY();
|
||||||
@@ -178,7 +190,7 @@ public class Headstone {
|
|||||||
for (int y = playerY - radius; y <= playerY + radius; y++)
|
for (int y = playerY - radius; y <= playerY + radius; y++)
|
||||||
for (int z = playerZ - radius; z <= playerZ + radius; z++) {
|
for (int z = playerZ - radius; z <= playerZ + radius; z++) {
|
||||||
Block block = this.location.getWorld().getBlockAt(x,y,z);
|
Block block = this.location.getWorld().getBlockAt(x,y,z);
|
||||||
if (block.getType().isEmpty())
|
if (blockIsAllowed(block))
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +200,7 @@ public class Headstone {
|
|||||||
|
|
||||||
for (int y = playerY; y < 320; y++) {
|
for (int y = playerY; y < 320; y++) {
|
||||||
Block block = this.location.getWorld().getBlockAt(playerX, y, playerZ);
|
Block block = this.location.getWorld().getBlockAt(playerX, y, playerZ);
|
||||||
if (block.getType().isEmpty())
|
if (blockIsAllowed(block))
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user