SlotChangeAction: fix feedback loop

This commit is contained in:
Dylan K. Taylor 2019-06-13 18:31:25 +01:00
parent 8551d1e282
commit 44be2179c4

View File

@ -110,9 +110,11 @@ class SlotChangeAction extends InventoryAction{
*/
public function onExecuteSuccess(Player $source) : void{
foreach($this->inventory->getViewers() as $viewer){
if($viewer !== $source){
$viewer->getNetworkSession()->syncInventorySlot($this->inventory, $this->inventorySlot);
}
}
}
/**
* Sends the original slot contents to the source player to revert the action.