SPIGOT-1936: LootTable API

By: Senmori <thesenmori@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2018-08-12 18:39:51 +10:00
parent 277f0db6c9
commit 39c4334d76
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() {