@@ -167,20 +167,23 @@ private boolean upgradeDoubleChest(BlockPos pos, Level level, BlockState state,
167167
168168 chestBlockEntity .setBeingUpgraded (true );
169169 otherBlockEntity .setBeingUpgraded (true );
170+ StorageBlockEntity newMainBE ;
170171 if (chestBlockEntity .isMainChest ()) {
171- StorageBlockEntity newMainBE = upgradeStorageBlock (pos , level , chestBlockEntity , getBlockState (state ),
172- storageBlock .getNumberOfInventorySlots () * 2 , storageBlock . getNumberOfUpgradeSlots ());
172+ newMainBE = upgradeStorageBlock (pos , level , chestBlockEntity , getBlockState (state ), storageBlock . getNumberOfInventorySlots () * 2 ,
173+ storageBlock .getNumberOfUpgradeSlots ());
173174 upgradeStorageBlock (otherPos , level , otherBlockEntity , otherBlockState , storageBlock .getNumberOfInventorySlots (),
174175 storageBlock .getNumberOfUpgradeSlots ()).setBeingUpgraded (false );
175176 newMainBE .setBeingUpgraded (false );
176177 } else {
177178 StorageBlockEntity newOtherBE = upgradeStorageBlock (pos , level , chestBlockEntity , getBlockState (state ),
178179 storageBlock .getNumberOfInventorySlots (), storageBlock .getNumberOfUpgradeSlots ());
179- upgradeStorageBlock (otherPos , level , otherBlockEntity , otherBlockState , storageBlock .getNumberOfInventorySlots () * 2 ,
180- storageBlock .getNumberOfUpgradeSlots ()).setBeingUpgraded (false );
180+ newMainBE = upgradeStorageBlock (otherPos , level , otherBlockEntity , otherBlockState , storageBlock .getNumberOfInventorySlots () * 2 ,
181+ storageBlock .getNumberOfUpgradeSlots ());
182+ newMainBE .setBeingUpgraded (false );
181183 newOtherBE .setBeingUpgraded (false );
182184 }
183185 otherBlockState .updateNeighbourShapes (level , otherPos , 3 );
186+ newMainBE .changeSlots (newMainBE .getStorageWrapper ().getInventoryHandler ().getSlots ());
184187
185188 return true ;
186189 }
0 commit comments