From 2fcff1357848f6e7a0f4a4ab487eaa5bffe2a3ae Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 12 Nov 2022 23:32:12 +0000 Subject: [PATCH] World: added getter and setter for simulation radius --- src/world/World.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/world/World.php b/src/world/World.php index 174281118..b41ba3bb4 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -1104,6 +1104,21 @@ class World implements ChunkManager{ unset($this->randomTickBlocks[$block->getFullId()]); } + /** + * Returns the radius of chunks to be ticked around each ticking chunk loader (usually players). This is referred to + * as "simulation distance" in the Minecraft: Bedrock world options screen. + */ + public function getChunkTickRadius() : int{ + return $this->chunkTickRadius; + } + + /** + * Sets the radius of chunks ticked around each ticking chunk loader (usually players). + */ + public function setChunkTickRadius(int $radius) : void{ + $this->chunkTickRadius = $radius; + } + private function tickChunks() : void{ if($this->chunkTickRadius <= 0 || count($this->tickingLoaders) === 0){ return;