Skip to content

Commit 3ecf30d

Browse files
committed
Add method to get parent world from competition map
1 parent fa011ce commit 3ecf30d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

plugin/src/main/java/org/battleplugins/arena/competition/map/LiveCompetitionMap.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class LiveCompetitionMap implements ArenaLike, CompetitionMap, PostProces
5454
private Spawns spawns;
5555

5656
private World mapWorld;
57+
private World parentWorld;
5758

5859
public LiveCompetitionMap() {
5960
}
@@ -158,6 +159,18 @@ public final World getWorld() {
158159
return this.mapWorld;
159160
}
160161

162+
/**
163+
* Gets the parent world of the map.
164+
* <p>
165+
* This is the world that the map is located in, or the parent world
166+
* if the map is a dynamic map.
167+
*
168+
* @return the parent world of the map
169+
*/
170+
public final World getParentWorld() {
171+
return this.parentWorld == null ? this.mapWorld : this.parentWorld;
172+
}
173+
161174
/**
162175
* Gets the {@link Bounds} of the map.
163176
*

0 commit comments

Comments
 (0)