Support 1.18.30 worlds

This commit is contained in:
Dylan K. Taylor
2022-04-20 14:58:32 +01:00
parent e383f6d8f8
commit 43e61336cf
6 changed files with 32 additions and 21 deletions

View File

@@ -47,13 +47,13 @@ use function time;
class BedrockWorldData extends BaseNbtWorldData{
public const CURRENT_STORAGE_VERSION = 8;
public const CURRENT_STORAGE_VERSION = 9;
/**
* WARNING: In the future, this should be only as high as the newest world format currently supported. We don't
* actually support worlds from 1.18.10 yet, but due to an old stupid bug, all worlds created by PM will report this
* version.
*/
public const CURRENT_STORAGE_NETWORK_VERSION = 486; // 1.18.10
public const CURRENT_STORAGE_NETWORK_VERSION = 503; // 1.18.10
public const GENERATOR_LIMITED = 0;
public const GENERATOR_INFINITE = 1;

View File

@@ -70,4 +70,5 @@ final class ChunkVersion{
public const v1_18_0_24_beta = 37;
public const v1_18_0_24_unused = 38;
public const v1_18_0_25_beta = 39;
public const v1_18_30 = 40;
}

View File

@@ -78,7 +78,7 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{
protected const ENTRY_FLAT_WORLD_LAYERS = "game_flatworldlayers";
protected const CURRENT_LEVEL_CHUNK_VERSION = ChunkVersion::v1_18_0_25_beta;
protected const CURRENT_LEVEL_CHUNK_VERSION = ChunkVersion::v1_18_30;
protected const CURRENT_LEVEL_SUBCHUNK_VERSION = SubChunkVersion::PALETTED_MULTI;
private const CAVES_CLIFFS_EXPERIMENTAL_SUBCHUNK_KEY_OFFSET = 4;
@@ -296,6 +296,7 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{
$subChunkKeyOffset = self::hasOffsetCavesAndCliffsSubChunks($chunkVersion) ? self::CAVES_CLIFFS_EXPERIMENTAL_SUBCHUNK_KEY_OFFSET : 0;
switch($chunkVersion){
case ChunkVersion::v1_18_30:
case ChunkVersion::v1_18_0_25_beta:
case ChunkVersion::v1_18_0_24_unused:
case ChunkVersion::v1_18_0_24_beta: