From 55e20559073fa6e4bce52cf7f652a4a0a5c9ec7e Mon Sep 17 00:00:00 2001 From: Esophose Date: Sun, 26 May 2019 20:31:00 -0600 Subject: [PATCH] Added setting Island.Levelling.ScanAutomatically --- .../me/goodandevil/skyblock/island/IslandManager.java | 8 ++++++-- src/main/resources/config.yml | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/goodandevil/skyblock/island/IslandManager.java b/src/main/java/me/goodandevil/skyblock/island/IslandManager.java index b48b095e..2fe4b2d7 100644 --- a/src/main/java/me/goodandevil/skyblock/island/IslandManager.java +++ b/src/main/java/me/goodandevil/skyblock/island/IslandManager.java @@ -258,7 +258,9 @@ public class IslandManager { .setBiome(island, biome), 20L); // Recalculate island level after 5 seconds - Bukkit.getServer().getScheduler().runTaskLater(skyblock, () -> skyblock.getLevellingManager().calculatePoints(null, island), 100L); + if (fileManager.getConfig(new File(this.skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getBoolean("Island.Levelling.ScanAutomatically")) { + Bukkit.getServer().getScheduler().runTaskLater(skyblock, () -> skyblock.getLevellingManager().calculatePoints(null, island), 100L); + } return true; } @@ -811,7 +813,9 @@ public class IslandManager { pasteStructure(island, islandWorld); // Recalculate island level after 5 seconds - Bukkit.getServer().getScheduler().runTaskLater(skyblock, () -> skyblock.getLevellingManager().calculatePoints(null, island), 100L); + if (fileManager.getConfig(new File(this.skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getBoolean("Island.Levelling.ScanAutomatically")) { + Bukkit.getServer().getScheduler().runTaskLater(skyblock, () -> skyblock.getLevellingManager().calculatePoints(null, island), 100L); + } } /** diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 6000ad8d..d38b3b6f 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -174,6 +174,8 @@ Island: # time cycle or be fixed. Cycle: false Levelling: + # Run a scan automatically when pasting an island structure + ScanAutomatically: true # Include Points: 0 in the '/is level' GUI IncludeEmptyPointsInList: true # Island Level Points divided by value