mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 23:15:29 +00:00
Removed some direct type checks on Entity/Tile->closed
This commit is contained in:
parent
580ade9092
commit
516bb37a50
@ -170,7 +170,7 @@ class Chunk extends BaseChunk{
|
|||||||
$entities = [];
|
$entities = [];
|
||||||
|
|
||||||
foreach($this->getEntities() as $entity){
|
foreach($this->getEntities() as $entity){
|
||||||
if(!($entity instanceof Player) and $entity->closed !== true){
|
if(!($entity instanceof Player) and !$entity->closed){
|
||||||
$entity->saveNBT();
|
$entity->saveNBT();
|
||||||
$entities[] = $entity->namedtag;
|
$entities[] = $entity->namedtag;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ abstract class Tile extends Position{
|
|||||||
public $z;
|
public $z;
|
||||||
public $attach;
|
public $attach;
|
||||||
public $metadata;
|
public $metadata;
|
||||||
public $closed;
|
public $closed = false;
|
||||||
public $namedtag;
|
public $namedtag;
|
||||||
protected $lastUpdate;
|
protected $lastUpdate;
|
||||||
protected $server;
|
protected $server;
|
||||||
@ -69,7 +69,6 @@ abstract class Tile extends Position{
|
|||||||
$this->chunk = $chunk;
|
$this->chunk = $chunk;
|
||||||
$this->setLevel($chunk->getProvider()->getLevel());
|
$this->setLevel($chunk->getProvider()->getLevel());
|
||||||
$this->namedtag = $nbt;
|
$this->namedtag = $nbt;
|
||||||
$this->closed = false;
|
|
||||||
$this->name = "";
|
$this->name = "";
|
||||||
$this->lastUpdate = microtime(true);
|
$this->lastUpdate = microtime(true);
|
||||||
$this->id = Tile::$tileCount++;
|
$this->id = Tile::$tileCount++;
|
||||||
@ -112,7 +111,7 @@ abstract class Tile extends Position{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function close(){
|
public function close(){
|
||||||
if($this->closed === false){
|
if(!$this->closed){
|
||||||
$this->closed = true;
|
$this->closed = true;
|
||||||
unset($this->level->updateTiles[$this->id]);
|
unset($this->level->updateTiles[$this->id]);
|
||||||
if($this->chunk instanceof FullChunk){
|
if($this->chunk instanceof FullChunk){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user