Server.getLootTable(NamespacedKey) should return null when given a key for a non-existent loot table, but returns a non-null object instead.
This behavior contradicts documentation outlined here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Server.html#getLootTable(org.bukkit.NamespacedKey)
import org.bukkit.NamespacedKey; import org.bukkit.loot.LootTable; import org.bukkit.plugin.java.JavaPlugin; public final class SamplePlugin extends JavaPlugin { @Override public void onEnable() { final LootTable lt = getServer().getLootTable(NamespacedKey.fromString("asdf:hnu9awdfhaw9uh")); getLogger().info("" + lt); } }
Expected Output:
[17:47:28] [Server thread/INFO]: [SamplePlugin] null
Actual Output:
[17:47:28] [Server thread/INFO]: [SamplePlugin] asdf:hnu9awdfhaw9uh