mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Improved unloaded tile entity handling
This commit is contained in:
parent
9e5e4fb362
commit
e473cd5e67
@ -1595,7 +1595,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
* @return bool
|
||||
*/
|
||||
public function isChunkInUse($x, $z){
|
||||
return isset($this->usedChunks[static::chunkHash($x, $z)]) and count($this->usedChunks[static::chunkHash($x, $z)]) > 0;
|
||||
return isset($this->usedChunks[Level::chunkHash($x, $z)]) and count($this->usedChunks[Level::chunkHash($x, $z)]) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,6 +54,10 @@ abstract class Spawnable extends Tile{
|
||||
}
|
||||
|
||||
public function spawnToAll(){
|
||||
if($this->closed){
|
||||
return;
|
||||
}
|
||||
|
||||
foreach($this->getLevel()->getPlayers() as $player){
|
||||
if($player->spawned === true){
|
||||
$this->spawnTo($player);
|
||||
|
@ -70,7 +70,7 @@ abstract class Tile extends Position{
|
||||
|
||||
$this->server = $chunk->getProvider()->getLevel()->getServer();
|
||||
$this->chunk = $chunk;
|
||||
$this->setLevel($chunk->getProvider()->getLevel(), true); //Strong reference
|
||||
$this->setLevel($chunk->getProvider()->getLevel());
|
||||
$this->namedtag = $nbt;
|
||||
$this->closed = false;
|
||||
$this->name = "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user