From a572c3eb817623377e44a71e4756f67e5daba0ce Mon Sep 17 00:00:00 2001 From: Choonster TheMage Date: Sat, 11 May 2024 02:10:07 +1000 Subject: [PATCH] Fix LootItemHandler --- .../itemhandler/LootItemHandler.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/choonster/testmod3/world/inventory/itemhandler/LootItemHandler.java b/src/main/java/choonster/testmod3/world/inventory/itemhandler/LootItemHandler.java index 706f8a11..e100bd0e 100644 --- a/src/main/java/choonster/testmod3/world/inventory/itemhandler/LootItemHandler.java +++ b/src/main/java/choonster/testmod3/world/inventory/itemhandler/LootItemHandler.java @@ -3,8 +3,10 @@ import choonster.testmod3.util.InventoryUtils; import com.google.common.base.Preconditions; import net.minecraft.core.NonNullList; +import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; +import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.player.Player; @@ -34,12 +36,12 @@ public class LootItemHandler extends ItemStackHandler { protected final Supplier levelSupplier; /** - * The location of the {@link LootTable} to generate loot from. + * The key of the {@link LootTable} to generate loot from. *

* This will be {@code null} if no {@link LootTable} has been set or loot has already been generated. */ @Nullable - protected ResourceLocation lootTableLocation; + protected ResourceKey lootTable; /** * The random seed to use when generating loot. @@ -67,8 +69,8 @@ public LootItemHandler(final NonNullList stacks, final Supplier getLootTable() { + return lootTable; } }