mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
SlotChangeAction: fix feedback loop
This commit is contained in:
parent
8551d1e282
commit
44be2179c4
@ -110,9 +110,11 @@ class SlotChangeAction extends InventoryAction{
|
|||||||
*/
|
*/
|
||||||
public function onExecuteSuccess(Player $source) : void{
|
public function onExecuteSuccess(Player $source) : void{
|
||||||
foreach($this->inventory->getViewers() as $viewer){
|
foreach($this->inventory->getViewers() as $viewer){
|
||||||
|
if($viewer !== $source){
|
||||||
$viewer->getNetworkSession()->syncInventorySlot($this->inventory, $this->inventorySlot);
|
$viewer->getNetworkSession()->syncInventorySlot($this->inventory, $this->inventorySlot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends the original slot contents to the source player to revert the action.
|
* Sends the original slot contents to the source player to revert the action.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user