mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-27 04:35:46 +01:00
Little optimization in island spawn checking
This commit is contained in:
parent
fc8a95d1c1
commit
0496fe629d
@ -128,9 +128,8 @@ public class Block implements Listener {
|
||||
|
||||
IslandWorld world = worldManager.getIslandWorld(block.getWorld());
|
||||
|
||||
if (LocationUtil.isLocationLocation(block.getLocation(), island.getLocation(world, IslandEnvironment.Main).clone().subtract(0.0D, 1.0D, 0.0D))
|
||||
|| LocationUtil.isLocationLocation(block.getLocation(), island.getLocation(world, IslandEnvironment.Main).clone()) || LocationUtil.isLocationLocation(block.getLocation(), island.getLocation(world, IslandEnvironment.Visitor).clone().subtract(0.0D, 1.0D, 0.0D))
|
||||
|| LocationUtil.isLocationLocation(block.getLocation(), island.getLocation(world, IslandEnvironment.Visitor).clone())) {
|
||||
if (LocationUtil.isLocationLocation(block.getLocation(), island.getLocation(world, IslandEnvironment.Main).clone().subtract(0.0D, 1.0D, 0.0D)) || LocationUtil.isLocationLocation(block.getLocation(), island.getLocation(world, IslandEnvironment.Visitor).clone().subtract(0.0D, 1.0D, 0.0D))
|
||||
|| LocationUtil.isLocationAffectingIslandSpawn(block.getLocation(), island, world)) {
|
||||
if (configLoad.getBoolean("Island.Spawn.Protection")) {
|
||||
event.setCancelled(true);
|
||||
skyblock.getMessageManager().sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.SpawnProtection.Break.Message"));
|
||||
|
@ -304,7 +304,7 @@ public class Entity implements Listener {
|
||||
}
|
||||
|
||||
if ((event.getEntityType() == EntityType.FALLING_BLOCK)
|
||||
&& LocationUtil.isLocationLocation(event.getBlock().getLocation(), island.getLocation(world, IslandEnvironment.Main).clone())
|
||||
&& LocationUtil.isLocationAffectingIslandSpawn(block.getLocation(), island, world)
|
||||
&& configLoad.getBoolean("Island.Spawn.Protection")) {
|
||||
FallingBlock fallingBlock = (FallingBlock) event.getEntity();
|
||||
if (fallingBlock.getDropItem()) {
|
||||
|
Loading…
Reference in New Issue
Block a user