mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-25 08:51:33 +01:00
Fix spawn point being blown up by explosions
This commit is contained in:
parent
03d7e828a0
commit
8ef2174a3e
@ -471,6 +471,7 @@ public class Entity implements Listener {
|
||||
public void onEntityExplode(EntityExplodeEvent event) {
|
||||
org.bukkit.entity.Entity entity = event.getEntity();
|
||||
|
||||
WorldManager worldManager = skyblock.getWorldManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
if (skyblock.getWorldManager().isIslandWorld(entity.getWorld())) {
|
||||
@ -503,6 +504,19 @@ public class Entity implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SkyBlock.getInstance().getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Spawn.Protection")) {
|
||||
IslandWorld world = worldManager.getIslandWorld(event.getEntity().getWorld());
|
||||
for (org.bukkit.block.Block block : event.blockList()) {
|
||||
if (LocationUtil.isLocationLocation(block.getLocation(),
|
||||
island.getLocation(world, IslandEnvironment.Main)
|
||||
.clone()
|
||||
.subtract(0.0D, 1.0D, 0.0D))) {
|
||||
event.blockList().remove(block);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user