diff --git a/src/pocketmine/level/format/anvil/Chunk.php b/src/pocketmine/level/format/anvil/Chunk.php index 0373a0d56..1fccad31f 100644 --- a/src/pocketmine/level/format/anvil/Chunk.php +++ b/src/pocketmine/level/format/anvil/Chunk.php @@ -170,7 +170,7 @@ class Chunk extends BaseChunk{ $entities = []; foreach($this->getEntities() as $entity){ - if(!($entity instanceof Player) and $entity->closed !== true){ + if(!($entity instanceof Player) and !$entity->closed){ $entity->saveNBT(); $entities[] = $entity->namedtag; } diff --git a/src/pocketmine/tile/Tile.php b/src/pocketmine/tile/Tile.php index 2444e6b33..b87fd6a43 100644 --- a/src/pocketmine/tile/Tile.php +++ b/src/pocketmine/tile/Tile.php @@ -49,7 +49,7 @@ abstract class Tile extends Position{ public $z; public $attach; public $metadata; - public $closed; + public $closed = false; public $namedtag; protected $lastUpdate; protected $server; @@ -69,7 +69,6 @@ abstract class Tile extends Position{ $this->chunk = $chunk; $this->setLevel($chunk->getProvider()->getLevel()); $this->namedtag = $nbt; - $this->closed = false; $this->name = ""; $this->lastUpdate = microtime(true); $this->id = Tile::$tileCount++; @@ -112,7 +111,7 @@ abstract class Tile extends Position{ } public function close(){ - if($this->closed === false){ + if(!$this->closed){ $this->closed = true; unset($this->level->updateTiles[$this->id]); if($this->chunk instanceof FullChunk){