mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
ChunkCache: parameterize dimension ID
(cc @Muqsit)
This commit is contained in:
parent
0a9a45a126
commit
21ccd90147
8
src/network/mcpe/cache/ChunkCache.php
vendored
8
src/network/mcpe/cache/ChunkCache.php
vendored
@ -88,9 +88,13 @@ class ChunkCache implements ChunkListener{
|
|||||||
private int $hits = 0;
|
private int $hits = 0;
|
||||||
private int $misses = 0;
|
private int $misses = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @phpstan-param DimensionIds::* $dimensionId
|
||||||
|
*/
|
||||||
private function __construct(
|
private function __construct(
|
||||||
private World $world,
|
private World $world,
|
||||||
private Compressor $compressor
|
private Compressor $compressor,
|
||||||
|
private int $dimensionId = DimensionIds::OVERWORLD
|
||||||
){}
|
){}
|
||||||
|
|
||||||
private function prepareChunkAsync(int $chunkX, int $chunkZ, int $chunkHash) : CompressBatchPromise{
|
private function prepareChunkAsync(int $chunkX, int $chunkZ, int $chunkHash) : CompressBatchPromise{
|
||||||
@ -109,7 +113,7 @@ class ChunkCache implements ChunkListener{
|
|||||||
new ChunkRequestTask(
|
new ChunkRequestTask(
|
||||||
$chunkX,
|
$chunkX,
|
||||||
$chunkZ,
|
$chunkZ,
|
||||||
DimensionIds::OVERWORLD, //TODO: not hardcode this
|
$this->dimensionId,
|
||||||
$chunk,
|
$chunk,
|
||||||
$promise,
|
$promise,
|
||||||
$this->compressor
|
$this->compressor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user