diff --git a/paper-api/src/main/java/org/bukkit/Chunk.java b/paper-api/src/main/java/org/bukkit/Chunk.java index 079b9febea..441ed7ad22 100644 --- a/paper-api/src/main/java/org/bukkit/Chunk.java +++ b/paper-api/src/main/java/org/bukkit/Chunk.java @@ -130,4 +130,26 @@ public interface Chunk { * @return true if slimes are able to spawn in this chunk */ boolean isSlimeChunk(); + + /** + * Gets whether the chunk at the specified chunk coordinates is force + * loaded. + *

+ * A force loaded chunk will not be unloaded due to lack of player activity. + * + * @return force load status + * @see World#isChunkForceLoaded(int, int) + */ + boolean isForceLoaded(); + + /** + * Sets whether the chunk at the specified chunk coordinates is force + * loaded. + *

+ * A force loaded chunk will not be unloaded due to lack of player activity. + * + * @param forced + * @see World#setChunkForceLoaded(int, int, boolean) + */ + void setForceLoaded(boolean forced); } diff --git a/paper-api/src/main/java/org/bukkit/World.java b/paper-api/src/main/java/org/bukkit/World.java index 4a703ddbc8..fb6ccf28cb 100644 --- a/paper-api/src/main/java/org/bukkit/World.java +++ b/paper-api/src/main/java/org/bukkit/World.java @@ -285,6 +285,39 @@ public interface World extends PluginMessageRecipient, Metadatable { @Deprecated public boolean refreshChunk(int x, int z); + /** + * Gets whether the chunk at the specified chunk coordinates is force + * loaded. + *

+ * A force loaded chunk will not be unloaded due to lack of player activity. + * + * @param x X-coordinate of the chunk + * @param z Z-coordinate of the chunk + * @return force load status + */ + public boolean isChunkForceLoaded(int x, int z); + + /** + * Sets whether the chunk at the specified chunk coordinates is force + * loaded. + *

+ * A force loaded chunk will not be unloaded due to lack of player activity. + * + * @param x X-coordinate of the chunk + * @param z Z-coordinate of the chunk + * @param forced + */ + public void setChunkForceLoaded(int x, int z, boolean forced); + + /** + * Returns all force loaded chunks in this world. + *

+ * A force loaded chunk will not be unloaded due to lack of player activity. + * + * @return unmodifiable collection of force loaded chunks + */ + public Collection getForceLoadedChunks(); + /** * Drops an item at the specified {@link Location} *