Skip to content

Commit 1b3861c

Browse files
committed
Add Location#isAvailable
See #2196
1 parent 73e9a40 commit 1b3861c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/org/spongepowered/api/world/Location.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ public Location(E extent, int x, int y, int z) {
146146
this(extent, new Vector3i(x, y, z));
147147
}
148148

149+
/**
150+
* Gets if the {@link Extent} this location refers to is still loaded and
151+
* available.
152+
*
153+
* @return {@code true} if this extent is available.
154+
*/
155+
public boolean isAvailable() {
156+
return this.extent.get() != null;
157+
}
158+
149159
/**
150160
* Gets the underlying extent.
151161
*

0 commit comments

Comments
 (0)