From 7b32fe4d18f9549314f304a2629e4685b33cb251 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 3 Sep 2018 19:16:29 -0400 Subject: [PATCH] Add a #getLootTable() method to LootTables enum By: Parker Hawke --- .../src/main/java/org/bukkit/loot/LootTables.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/loot/LootTables.java b/paper-api/src/main/java/org/bukkit/loot/LootTables.java index 613a198ea9..6e5e4d8ee9 100644 --- a/paper-api/src/main/java/org/bukkit/loot/LootTables.java +++ b/paper-api/src/main/java/org/bukkit/loot/LootTables.java @@ -1,5 +1,6 @@ package org.bukkit.loot; +import org.bukkit.Bukkit; import org.bukkit.Keyed; import org.bukkit.NamespacedKey; @@ -125,4 +126,14 @@ public enum LootTables implements Keyed { public NamespacedKey getKey() { return NamespacedKey.minecraft(location); } + + /** + * Get the {@link LootTable} corresponding to this constant. This is + * equivalent to calling {@code Bukkit.getLootTable(this.getKey());}. + * + * @return the associated LootTable + */ + public LootTable getLootTable() { + return Bukkit.getLootTable(getKey()); + } }