pocketmine\inventory\Inventory::sendSlot PHP Метод

sendSlot() публичный Метод

public sendSlot ( integer $index, Player | Player[] $target )
$index integer
$target pocketmine\Player | pocketmine\Player[]
    public function sendSlot($index, $target);

Usage Example

Пример #1
0
 /**
  * @param Player $source
  *
  * 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);
 }