pocketmine\tile\Tile::close PHP Method

close() public method

public close ( )
    public function close()
    {
        if (!$this->closed) {
            $this->closed = true;
            unset($this->level->updateTiles[$this->id]);
            if ($this->chunk instanceof FullChunk) {
                $this->chunk->removeTile($this);
            }
            if (($level = $this->getLevel()) instanceof Level) {
                $level->removeTile($this);
            }
            $this->level = null;
        }
    }

Usage Example

Ejemplo n.º 1
0
 public function close()
 {
     if ($this->closed === false) {
         foreach ($this->getInventory()->getViewers() as $player) {
             $player->removeWindow($this->getInventory());
         }
         parent::close();
     }
 }