fixed trees on chunk borders, bumped pmf ver to 2

This commit is contained in:
GameHerobrine 2023-11-21 17:31:45 +03:00
parent d70d207317
commit e1368ce4a1
5 changed files with 49 additions and 14 deletions

View file

@ -21,7 +21,7 @@ class Level{
public $tiles, $blockUpdates, $nextSave, $players = [], $level, $mobSpawner;
public $time, $startCheck, $startTime, $server, $name, $usedChunks, $changedBlocks, $changedCount, $stopTime;
private $generator;
public $generator;
public function __construct(PMFLevel $level, Config $entities, Config $tiles, Config $blockUpdates, $name){
$this->server = ServerAPI::request();
$this->level = $level;
@ -140,7 +140,7 @@ class Level{
$tileEntities = "";
if($gen) $this->level->generateChunk($X, $Z, $this->generator);
if(!$this->level->isChunkLoaded($X, $Z)){
$this->level->loadChunk($X, $Z);
$this->level->loadChunk($X, $Z, true);
}
$miniChunks = [];
@ -433,6 +433,13 @@ class Level{
}
}
foreach($this->level->fakeLoaded as $ind => $val){
$xz = explode(".", $val);
$this->level->unloadChunk($xz[0], $xz[1]);
ConsoleAPI::info("unloading feke chunk: {$xz[0]} {$xz[1]}");
unset($this->level->fakeLoaded[$ind]);
}
}
public function setBlock(Vector3 $pos, Block $block, $update = true, $tiles = false, $direct = false){