mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Fixed flat world terrain generation by MCPE
This commit is contained in:
parent
6b9c2b961b
commit
b72218ac5b
@ -142,8 +142,7 @@ class LevelDB extends BaseLevelProvider{
|
||||
mkdir($path . "/db", 0777, true);
|
||||
}
|
||||
|
||||
$generatorClass = Generator::getGenerator($generator);
|
||||
switch($generatorClass){
|
||||
switch($generator){
|
||||
case Flat::class:
|
||||
$generatorType = self::GENERATOR_FLAT;
|
||||
break;
|
||||
@ -198,8 +197,9 @@ class LevelDB extends BaseLevelProvider{
|
||||
$db = new \LevelDB($path . "/db", [
|
||||
"compression" => LEVELDB_ZLIB_COMPRESSION
|
||||
]);
|
||||
|
||||
if($generatorType === self::GENERATOR_FLAT and isset($options["preset"])){
|
||||
$layers = explode(";", $options["preset"])[2] ?? "";
|
||||
$layers = explode(";", $options["preset"])[1] ?? "";
|
||||
if($layers !== ""){
|
||||
$db->put(self::ENTRY_FLAT_WORLD_LAYERS, "[" . $layers . "]"); //Add vanilla flatworld layers to allow terrain generation by MCPE to continue seamlessly
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user