From e785db588d812fa0daf842b8105bce48b061694f Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Fri, 9 Jun 2023 21:21:08 +0300 Subject: [PATCH] goodbye, old generator =< --- src/API/LevelAPI.php | 4 -- src/world/generator/TemporalGenerator.php | 79 ----------------------- 2 files changed, 83 deletions(-) delete mode 100644 src/world/generator/TemporalGenerator.php diff --git a/src/API/LevelAPI.php b/src/API/LevelAPI.php index ba2833d1..d2177bad 100644 --- a/src/API/LevelAPI.php +++ b/src/API/LevelAPI.php @@ -139,10 +139,6 @@ class LevelAPI{ case "EXPERIMENTAL": $generator = new ExperimentalGenerator($options); break; - case "OLD": - $generator = new TemporalGenerator(); - ConsoleAPI::warn("You should not use OLD world type."); - break; case "HELL": case "NETHER": $generator = new HellGenerator(); diff --git a/src/world/generator/TemporalGenerator.php b/src/world/generator/TemporalGenerator.php deleted file mode 100644 index ae45ac04..00000000 --- a/src/world/generator/TemporalGenerator.php +++ /dev/null @@ -1,79 +0,0 @@ -level = $level; - $this->random = $random; - $this->index = mt_rand(0, count(TemporalGenerator::$levels) - 1); - $this->world = new PocketChunkParser(); - $this->world->loadRaw(gzinflate(gzinflate(base64_decode(TemporalGenerator::$levels[$this->index][4]))), ""); - $this->world->loadMap(); - $this->level->setSeed(TemporalGenerator::$levels[$this->index][0]); - } - - public function generateChunk($chunkX, $chunkZ){ - - } - - public function populateChunk($chunkX, $chunkZ){ - - } - - public function populateLevel(){ - for($Z = 0; $Z < 16; ++$Z){ - for($X = 0; $X < 16; ++$X){ - $chunk = [ - 0 => "", - 1 => "", - 2 => "", - 3 => "", - 4 => "", - 5 => "", - 6 => "", - 7 => "" - ]; - for($z = 0; $z < 16; ++$z){ - for($x = 0; $x < 16; ++$x){ - $block = $this->world->getChunkColumn($X, $Z, $x, $z, 0); - $meta = $this->world->getChunkColumn($X, $Z, $x, $z, 1); - for($Y = 0; $Y < 8; ++$Y){ - $chunk[$Y] .= substr($block, $Y << 4, 16); - $chunk[$Y] .= substr($meta, $Y << 3, 8); - $chunk[$Y] .= "\x00\x00\x00\x00\x00\x00\x00\x00"; - } - } - } - foreach($chunk as $Y => $data){ - $this->level->setMiniChunk($X, $Z, $Y, $data); - } - } - console("[NOTICE] Importing level " . ceil(($Z + 1) / 0.16) . "%"); - } - $this->level->save(true, true); - $this->world->map = null; - $this->world = null; - } - - public function getSpawn(){ - return new Vector3(TemporalGenerator::$levels[$this->index][1], TemporalGenerator::$levels[$this->index][2], TemporalGenerator::$levels[$this->index][3]); - } -} \ No newline at end of file