Changed default view-distance

This commit is contained in:
Shoghi Cervantes 2014-06-22 23:25:43 +02:00
parent 6f9becdbb3
commit 496c004efc
2 changed files with 4 additions and 3 deletions

View File

@ -269,7 +269,7 @@ class Server{
* @return int * @return int
*/ */
public function getViewDistance(){ public function getViewDistance(){
return $this->getConfigInt("view-distance", 8); return min(11, max($this->getConfigInt("view-distance", 7), 4));
} }
/** /**

View File

@ -401,8 +401,9 @@ class Level implements ChunkManager, Metadatable{
$x = mt_rand(0, 15); $x = mt_rand(0, 15);
$y = mt_rand(0, 15); $y = mt_rand(0, 15);
$z = mt_rand(0, 15); $z = mt_rand(0, 15);
if($section->getBlockId($x, $y, $z) !== 0){ if(($blockId = $section->getBlockId($x, $y, $z)) !== 0){
$this->getBlock(new Vector3($X * 16 + $x, $Y * 16 + $y, $Z * 16 + $z))->onUpdate(self::BLOCK_UPDATE_RANDOM); $block = Block::get($blockId, $section->getBlockData($x, $y, $z), new Position($X * 16 + $x, $Y * 16 + $y, $Z * 16 + $z, $this));
$block->onUpdate(self::BLOCK_UPDATE_RANDOM);
} }
} }
} }