Skip to content

Commit

Permalink
More API improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Redned235 committed Jun 30, 2024
1 parent a239233 commit f6cd2f0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void removeCompetition(Arena arena, Competition<?> competition) {
}
}

liveCompetition.onDestroy();
liveCompetition.destroy();
}

competitions.remove(competition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,11 @@ public final <E extends org.battleplugins.arena.options.ArenaOption> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit f6cd2f0

Please sign in to comment.