From 1087e895bb98e01ee367d7a6bb466495f61ff631 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 29 Apr 2023 17:37:50 +1000 Subject: [PATCH] #846: Add method to get chunk load level By: Jishuna --- paper-api/src/main/java/org/bukkit/Chunk.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/Chunk.java b/paper-api/src/main/java/org/bukkit/Chunk.java index 94db3cfa41..efbfed8552 100644 --- a/paper-api/src/main/java/org/bukkit/Chunk.java +++ b/paper-api/src/main/java/org/bukkit/Chunk.java @@ -253,4 +253,40 @@ public interface Chunk extends PersistentDataHolder { * @return if the biome is contained within */ boolean contains(@NotNull Biome biome); + + /** + * Gets the load level of this chunk, which determines what game logic is + * processed. + * + * @return the load level + */ + @NotNull + LoadLevel getLoadLevel(); + + /** + * An enum to specify the load level of a chunk. + */ + public enum LoadLevel { + + /** + * No game logic is processed, world generation may still occur. + */ + INACCESSIBLE, + /** + * Most game logic is not processed, including entities and redstone. + */ + BORDER, + /** + * All game logic except entities is processed. + */ + TICKING, + /** + * All game logic is processed. + */ + ENTITY_TICKING, + /** + * This chunk is not loaded. + */ + UNLOADED; + } }