From d800a21bd4a6fe04de58f2fd34e63dc23245a68b Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sun, 28 Dec 2014 02:58:17 +0100 Subject: [PATCH] Higher chunk defaults --- src/pocketmine/Server.php | 2 +- src/pocketmine/level/Level.php | 4 +- src/pocketmine/level/generator/Normal.php | 48 +++++++++++------------ src/pocketmine/resources/pocketmine.yml | 9 ++--- 4 files changed, 29 insertions(+), 34 deletions(-) diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 5501449df..799775a99 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -300,7 +300,7 @@ class Server{ * @return int */ public function getViewDistance(){ - return max(56, $this->getProperty("chunk-sending.max-chunks", 96)); + return max(56, $this->getProperty("chunk-sending.max-chunks", 256)); } /** diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index f761b8c91..44997f13f 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -294,8 +294,8 @@ class Level implements ChunkManager, Metadatable{ $this->updateQueue->setExtractFlags(\SplPriorityQueue::EXTR_BOTH); $this->time = (int) $this->provider->getTime(); - $this->chunkTickRadius = min($this->server->getViewDistance(), max(1, (int) $this->server->getProperty("chunk-ticking.tick-radius", 3))); - $this->chunksPerTick = (int) $this->server->getProperty("chunk-ticking.per-tick", 80); + $this->chunkTickRadius = min($this->server->getViewDistance(), max(1, (int) $this->server->getProperty("chunk-ticking.tick-radius", 4))); + $this->chunksPerTick = (int) $this->server->getProperty("chunk-ticking.per-tick", 260); $this->chunkTickList = []; $this->clearChunksOnTick = (bool) $this->server->getProperty("chunk-ticking.clear-tick-list", false); diff --git a/src/pocketmine/level/generator/Normal.php b/src/pocketmine/level/generator/Normal.php index 21900fd5b..7f60e9ac8 100644 --- a/src/pocketmine/level/generator/Normal.php +++ b/src/pocketmine/level/generator/Normal.php @@ -114,37 +114,33 @@ class Normal extends Generator{ $chunk = $this->level->getChunk($chunkX, $chunkZ); - for($chunkY = 0; $chunkY < 8; ++$chunkY){ - $startY = $chunkY << 4; - $endY = $startY + 16; - for($z = 0; $z < 16; ++$z){ - for($x = 0; $x < 16; ++$x){ - $i = ($z << 4) + $x; - $height = $this->worldHeight + $hills[$i] * 14 + $base[$i] * 7; - $height = (int) $height; + for($z = 0; $z < 16; ++$z){ + for($x = 0; $x < 16; ++$x){ + $i = ($z << 4) + $x; + $height = $this->worldHeight + $hills[$i] * 14 + $base[$i] * 7; + $height = (int) $height; - for($y = $startY; $y < $endY; ++$y){ - $diff = $height - $y; - if($y <= 4 and ($y === 0 or $this->random->nextFloat() < 0.75)){ - $chunk->setBlockId($x, $y, $z, Block::BEDROCK); - }elseif($diff > 2){ - $chunk->setBlockId($x, $y, $z, Block::STONE); - }elseif($diff > 0){ - $chunk->setBlockId($x, $y, $z, Block::DIRT); - }elseif($y <= $this->waterHeight){ - if(($this->waterHeight - $y) <= 1 and $diff === 0){ - $chunk->setBlockId($x, $y, $z, Block::SAND); - }elseif($diff === 0){ - $chunk->setBlockId($x, $y, $z, Block::DIRT); - }else{ - $chunk->setBlockId($x, $y, $z, Block::STILL_WATER); - } + for($y = 0; $y < 128; ++$y){ + $diff = $height - $y; + if($y <= 4 and ($y === 0 or $this->random->nextFloat() < 0.75)){ + $chunk->setBlockId($x, $y, $z, Block::BEDROCK); + }elseif($diff > 2){ + $chunk->setBlockId($x, $y, $z, Block::STONE); + }elseif($diff > 0){ + $chunk->setBlockId($x, $y, $z, Block::DIRT); + }elseif($y <= $this->waterHeight){ + if(($this->waterHeight - $y) <= 1 and $diff === 0){ + $chunk->setBlockId($x, $y, $z, Block::SAND); }elseif($diff === 0){ - $chunk->setBlockId($x, $y, $z, Block::GRASS); + $chunk->setBlockId($x, $y, $z, Block::DIRT); + }else{ + $chunk->setBlockId($x, $y, $z, Block::STILL_WATER); } + }elseif($diff === 0){ + $chunk->setBlockId($x, $y, $z, Block::GRASS); } - } + } } diff --git a/src/pocketmine/resources/pocketmine.yml b/src/pocketmine/resources/pocketmine.yml index 615c77e11..9c487125a 100644 --- a/src/pocketmine/resources/pocketmine.yml +++ b/src/pocketmine/resources/pocketmine.yml @@ -34,15 +34,14 @@ chunk-sending: per-tick: 4 #Compression level used when sending chunks. Higher = more CPU, less bandwidth usage compression-level: 8 - #Amount of chunks loaded around a player by the server, min. 56 as MC: PE 0.9.5 - #Increasing this more than 96 (as of MC: PE 0.9.5) can cause issues with the client ignoring chunks - max-chunks: 96 + #Amount of chunks sent around each player + max-chunks: 256 chunk-ticking: #Max amount of chunks processed each tick - per-tick: 80 + per-tick: 260 #Radius of chunks around a player to tick - tick-radius: 2 + tick-radius: 4 light-updates: false clear-tick-list: false