Added API method Entity->isClosed() and made Entity->closed protected

This commit is contained in:
Dylan K. Taylor
2017-08-16 19:30:23 +01:00
parent 20aa519f3a
commit eebc52e00b
7 changed files with 21 additions and 8 deletions

View File

@ -817,7 +817,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
if($this->spawned){
foreach($this->level->getChunkEntities($x, $z) as $entity){
if($entity !== $this and !$entity->closed and $entity->isAlive()){
if($entity !== $this and !$entity->isClosed() and $entity->isAlive()){
$entity->spawnTo($this);
}
}
@ -896,7 +896,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
foreach($this->usedChunks as $index => $c){
Level::getXZ($index, $chunkX, $chunkZ);
foreach($this->level->getChunkEntities($chunkX, $chunkZ) as $entity){
if($entity !== $this and !$entity->closed and $entity->isAlive()){
if($entity !== $this and !$entity->isClosed() and $entity->isAlive()){
$entity->spawnTo($this);
}
}