mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-23 02:35:25 +01:00
Water can no longer flow off of the border.
This commit is contained in:
parent
98bf07b9d8
commit
504f0ff57f
@ -186,6 +186,34 @@ public class Block implements Listener {
|
||||
level.setMaterialAmount(materials.name(), materialAmount + 1);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onBlockFromTo(BlockFromToEvent event) {
|
||||
if (!skyblock.getWorldManager().isIslandWorld(event.getBlock().getWorld())) return;
|
||||
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
WorldManager worldManager = skyblock.getWorldManager();
|
||||
|
||||
Island island = islandManager.getIslandAtLocation(event.getBlock().getLocation());
|
||||
IslandWorld world = worldManager.getIslandWorld(event.getBlock().getWorld());
|
||||
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
org.bukkit.block.Block block = event.getToBlock();
|
||||
if (!LocationUtil.isLocationAtLocationRadius(block.getLocation(),
|
||||
island.getLocation(world, IslandEnvironment.Island), island.getRadius() - 1.0D)) {
|
||||
event.setCancelled(true);
|
||||
} else if (LocationUtil.isLocationLocation(block.getLocation(),
|
||||
island.getLocation(world, IslandEnvironment.Main)
|
||||
.clone()
|
||||
.subtract(0.0D, 1.0D, 0.0D))) {
|
||||
if (configLoad.getBoolean("Island.Spawn.Protection")) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onBlockPistonExtend(BlockPistonExtendEvent event) {
|
||||
if (!skyblock.getWorldManager().isIslandWorld(event.getBlock().getWorld())) return;
|
||||
|
Loading…
Reference in New Issue
Block a user