13
0
geforkt von Mirrors/Paper

Fix replenishable container entities save/load existing contents (#9417)

Dieser Commit ist enthalten in:
Jake Potrebic 2023-06-28 11:06:47 -07:00
Ursprung 450a0d64e5
Commit c163c4b6a9

Datei anzeigen

@ -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) {