forked from kaboomserver/extras
Fix compile error
This commit is contained in:
parent
192be7c779
commit
69ee352565
1 changed files with 26 additions and 26 deletions
|
@ -56,40 +56,40 @@ class BlockPhysics implements Listener {
|
||||||
} else if (material == Material.WATER ||
|
} else if (material == Material.WATER ||
|
||||||
material == Material.LAVA) {
|
material == Material.LAVA) {
|
||||||
final Block block = event.getBlock();
|
final Block block = event.getBlock();
|
||||||
try {
|
|
||||||
|
if (block.getBlockData() instanceof Levelled) {
|
||||||
final Levelled levelledBlock = (Levelled) block.getBlockData();
|
final Levelled levelledBlock = (Levelled) block.getBlockData();
|
||||||
} catch (Exception exception) {
|
|
||||||
}
|
|
||||||
|
|
||||||
if (levelledBlock.getLevel() <= 7) {
|
if (levelledBlock.getLevel() <= 7) {
|
||||||
if (block.getRelative(BlockFace.UP).getType() != material) {
|
if (block.getRelative(BlockFace.UP).getType() != material) {
|
||||||
boolean cancel = true;
|
boolean cancel = true;
|
||||||
boolean solid = false;
|
boolean solid = false;
|
||||||
|
|
||||||
for (BlockFace face : main.faces) {
|
for (BlockFace face : main.faces) {
|
||||||
if (block.getRelative(face).getType() == Material.AIR ||
|
if (block.getRelative(face).getType() == Material.AIR ||
|
||||||
block.getRelative(face).getType() == Material.CAVE_AIR ||
|
block.getRelative(face).getType() == Material.CAVE_AIR ||
|
||||||
block.getRelative(BlockFace.UP).getType() == Material.WATER) {
|
block.getRelative(BlockFace.UP).getType() == Material.WATER) {
|
||||||
cancel = false;
|
cancel = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (block.getRelative(face).getType() != Material.AIR ||
|
||||||
|
block.getRelative(face).getType() != Material.CAVE_AIR ||
|
||||||
|
block.getRelative(face).getType() != Material.LAVA ||
|
||||||
|
block.getRelative(face).getType() != Material.WATER) {
|
||||||
|
solid = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block.getRelative(face).getType() != Material.AIR ||
|
|
||||||
block.getRelative(face).getType() != Material.CAVE_AIR ||
|
if (block.getRelative(BlockFace.UP).getType() == Material.WATER &&
|
||||||
block.getRelative(face).getType() != Material.LAVA ||
|
!solid) {
|
||||||
block.getRelative(face).getType() != Material.WATER) {
|
event.setCancelled(true);
|
||||||
solid = true;
|
} else if (cancel) {
|
||||||
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
} else if (block.getRelative(BlockFace.DOWN).getType() == material) {
|
||||||
|
|
||||||
|
|
||||||
if (block.getRelative(BlockFace.UP).getType() == Material.WATER &&
|
|
||||||
!solid) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
} else if (cancel) {
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (block.getRelative(BlockFace.DOWN).getType() == material) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (main.nonSolidWallMountedBlockList.contains(material)) {
|
} else if (main.nonSolidWallMountedBlockList.contains(material)) {
|
||||||
|
|
Loading…
Reference in a new issue