Permalink
Browse files

Fixed betterphysics potential stackoverflow

  • Loading branch information...
me4502 committed Nov 15, 2016
1 parent f00f4fb commit db2e2a73fe6269d256ebaac10cfc751ae21d1e78
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/java/com/sk89q/craftbook/mechanics/BetterPhysics.java
@@ -55,15 +55,13 @@ public void onBlockUpdate(BlockPhysicsEvent event) {
private static void checkForPhysics(Block block) {
if(FallingLadders.isValid(block)) {
Bukkit.getScheduler().runTask(CraftBookPlugin.inst(), new FallingLadders(block));
- checkForPhysics(block.getRelative(BlockFace.UP));
}
}
private static class FallingLadders implements Runnable {
private Block ladder;
FallingLadders(Block ladder) {
-
this.ladder = ladder;
}
@@ -76,6 +74,8 @@ public void run () {
if(!isValid(ladder)) return;
ladder.getWorld().spawnFallingBlock(ladder.getLocation().add(0.5, 0, 0.5), ladder.getType(), ladder.getData());
ladder.setType(Material.AIR, false);
+
+ checkForPhysics(ladder.getRelative(BlockFace.UP));
}
}

0 comments on commit db2e2a7

Please sign in to comment.