Commits
md_5 authored 0d76f8658d2
1 1 | package org.bukkit; |
2 2 | |
3 + | import net.minecraft.server.MinecraftKey; |
4 + | import org.bukkit.craftbukkit.util.CraftNamespacedKey; |
3 5 | import org.bukkit.loot.LootTable; |
4 6 | import org.bukkit.loot.LootTables; |
5 7 | import org.bukkit.support.AbstractTestingBase; |
6 8 | import org.junit.Assert; |
7 9 | import org.junit.Test; |
8 10 | |
9 11 | public class LootTablesTest extends AbstractTestingBase { |
10 12 | |
11 13 | |
12 14 | public void testLootTablesEnumExists() { |
13 15 | LootTables[] tables = LootTables.values(); |
14 16 | |
15 17 | for (LootTables table : tables) { |
16 18 | LootTable lootTable = Bukkit.getLootTable(table.getKey()); |
17 19 | |
18 20 | Assert.assertNotNull("Unknown LootTable " + table.getKey(), lootTable); |
19 21 | Assert.assertEquals(lootTable.getKey(), table.getKey()); |
20 22 | } |
21 23 | } |
24 + | |
25 + | |
26 + | public void testNMS() { |
27 + | for (MinecraftKey key : net.minecraft.server.LootTables.a()) { |
28 + | NamespacedKey bukkitKey = CraftNamespacedKey.fromMinecraft(key); |
29 + | LootTables lootTable = Registry.LOOT_TABLES.get(bukkitKey); |
30 + | |
31 + | Assert.assertNotNull("Unknown LootTable " + key, lootTable); |
32 + | Assert.assertEquals(lootTable.getKey(), bukkitKey); |
33 + | } |
34 + | } |
22 35 | } |