mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 11:27:07 +00:00
Higher chunk defaults
This commit is contained in:
parent
8d9fbec4ce
commit
d800a21bd4
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user