pocketmine\inventory\BaseTransaction::sendSlotUpdate PHP Method

sendSlotUpdate() public method

public sendSlotUpdate ( Player $source )
$source pocketmine\Player Sends a slot update to inventory viewers For successful transactions, update non-source viewers (source does not need updating) For failed transactions, update the source (non-source viewers will see nothing anyway)
    public function sendSlotUpdate(Player $source)
    {
        if ($this->getInventory() instanceof TemporaryInventory) {
            return;
        }
        $targets = [];
        if ($this->wasSuccessful) {
            $targets = $this->getInventory()->getViewers();
            unset($targets[spl_object_hash($source)]);
        } else {
            $targets = [$source];
        }
        $this->inventory->sendSlot($this->slot, $targets);
    }