mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 02:22:12 +01:00
Add test for Chunk.LoadLevel mirroring
By: md_5 <git@md-5.net>
This commit is contained in:
parent
f4abdeb3f9
commit
d58f895450
1 changed files with 22 additions and 0 deletions
|
@ -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]);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue