2018-08-12 10:39:51 +02:00
|
|
|
package org.bukkit;
|
|
|
|
|
2019-05-06 00:40:15 +02:00
|
|
|
import net.minecraft.server.MinecraftKey;
|
|
|
|
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
2018-08-12 10:39:51 +02:00
|
|
|
import org.bukkit.loot.LootTable;
|
|
|
|
import org.bukkit.loot.LootTables;
|
|
|
|
import org.bukkit.support.AbstractTestingBase;
|
|
|
|
import org.junit.Assert;
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
public class LootTablesTest extends AbstractTestingBase {
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testLootTablesEnumExists() {
|
|
|
|
LootTables[] tables = LootTables.values();
|
|
|
|
|
|
|
|
for (LootTables table : tables) {
|
|
|
|
LootTable lootTable = Bukkit.getLootTable(table.getKey());
|
|
|
|
|
|
|
|
Assert.assertNotNull("Unknown LootTable " + table.getKey(), lootTable);
|
|
|
|
Assert.assertEquals(lootTable.getKey(), table.getKey());
|
|
|
|
}
|
|
|
|
}
|
2019-05-06 00:40:15 +02:00
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testNMS() {
|
|
|
|
for (MinecraftKey key : net.minecraft.server.LootTables.a()) {
|
|
|
|
NamespacedKey bukkitKey = CraftNamespacedKey.fromMinecraft(key);
|
|
|
|
LootTables lootTable = Registry.LOOT_TABLES.get(bukkitKey);
|
|
|
|
|
|
|
|
Assert.assertNotNull("Unknown LootTable " + key, lootTable);
|
|
|
|
Assert.assertEquals(lootTable.getKey(), bukkitKey);
|
|
|
|
}
|
|
|
|
}
|
2018-08-12 10:39:51 +02:00
|
|
|
}
|