Clean up inventory content syncing, fixes #5441

these remnants should have been cleaned up in 4.11, but I somehow managed to skip over them.
This commit is contained in:
Dylan K. Taylor
2022-12-04 23:05:30 +00:00
parent 774e23137e
commit b5cfab497d
2 changed files with 9 additions and 28 deletions

View File

@ -191,8 +191,10 @@ class InventoryManager{
*/
public function addPredictedSlotChanges(array $networkInventoryActions) : void{
foreach($networkInventoryActions as $action){
if($action->sourceType === NetworkInventoryAction::SOURCE_CONTAINER && isset($this->windowMap[$action->windowId])){
//this won't cover stuff like crafting grid due to too much magic
if($action->sourceType === NetworkInventoryAction::SOURCE_CONTAINER && (
isset($this->windowMap[$action->windowId]) ||
($action->windowId === ContainerIds::UI && isset($this->complexSlotToWindowMap[$action->inventorySlot]))
)){
try{
$item = TypeConverter::getInstance()->netItemStackToCore($action->newItem->getItemStack());
}catch(TypeConversionException $e){