Improved unloaded tile entity handling

This commit is contained in:
Shoghi Cervantes 2014-08-27 18:18:33 +02:00
parent 9e5e4fb362
commit e473cd5e67
3 changed files with 6 additions and 2 deletions

View File

@ -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;
}
/**

View File

@ -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);

View File

@ -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 = "";