From 5570f3a313c1059ef8fbcf1d73c90453160b7e25 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Fri, 14 Jun 2024 19:31:21 -0500 Subject: [PATCH] Fix some compiling issues --- .../worldGeneration/mimicObject/ChunkLoader.java | 11 +++++++++-- .../mimicObject/DhLitWorldGenRegion.java | 3 +-- gradle.properties | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/ChunkLoader.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/ChunkLoader.java index f69efe3b8..e89c5ee48 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/ChunkLoader.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/ChunkLoader.java @@ -323,7 +323,11 @@ public class ChunkLoader } return chunkSections; } - private static #if MC_VER < MC_1_21 ChunkType #else ChunkType #endif readChunkType(CompoundTag tagLevel) + private static + #if MC_VER < MC_1_20_6 ChunkStatus.ChunkType + #elif MC_VER < MC_1_21 ChunkType + #else ChunkType #endif + readChunkType(CompoundTag tagLevel) { ChunkStatus chunkStatus = ChunkStatus.byName(tagLevel.getString("Status")); if (chunkStatus != null) @@ -331,7 +335,10 @@ public class ChunkLoader return chunkStatus.getChunkType(); } - return #if MC_VER < MC_1_20_6 ChunkStatus.ChunkType.PROTOCHUNK; #else ChunkType.PROTOCHUNK; #endif + return + #if MC_VER <= MC_1_20_6 ChunkType.PROTOCHUNK; + #elif MC_VER < MC_1_21 ChunkStatus.ChunkType.PROTOCHUNK; + #else ChunkType.PROTOCHUNK; #endif } private static void readHeightmaps(LevelChunk chunk, CompoundTag chunkData) { diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/DhLitWorldGenRegion.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/DhLitWorldGenRegion.java index ce4fd28a2..ed585da95 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/DhLitWorldGenRegion.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/DhLitWorldGenRegion.java @@ -23,14 +23,12 @@ import java.lang.invoke.MethodHandles; import java.util.EnumSet; import java.util.List; import java.util.concurrent.locks.ReentrantLock; - import com.seibel.distanthorizons.common.wrappers.chunk.ChunkWrapper; import com.seibel.distanthorizons.common.wrappers.worldGeneration.BatchGenerationEnvironment; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; import com.seibel.distanthorizons.core.util.LodUtil; import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.SpawnerBlock; -import net.minecraft.world.level.chunk.status.*; import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -62,6 +60,7 @@ import net.minecraft.world.level.lighting.LevelLightEngine; #if MC_VER <= MC_1_20_4 import net.minecraft.world.level.chunk.ChunkStatus; #else +import net.minecraft.world.level.chunk.status.*; #endif #if MC_VER == MC_1_21 diff --git a/gradle.properties b/gradle.properties index b8928e5de..6da075fb9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -49,7 +49,7 @@ versionStr= # This defines what MC version Intellij will use for the preprocessor # and what version is used automatically by build and run commands -mcVer=1.20.6 +mcVer=1.21 # Defines the maximum amount of memory Minecraft is allowed when run in a development environment #minecraftMemoryJavaArg="-Xmx4G"