From 77c77f1482a8a9ccec0aa5bd335fac768bad5605 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 26 Aug 2018 08:37:09 -0700 Subject: [PATCH] Fixed sea height bug. Sea height was not being taken from world settings --- .../level/calculators/CalcIslandLevel.java | 3 ++- .../bentobox/addon/level/config/Settings.java | 26 ------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/src/main/java/bentobox/addon/level/calculators/CalcIslandLevel.java b/src/main/java/bentobox/addon/level/calculators/CalcIslandLevel.java index e24fc10..593d4de 100644 --- a/src/main/java/bentobox/addon/level/calculators/CalcIslandLevel.java +++ b/src/main/java/bentobox/addon/level/calculators/CalcIslandLevel.java @@ -123,7 +123,8 @@ public class CalcIslandLevel { for (int y = 0; y < island.getCenter().getWorld().getMaxHeight(); y++) { Material blockData = chunk.getBlockType(x, y, z); - boolean belowSeaLevel = addon.getSettings().getSeaHeight() > 0 && y <= addon.getSettings().getSeaHeight(); + int seaHeight = addon.getPlugin().getIWM().getSeaHeight(world); + boolean belowSeaLevel = seaHeight > 0 && y <= seaHeight; // Air is free if (!blockData.equals(Material.AIR)) { checkBlock(blockData, belowSeaLevel); diff --git a/src/main/java/bentobox/addon/level/config/Settings.java b/src/main/java/bentobox/addon/level/config/Settings.java index 0249040..0036e20 100644 --- a/src/main/java/bentobox/addon/level/config/Settings.java +++ b/src/main/java/bentobox/addon/level/config/Settings.java @@ -13,14 +13,12 @@ import bentobox.addon.level.Level; public class Settings { private boolean sumTeamDeaths; - private int seaHeight; private Map blockLimits = new HashMap<>(); private Map blockValues = new HashMap<>(); private final Map> worldBlockValues = new HashMap<>(); private double underWaterMultiplier; private int deathpenalty; private long levelCost; - private Object defaultLanguage; private int levelWait; private int maxDeaths; private boolean islandResetDeathReset; @@ -106,18 +104,6 @@ public class Settings { private void setSumTeamDeaths(boolean sumTeamDeaths) { this.sumTeamDeaths = sumTeamDeaths; } - /** - * @return the seaHeight - */ - public final int getSeaHeight() { - return seaHeight; - } - /** - * @param seaHeight the seaHeight to set - */ - public final void setSeaHeight(int seaHeight) { - this.seaHeight = seaHeight; - } /** * @return the blockLimits */ @@ -178,18 +164,6 @@ public class Settings { private void setLevelCost(long levelCost) { this.levelCost = levelCost; } - /** - * @return the defaultLanguage - */ - public final Object getDefaultLanguage() { - return defaultLanguage; - } - /** - * @param defaultLanguage the defaultLanguage to set - */ - public final void setDefaultLanguage(Object defaultLanguage) { - this.defaultLanguage = defaultLanguage; - } /** * @return the levelWait */