From d8b838cc36ba9398d8ec173fd11aea69dea11b6a Mon Sep 17 00:00:00 2001 From: tastybento Date: Fri, 10 Jan 2020 16:22:44 -0800 Subject: [PATCH] Makes result of the IslandLevelCalculatedEvent easier for plugins to get https://github.com/BentoBoxWorld/Level/issues/118 --- pom.xml | 2 +- .../event/IslandLevelCalculatedEvent.java | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 59cbd94..89e9be4 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ -LOCAL - 1.9.2 + 1.9.3 diff --git a/src/main/java/world/bentobox/level/event/IslandLevelCalculatedEvent.java b/src/main/java/world/bentobox/level/event/IslandLevelCalculatedEvent.java index 73a9ed8..391c6bf 100644 --- a/src/main/java/world/bentobox/level/event/IslandLevelCalculatedEvent.java +++ b/src/main/java/world/bentobox/level/event/IslandLevelCalculatedEvent.java @@ -1,5 +1,6 @@ package world.bentobox.level.event; +import java.util.List; import java.util.UUID; import world.bentobox.bentobox.api.events.IslandBaseEvent; @@ -29,11 +30,49 @@ public class IslandLevelCalculatedEvent extends IslandBaseEvent { } /** + * Do NOT get this result if you are not a BentoBox addon! * @return the results */ public Results getResults() { return results; } + + /** + * @return death handicap value + */ + public int getDeathHandicap() { + return results.getDeathHandicap(); + } + + /** + * Get the island's initial level. It may be zero if it was never calculated + * or if a player was registered to the island after it was made. + * @return initial level of island as calculated when the island was created. + */ + public long getInitialLevel() { + return results.getInitialLevel(); + } + + /** + * @return the level calculated + */ + public long getLevel() { + return results.getLevel(); + } + + /** + * @return number of points required to next level + */ + public long getPointsToNextLevel() { + return results.getPointsToNextLevel(); + } + + /** + * @return a human readable report explaining how the calculation was made + */ + public List getReport() { + return results.getReport(); + } /** * @return the targetPlayer @@ -42,6 +81,7 @@ public class IslandLevelCalculatedEvent extends IslandBaseEvent { return targetPlayer; } /** + * Do not use this if you are not a BentoBox addon * @param results the results to set */ public void setResults(Results results) {