#1171: Add method to get chunk load level

By: Jishuna <joshl5324@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2023-04-29 17:37:52 +10:00
parent 747897f79b
commit f4abdeb3f9

View file

@ -352,6 +352,15 @@ public class CraftChunk implements Chunk {
return getHandle(ChunkStatus.STRUCTURE_STARTS).persistentDataContainer;
}
@Override
public LoadLevel getLoadLevel() {
net.minecraft.world.level.chunk.Chunk chunk = worldServer.getChunkIfLoaded(getX(), getZ());
if (chunk == null) {
return LoadLevel.UNLOADED;
}
return LoadLevel.values()[chunk.getFullStatus().ordinal()];
}
@Override
public boolean equals(Object o) {
if (this == o) return true;