mirror of
https://github.com/kaboomserver/extras.git
synced 2025-08-04 19:46:34 +00:00
Fixes to physics
This commit is contained in:
parent
b03338d05e
commit
f5e6fdd539
1 changed files with 16 additions and 4 deletions
|
@ -205,11 +205,23 @@ class Events implements Listener {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (main.nonSolidDoubleBlockList.contains(block.getType())) {
|
} else if (main.nonSolidDoubleBlockList.contains(block.getType())) {
|
||||||
if (block.getRelative(BlockFace.DOWN).getType() == block.getType()) {
|
if (main.nonSolidDoubleBlockList.contains(block.getRelative(BlockFace.DOWN).getType())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if ((block.getRelative(BlockFace.DOWN).getType() == Material.AIR ||
|
} else if (block.getRelative(BlockFace.DOWN).getType() == Material.AIR ||
|
||||||
main.nonSolidBlockList.contains(block.getRelative(BlockFace.DOWN).getType())) &&
|
(main.nonSolidBlockList.contains(block.getRelative(BlockFace.DOWN).getType()) &&
|
||||||
block.getRelative(BlockFace.UP).getType() == Material.AIR) {
|
!main.nonSolidDoubleBlockList.contains(block.getRelative(BlockFace.DOWN).getType()))) {
|
||||||
|
for (int y = block.getRelative(BlockFace.UP).getY(); y <= 128; y++) {
|
||||||
|
World world = event.getBlock().getWorld();
|
||||||
|
Block coordBlock = world.getBlockAt(new Location(world, block.getX(), y, block.getZ()));
|
||||||
|
|
||||||
|
if (main.nonSolidDoubleBlockList.contains(coordBlock.getType())) {
|
||||||
|
coordBlock.setType(Material.AIR, false);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
block.setType(Material.AIR, false);
|
block.setType(Material.AIR, false);
|
||||||
}
|
}
|
||||||
} else if (main.nonSolidSingularBlockList.contains(block.getType())) {
|
} else if (main.nonSolidSingularBlockList.contains(block.getType())) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue