예제 #1
0
 /**
  * @param Tile $tile
  *
  * @throws LevelException
  */
 public function removeTile(Tile $tile)
 {
     if ($tile->getLevel() !== $this) {
         throw new LevelException("Invalid Tile level");
     }
     unset($this->tiles[$tile->getId()]);
     unset($this->updateTiles[$tile->getId()]);
     $this->clearChunkCache($tile->getX() >> 4, $tile->getZ() >> 4);
 }
예제 #2
0
 /**
  * @param Tile $tile
  *
  * @throws LevelException
  */
 public function removeTile(Tile $tile)
 {
     if ($tile->getLevel() !== $this) {
         throw new LevelException("Invalid Tile level");
     }
     unset($this->tiles[$tile->getId()]);
     unset($this->updateTiles[$tile->getId()]);
 }
예제 #3
0
 /**
  * @param Tile $tile
  *
  * @throws \RuntimeException
  */
 public function removeTile(Tile $tile)
 {
     if ($tile->getLevel() !== $this) {
         throw new \RuntimeException("Invalid Tile level");
     }
     if ($this->isChunkLoaded($tile->chunk->getX(), $tile->chunk->getZ())) {
         $this->getChunkAt($tile->chunk->getX(), $tile->chunk->getZ(), true)->removeTile($tile);
     }
     unset($this->tiles[$tile->getID()]);
 }