diff --git a/plugin/src/main/java/org/battleplugins/arena/competition/CompetitionManager.java b/plugin/src/main/java/org/battleplugins/arena/competition/CompetitionManager.java index 57bc363b..059c8dc9 100644 --- a/plugin/src/main/java/org/battleplugins/arena/competition/CompetitionManager.java +++ b/plugin/src/main/java/org/battleplugins/arena/competition/CompetitionManager.java @@ -181,7 +181,7 @@ public void removeCompetition(Arena arena, Competition competition) { } } - liveCompetition.onDestroy(); + liveCompetition.destroy(); } competitions.remove(competition); diff --git a/plugin/src/main/java/org/battleplugins/arena/competition/LiveCompetition.java b/plugin/src/main/java/org/battleplugins/arena/competition/LiveCompetition.java index b77b9365..6022b7f4 100644 --- a/plugin/src/main/java/org/battleplugins/arena/competition/LiveCompetition.java +++ b/plugin/src/main/java/org/battleplugins/arena/competition/LiveCompetition.java @@ -306,7 +306,11 @@ public final E getOption return this.arena.getOption(type); } - protected final void onDestroy() { + protected final void destroy() { + this.onDestroy(); + } + + protected void onDestroy() { this.arena.getEventManager().unregisterEvents(this.competitionListener); this.arena.getEventManager().unregisterEvents(this.optionsListener); this.arena.getEventManager().unregisterEvents(this.statListener); diff --git a/plugin/src/main/java/org/battleplugins/arena/competition/map/options/Bounds.java b/plugin/src/main/java/org/battleplugins/arena/competition/map/options/Bounds.java index 2a12b547..52659dc7 100644 --- a/plugin/src/main/java/org/battleplugins/arena/competition/map/options/Bounds.java +++ b/plugin/src/main/java/org/battleplugins/arena/competition/map/options/Bounds.java @@ -70,6 +70,22 @@ public int getMaxZ() { return this.maxZ; } + public int getWidth() { + return this.maxX - this.minX; + } + + public int getHeight() { + return this.maxY - this.minY; + } + + public int getLength() { + return this.maxZ - this.minZ; + } + + public int getVolume() { + return this.getWidth() * this.getHeight() * this.getLength(); + } + public boolean isInside(Bounds bounds) { return this.isInside(bounds.getMinX(), bounds.getMinY(), bounds.getMinZ()) && this.isInside(bounds.getMaxX(), bounds.getMaxY(), bounds.getMaxZ()); }