SPIGOT-7014: getLootTable API should not persistently update loot table

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2022-05-09 18:13:06 +10:00
parent 98756897b7
commit 27ea8b4a25

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.entity;
import com.google.common.base.Preconditions;
import net.minecraft.resources.MinecraftKey;
import net.minecraft.world.entity.EntityInsentient;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
@ -61,11 +62,7 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
@Override
public LootTable getLootTable() {
if (getHandle().lootTable == null) {
getHandle().lootTable = getHandle().getDefaultLootTable();
}
NamespacedKey key = CraftNamespacedKey.fromMinecraft(getHandle().lootTable);
NamespacedKey key = CraftNamespacedKey.fromMinecraft(getHandle().getLootTable());
return Bukkit.getLootTable(key);
}