SPIGOT-1936: LootTable API

This commit is contained in:
Senmori
2018-08-12 18:39:51 +10:00
committed by md_5
parent 15da706706
commit c0df4b82d3
15 changed files with 434 additions and 21 deletions

View File

@@ -95,6 +95,7 @@ import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.Recipe;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
import org.bukkit.loot.LootTable;
import org.bukkit.permissions.Permissible;
import org.bukkit.permissions.Permission;
import org.bukkit.plugin.Plugin;
@@ -1765,6 +1766,13 @@ public final class CraftServer implements Server {
}
}
public LootTable getLootTable(NamespacedKey key) {
Validate.notNull(key, "NamespacedKey cannot be null");
LootTableRegistry registry = getServer().aP(); // PAIL getLootTableRegistry
return new CraftLootTable(key, registry.a(CraftNamespacedKey.toMinecraft(key))); // PAIL rename getLootTable
}
@Deprecated
@Override
public UnsafeValues getUnsafe() {