mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Separate TickingChunkLoader from ChunkLoader
this makes it possible to keep chunks loaded without ticking them.
This commit is contained in:
@ -211,7 +211,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
protected $chunksPerTick;
|
||||
/** @var ChunkSelector */
|
||||
protected $chunkSelector;
|
||||
/** @var TickingChunkLoader */
|
||||
/** @var PlayerChunkLoader */
|
||||
protected $chunkLoader;
|
||||
|
||||
/** @var bool[] map: raw UUID (string) => bool */
|
||||
@ -295,7 +295,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
$onGround = true;
|
||||
}
|
||||
|
||||
$this->chunkLoader = new TickingChunkLoader($spawn);
|
||||
$this->chunkLoader = new PlayerChunkLoader($spawn);
|
||||
|
||||
//load the spawn chunk so we can see the terrain
|
||||
$world->registerChunkLoader($this->chunkLoader, $spawn->getFloorX() >> 4, $spawn->getFloorZ() >> 4, true);
|
||||
|
@ -24,9 +24,9 @@ declare(strict_types=1);
|
||||
namespace pocketmine\player;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\world\ChunkLoader;
|
||||
use pocketmine\world\TickingChunkLoader;
|
||||
|
||||
final class TickingChunkLoader implements ChunkLoader{
|
||||
final class PlayerChunkLoader implements TickingChunkLoader{
|
||||
|
||||
/** @var Vector3 */
|
||||
private $currentLocation;
|
Reference in New Issue
Block a user