mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
tweak highest block check
This commit is contained in:
parent
e7990a06e2
commit
aa7b770c03
@ -181,8 +181,19 @@ public class BukkitUtil extends WorldUtil {
|
|||||||
World bukkitWorld = getWorld(world);
|
World bukkitWorld = getWorld(world);
|
||||||
for (int y = bukkitWorld.getMaxHeight() - 1; y > 0; y--) {
|
for (int y = bukkitWorld.getMaxHeight() - 1; y > 0; y--) {
|
||||||
Block block = bukkitWorld.getBlockAt(x, y, z);
|
Block block = bukkitWorld.getBlockAt(x, y, z);
|
||||||
if (block != null && block.getType().isSolid()) {
|
if (block != null) {
|
||||||
return y+1;
|
Material type = block.getType();
|
||||||
|
if (type.isSolid()) {
|
||||||
|
return y + 1;
|
||||||
|
} else {
|
||||||
|
switch (type) {
|
||||||
|
case WATER:
|
||||||
|
case LAVA:
|
||||||
|
case STATIONARY_LAVA:
|
||||||
|
case STATIONARY_WATER:
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user