From aed06b74c02dd2e9b0e9790b9f2c5682733076b8 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 12 Sep 2020 08:22:14 -0700 Subject: [PATCH] Remove initial island level from fireIslandLevelCalcEvent if addon has zero island level set https://github.com/BentoBoxWorld/Level/issues/189 --- src/main/java/world/bentobox/level/LevelsManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/level/LevelsManager.java b/src/main/java/world/bentobox/level/LevelsManager.java index ab9d42e..5a8084b 100644 --- a/src/main/java/world/bentobox/level/LevelsManager.java +++ b/src/main/java/world/bentobox/level/LevelsManager.java @@ -205,7 +205,11 @@ public class LevelsManager { keyValues.put("eventName", "IslandLevelCalculatedEvent"); keyValues.put("targetPlayer", targetPlayer); keyValues.put("islandUUID", island.getUniqueId()); - keyValues.put("level", results.getLevel()); + if (addon.getSettings().isZeroNewIslandLevels()) { + keyValues.put("level", results.getLevel() - results.getInitialLevel()); + } else { + keyValues.put("level", results.getLevel()); + } keyValues.put("pointsToNextLevel", results.getPointsToNextLevel()); keyValues.put("deathHandicap", results.getDeathHandicap()); keyValues.put("initialLevel", results.getInitialLevel());