From c163c4b6a94fe70db7f66cc39e7fc1c69ab71f95 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Wed, 28 Jun 2023 11:06:47 -0700 Subject: [PATCH] Fix replenishable container entities save/load existing contents (#9417) --- ...Table-API-Replenishable-Lootables-Feature.patch | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch b/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch index 76486a294f..5fa69bc847 100644 --- a/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch +++ b/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch @@ -590,19 +590,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 nbt.putLong("LootTableSeed", this.getLootTableSeed()); } - } else { -+ } else if (true) { // Paper - always load the items, table may still remain - ContainerHelper.saveAllItems(nbt, this.getItemStacks()); +- ContainerHelper.saveAllItems(nbt, this.getItemStacks()); } ++ ContainerHelper.saveAllItems(nbt, this.getItemStacks()); // Paper - always save the items, table may still remain + } + + default void readChestVehicleSaveData(CompoundTag nbt) { @@ -0,0 +0,0 @@ public interface ContainerEntity extends Container, MenuProvider { if (nbt.contains("LootTable", 8)) { this.setLootTable(new ResourceLocation(nbt.getString("LootTable"))); this.setLootTableSeed(nbt.getLong("LootTableSeed")); - } else { -+ } else if (true) { // Paper - always load the items, table may still remain - ContainerHelper.loadAllItems(nbt, this.getItemStacks()); +- ContainerHelper.loadAllItems(nbt, this.getItemStacks()); } ++ ContainerHelper.loadAllItems(nbt, this.getItemStacks()); // Paper - always load the items, table may still remain + } + + default void chestVehicleDestroyed(DamageSource source, Level world, Entity vehicle) { @@ -0,0 +0,0 @@ public interface ContainerEntity extends Container, MenuProvider { default void unpackChestVehicleLootTable(@Nullable Player player) {