From 3ecf30d82dc9f920b51a35045f943af9a5fdcc8c Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Sun, 25 Aug 2024 15:57:21 -0500 Subject: [PATCH] Add method to get parent world from competition map --- .../arena/competition/map/LiveCompetitionMap.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugin/src/main/java/org/battleplugins/arena/competition/map/LiveCompetitionMap.java b/plugin/src/main/java/org/battleplugins/arena/competition/map/LiveCompetitionMap.java index ac4a8765..28c23bda 100644 --- a/plugin/src/main/java/org/battleplugins/arena/competition/map/LiveCompetitionMap.java +++ b/plugin/src/main/java/org/battleplugins/arena/competition/map/LiveCompetitionMap.java @@ -54,6 +54,7 @@ public class LiveCompetitionMap implements ArenaLike, CompetitionMap, PostProces private Spawns spawns; private World mapWorld; + private World parentWorld; public LiveCompetitionMap() { } @@ -158,6 +159,18 @@ public final World getWorld() { return this.mapWorld; } + /** + * Gets the parent world of the map. + *

+ * This is the world that the map is located in, or the parent world + * if the map is a dynamic map. + * + * @return the parent world of the map + */ + public final World getParentWorld() { + return this.parentWorld == null ? this.mapWorld : this.parentWorld; + } + /** * Gets the {@link Bounds} of the map. *