Fix replenishable container entities save/load existing contents (#9417)
This commit is contained in:
		
					parent
					
						
							
								450a0d64e5
							
						
					
				
			
			
				commit
				
					
						c163c4b6a9
					
				
			
		
					 1 changed files with 10 additions and 4 deletions
				
			
		| 
						 | 
					@ -590,19 +590,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 | 
				
			||||||
                 nbt.putLong("LootTableSeed", this.getLootTableSeed());
 | 
					                 nbt.putLong("LootTableSeed", this.getLootTableSeed());
 | 
				
			||||||
             }
 | 
					             }
 | 
				
			||||||
-        } else {
 | 
					-        } 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 {
 | 
					@@ -0,0 +0,0 @@ public interface ContainerEntity extends Container, MenuProvider {
 | 
				
			||||||
         if (nbt.contains("LootTable", 8)) {
 | 
					         if (nbt.contains("LootTable", 8)) {
 | 
				
			||||||
             this.setLootTable(new ResourceLocation(nbt.getString("LootTable")));
 | 
					             this.setLootTable(new ResourceLocation(nbt.getString("LootTable")));
 | 
				
			||||||
             this.setLootTableSeed(nbt.getLong("LootTableSeed"));
 | 
					             this.setLootTableSeed(nbt.getLong("LootTableSeed"));
 | 
				
			||||||
-        } else {
 | 
					-        } 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 {
 | 
					@@ -0,0 +0,0 @@ public interface ContainerEntity extends Container, MenuProvider {
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
     default void unpackChestVehicleLootTable(@Nullable Player player) {
 | 
					     default void unpackChestVehicleLootTable(@Nullable Player player) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue