mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 23:29:54 +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);
|
mkdir($path . "/db", 0777, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$generatorClass = Generator::getGenerator($generator);
|
switch($generator){
|
||||||
switch($generatorClass){
|
|
||||||
case Flat::class:
|
case Flat::class:
|
||||||
$generatorType = self::GENERATOR_FLAT;
|
$generatorType = self::GENERATOR_FLAT;
|
||||||
break;
|
break;
|
||||||
@ -198,8 +197,9 @@ class LevelDB extends BaseLevelProvider{
|
|||||||
$db = new \LevelDB($path . "/db", [
|
$db = new \LevelDB($path . "/db", [
|
||||||
"compression" => LEVELDB_ZLIB_COMPRESSION
|
"compression" => LEVELDB_ZLIB_COMPRESSION
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if($generatorType === self::GENERATOR_FLAT and isset($options["preset"])){
|
if($generatorType === self::GENERATOR_FLAT and isset($options["preset"])){
|
||||||
$layers = explode(";", $options["preset"])[2] ?? "";
|
$layers = explode(";", $options["preset"])[1] ?? "";
|
||||||
if($layers !== ""){
|
if($layers !== ""){
|
||||||
$db->put(self::ENTRY_FLAT_WORLD_LAYERS, "[" . $layers . "]"); //Add vanilla flatworld layers to allow terrain generation by MCPE to continue seamlessly
|
$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