Inheritance: extends pocketmine\level\format\FullChunk
示例#1
0
 public function close()
 {
     if ($this->closed === false) {
         $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);
         }
     }
 }
示例#2
0
 public function close()
 {
     if (!$this->closed) {
         $this->server->getPluginManager()->callEvent(new EntityDespawnEvent($this));
         $this->closed = true;
         if ($this->chunk !== null) {
             $this->chunk->removeEntity($this);
         }
         if ($this->level instanceof Level) {
             $this->level->removeEntity($this);
         }
         $this->despawnFromAll();
     }
 }
示例#3
0
 public function close()
 {
     if (!$this->closed) {
         $this->server->getPluginManager()->callEvent(new EntityDespawnEvent($this));
         $this->closed = true;
         unset($this->level->updateEntities[$this->id]);
         if ($this->chunk instanceof FullChunk) {
             $this->chunk->removeEntity($this);
         }
         if ($this->level instanceof Level) {
             $this->level->removeEntity($this);
         }
         $this->despawnFromAll();
     }
 }
示例#4
0
 protected function switchLevel(Level $targetLevel)
 {
     if ($this->closed) {
         return false;
     }
     if ($this->isValid()) {
         $this->server->getPluginManager()->callEvent($ev = new EntityLevelChangeEvent($this, $this->level, $targetLevel));
         if ($ev->isCancelled()) {
             return false;
         }
         $this->level->removeEntity($this);
         if ($this->chunk !== null) {
             $this->chunk->removeEntity($this);
         }
         $this->despawnFromAll();
     }
     $this->setLevel($targetLevel);
     $this->level->addEntity($this);
     $this->chunk = null;
     return true;
 }
示例#5
0
 public function generateChunk($x, $z)
 {
     $this->setChunk($x, $z, Chunk::getEmptyChunk($x, $z, $this->provider));
 }
示例#6
0
 public function close()
 {
     if (!$this->closed) {
         $this->server->getPluginManager()->callEvent(new EntityDespawnEvent($this));
         $this->closed = true;
         $this->despawnFromAll();
         //Unlink Entity
         if ($this->isLinked()) {
             $this->unlinkEntity();
         }
         if ($this->chunk !== null) {
             $this->chunk->removeEntity($this);
         }
         if ($this->level !== null) {
             $this->level->removeEntity($this);
         }
     }
 }
示例#7
0
 public function generateChunk($x, $z, $force = false)
 {
     $this->setChunk($x, $z, Chunk::getEmptyChunk($x, $z, $this->provider));
     return true;
 }
示例#8
0
 public function close()
 {
     if (!$this->closed) {
         $this->server->getPluginManager()->callEvent(new EntityDespawnEvent($this));
         $this->closed = true;
         $this->despawnFromAll();
         if ($this->linkedType != 0) {
             $this->linkedEntity->setLinked(0, $this);
         }
         if ($this->chunk !== null) {
             $this->chunk->removeEntity($this);
         }
         if ($this->level !== null) {
             $this->level->removeEntity($this);
         }
     }
     if ($this->getLevel()->getServer()->redstoneEnabled) {
         /** @var \pocketmine\block\PressurePlate $block **/
         foreach ($this->activatedPressurePlates as $key => $block) {
             $block->checkActivation();
         }
     }
 }