diff --git a/paper-server/src/test/java/org/bukkit/ChunkLoadLevelTest.java b/paper-server/src/test/java/org/bukkit/ChunkLoadLevelTest.java new file mode 100644 index 0000000000..e5bc2ffd34 --- /dev/null +++ b/paper-server/src/test/java/org/bukkit/ChunkLoadLevelTest.java @@ -0,0 +1,22 @@ +package org.bukkit; + +import net.minecraft.server.level.PlayerChunk; +import org.junit.Assert; +import org.junit.Test; + +public class ChunkLoadLevelTest { + + @Test + public void testOrdinalsAndNames() { + Chunk.LoadLevel[] bukkit = Chunk.LoadLevel.values(); + PlayerChunk.State[] nms = PlayerChunk.State.values(); + + Assert.assertEquals("Enum length mismatch", bukkit.length - 1, nms.length); // Final entry is Bukkit-specific UNLOADED + for (int i = 0; i < nms.length; i++) { + Assert.assertEquals("Enum name mismatch, expected Bukkit " + bukkit[i] + " got NMS " + nms[i], bukkit[i].name(), nms[i].name()); + } + + // Check that Bukkit-specific UNLOADED is last + Assert.assertEquals("Final Bukkit entry should be UNLOADED", Chunk.LoadLevel.UNLOADED, bukkit[bukkit.length - 1]); + } +}