mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-07 03:00:29 +01:00
Fix for FallBreak not working on old versions
This commit is contained in:
parent
0adf619737
commit
2812c6d07d
@ -83,21 +83,18 @@ public class FallBreak implements Listener {
|
||||
}
|
||||
}, 2L, 1L);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onSpawnFallingBlock(EntitySpawnEvent event) {
|
||||
|
||||
@EventHandler
|
||||
public void onFallingBlockModify(EntityChangeBlockEvent event) {
|
||||
if(event.getEntity() instanceof FallingBlock) {
|
||||
WorldManager worldManager = plugin.getWorldManager();
|
||||
if (worldManager.isIslandWorld(event.getEntity().getLocation().getWorld())) {
|
||||
fallingBlocks.add((FallingBlock) event.getEntity());
|
||||
if (!event.getTo().equals(CompatibleMaterial.AIR.getMaterial())){
|
||||
fallingBlocks.remove((FallingBlock) event.getEntity());
|
||||
} else if(!event.isCancelled()) {
|
||||
fallingBlocks.add((FallingBlock) event.getEntity());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onDespawnFallingBlock(EntityChangeBlockEvent event) {
|
||||
if(event.getEntity() instanceof FallingBlock && !event.getTo().equals(CompatibleMaterial.AIR.getMaterial())) {
|
||||
fallingBlocks.remove((FallingBlock) event.getEntity());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user