mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-09 11:31:49 +00:00
parent
3b7ece3363
commit
8769d2bcd1
@ -585,7 +585,7 @@ abstract class Entity extends Position implements Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onUpdate(){
|
public function onUpdate(){
|
||||||
if($this->closed !== false){
|
if($this->closed){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->timings->startTiming();
|
$this->timings->startTiming();
|
||||||
@ -1171,6 +1171,9 @@ abstract class Entity extends Position implements Metadatable{
|
|||||||
$this->server->getPluginManager()->callEvent(new EntityDespawnEvent($this));
|
$this->server->getPluginManager()->callEvent(new EntityDespawnEvent($this));
|
||||||
$this->closed = true;
|
$this->closed = true;
|
||||||
unset($this->level->updateEntities[$this->id]);
|
unset($this->level->updateEntities[$this->id]);
|
||||||
|
if($this->chunk instanceof FullChunk){
|
||||||
|
$this->chunk->removeEntity($this);
|
||||||
|
}
|
||||||
if(($level = $this->getLevel()) instanceof Level){
|
if(($level = $this->getLevel()) instanceof Level){
|
||||||
$level->removeEntity($this);
|
$level->removeEntity($this);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user