better drop, added new setting from nc0.10

This commit is contained in:
GameHerobrine 2023-12-16 10:11:48 +03:00
parent e8528755ab
commit 7eec621f90
7 changed files with 63 additions and 65 deletions

View file

@ -448,7 +448,7 @@ class Level{
$p = $this->server->clients[$cid] ?? false;
if($p instanceof Player){
$dist = abs($xz[0] - (((int)$p->entity->x) >> 4)) + abs($xz[1] - (((int)$p->entity->z) >> 4));
if($dist > 8){
if($dist > PocketMinecraftServer::$chunkLoadingRadius*2){
//ConsoleAPI::debug("{$p->player} freeing chunk: {$xz[0]} {$xz[1]}");
$this->freeChunk($xz[0], $xz[1], $p);
$p->stopUsingChunk($xz[0], $xz[1]);

View file

@ -54,7 +54,7 @@ class ExperimentalGenerator implements NewLevelGenerator{
public function init(Level $level, Random $random){
$this->level = $level;
$this->random = $random;//new MersenneTwister();
$this->random = $random;
$this->random->setSeed($this->level->level->getSeed());
$this->noiseBase = new NoiseGeneratorPerlin($this->random, 4);
$this->selector = new BiomeSelector($this->random, BiomeSelector::$biomes[BIOME_PLAINS]);
@ -154,8 +154,6 @@ class ExperimentalGenerator implements NewLevelGenerator{
$chunk .= (($noiseValue > 0) ? "\x01" : (($y <= $this->waterHeight) ? "\x09" : "\x00"));
}
$chunk .= "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
//$chunk .= str_repeat("\xff", 16);
//$chunk .= str_repeat("\xff", 16);
$chunk .= "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; //light
$chunk .= "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; //more light
}