Merge branch '3.5' into master-rollback

This commit is contained in:
Dylan K. Taylor
2019-02-04 19:47:21 +00:00
4 changed files with 18 additions and 10 deletions

View File

@ -561,7 +561,10 @@ class Level implements ChunkManager, Metadatable{
}
/**
* Gets the players being used in a specific chunk
* @deprecated WARNING: This function has a misleading name. Contrary to what the name might imply, this function
* DOES NOT return players who are IN a chunk, rather, it returns players who can SEE the chunk.
*
* Returns a list of players who have the target chunk within their view distance.
*
* @param int $chunkX
* @param int $chunkZ
@ -678,8 +681,7 @@ class Level implements ChunkManager, Metadatable{
}
/**
* WARNING: Do not use this, it's only for internal use.
* Changes to this function won't be recorded on the version.
* @internal
*
* @param Player ...$targets If empty, will send to all players in the level.
*/
@ -699,8 +701,7 @@ class Level implements ChunkManager, Metadatable{
}
/**
* WARNING: Do not use this, it's only for internal use.
* Changes to this function won't be recorded on the version.
* @internal
*
* @param int $currentTick
*
@ -2262,8 +2263,10 @@ class Level implements ChunkManager, Metadatable{
$oldChunk = $this->getChunk($chunkX, $chunkZ, false);
if($oldChunk !== null and $oldChunk !== $chunk){
if($deleteEntitiesAndTiles){
$players = $this->getChunkPlayers($chunkX, $chunkZ);
foreach($players as $player){
foreach($oldChunk->getEntities() as $player){
if(!($player instanceof Player)){
continue;
}
$chunk->addEntity($player);
$oldChunk->removeEntity($player);
$player->chunk = $chunk;
@ -2618,6 +2621,7 @@ class Level implements ChunkManager, Metadatable{
$loader->onChunkLoaded($chunk);
}
}else{
$this->server->getLogger()->debug("Newly loaded chunk $x $z has no loaders registered, will be unloaded at next available opportunity");
$this->unloadChunkRequest($x, $z);
}