mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-02-16 19:51:27 +01:00
You can no longer move the spawn block with a piston.
This commit is contained in:
parent
08d087c839
commit
a7f1df1a38
@ -198,10 +198,20 @@ public class Block implements Listener {
|
||||
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();
|
||||
|
||||
for (org.bukkit.block.Block block : event.getBlocks()) {
|
||||
if (!LocationUtil.isLocationAtLocationRadius(block.getLocation(),
|
||||
island.getLocation(world, IslandEnvironment.Island), island.getRadius() - 2.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -228,10 +238,20 @@ public class Block implements Listener {
|
||||
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();
|
||||
|
||||
for (org.bukkit.block.Block block : event.getBlocks()) {
|
||||
if (!LocationUtil.isLocationAtLocationRadius(block.getLocation(),
|
||||
island.getLocation(world, IslandEnvironment.Island), island.getRadius() - 2.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,7 +273,6 @@ public class Block implements Listener {
|
||||
org.bukkit.block.Block block = event.getBlock();
|
||||
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
GeneratorManager generatorManager = skyblock.getGeneratorManager();
|
||||
WorldManager worldManager = skyblock.getWorldManager();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user