From 54fad92d5310ade7526df0189f9e097656bc2b91 Mon Sep 17 00:00:00 2001 From: Martoph Date: Mon, 20 Dec 2021 13:55:18 -0600 Subject: [PATCH 1/2] Compatibility for 1.18.1 --- build.gradle | 2 +- src/main/kotlin/br/com/gamemods/regionmanipulator/Chunk.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index c156989..75865cc 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ plugins { } group 'br.com.gamemods' -version '2.0.1-SNAPSHOT' +version '2.0.2-SNAPSHOT' sourceSets.main.java.srcDirs = ["src/main/kotlin"] sourceSets.test.java.srcDirs = ["src/test/kotlin"] diff --git a/src/main/kotlin/br/com/gamemods/regionmanipulator/Chunk.kt b/src/main/kotlin/br/com/gamemods/regionmanipulator/Chunk.kt index a50c073..73cb35b 100644 --- a/src/main/kotlin/br/com/gamemods/regionmanipulator/Chunk.kt +++ b/src/main/kotlin/br/com/gamemods/regionmanipulator/Chunk.kt @@ -30,7 +30,7 @@ data class Chunk(var lastModified: Date, var nbtFile: NbtFile) { * The `Level` tag, all chunk details like entities, tile entities, chunk sections, etc are stored here. */ val level: NbtCompound - get() = compound.getCompound("Level") + get() = compound//.getCompound("Level") /** * The X/Z position in the world where this chunk resides. From 452e4cbf0641d41934a6f393c4e3be8f749ee51a Mon Sep 17 00:00:00 2001 From: Martoph Date: Mon, 20 Dec 2021 14:16:32 -0600 Subject: [PATCH 2/2] Get "Level" if it exists (not been converted to 1.18 yet) --- src/main/kotlin/br/com/gamemods/regionmanipulator/Chunk.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/br/com/gamemods/regionmanipulator/Chunk.kt b/src/main/kotlin/br/com/gamemods/regionmanipulator/Chunk.kt index 73cb35b..d9a83b1 100644 --- a/src/main/kotlin/br/com/gamemods/regionmanipulator/Chunk.kt +++ b/src/main/kotlin/br/com/gamemods/regionmanipulator/Chunk.kt @@ -30,7 +30,7 @@ data class Chunk(var lastModified: Date, var nbtFile: NbtFile) { * The `Level` tag, all chunk details like entities, tile entities, chunk sections, etc are stored here. */ val level: NbtCompound - get() = compound//.getCompound("Level") + get() = Optional.ofNullable(compound.getNullableCompound("Level")).orElse(compound) /** * The X/Z position in the world where this chunk resides.