From cf8b0329bbf8ed6aa7cce6ff5e679eae9d3c3b3f Mon Sep 17 00:00:00 2001 From: coolGi Date: Tue, 12 Dec 2023 22:17:21 +1030 Subject: [PATCH] Hopefully fixed compolation with the new preprocessor --- .../common/forge/LodForgeMethodCaller.java | 2 +- .../block/TintGetterOverrideFast.java | 4 ++-- .../block/TintGetterOverrideSmooth.java | 4 ++-- .../block/TintWithoutLevelOverrider.java | 8 +++---- .../TintWithoutLevelSmoothOverrider.java | 8 +++---- .../block/cache/ClientBlockStateCache.java | 2 +- .../common/wrappers/chunk/ChunkWrapper.java | 6 ++--- .../common/wrappers/gui/ClassicConfigGUI.java | 4 ++-- .../common/wrappers/gui/MinecraftScreen.java | 2 +- .../wrappers/gui/TexturedButtonWidget.java | 2 +- .../wrappers/gui/updater/ChangelogScreen.java | 4 ++-- .../wrappers/gui/updater/UpdateModScreen.java | 2 +- .../BatchGenerationEnvironment.java | 14 ++++++------ .../worldGeneration/GlobalParameters.java | 10 ++++----- .../worldGeneration/ThreadedParameters.java | 8 +++---- .../mimicObject/ChunkLoader.java | 22 +++++++++---------- .../mimicObject/DhLitWorldGenRegion.java | 14 ++++++------ .../mimicObject/DummyLightEngine.java | 2 +- .../mimicObject/LightGetterAdaptor.java | 6 ++--- .../WorldGenStructFeatManager.java | 12 +++++----- .../worldGeneration/step/StepBiomes.java | 2 +- .../worldGeneration/step/StepFeatures.java | 2 +- .../worldGeneration/step/StepNoise.java | 4 ++-- .../step/StepStructureStart.java | 2 +- .../distanthorizons/fabric/FabricMain.java | 2 +- .../mixins/client/MixinClientLevel.java | 8 +++---- .../client/MixinClientPacketListener.java | 4 ++-- .../mixins/client/MixinGameRenderer.java | 2 +- .../fabric/mixins/client/MixinMinecraft.java | 2 +- .../mods/sodium/MixinSodiumRenderer.java | 4 ++-- .../server/MixinUtilBackgroundThread.java | 4 ++-- .../server/unsafe/MixinThreadingDetector.java | 2 +- .../wrappers/modAccessor/SodiumAccessor.java | 8 +++---- .../forge/ForgeClientProxy.java | 8 +++---- .../distanthorizons/forge/ForgeMain.java | 8 +++---- .../mixins/client/MixinGameRenderer.java | 2 +- .../forge/mixins/client/MixinMinecraft.java | 2 +- .../server/MixinUtilBackgroundThread.java | 4 ++-- .../server/unsafe/MixinThreadingDetector.java | 2 +- 39 files changed, 104 insertions(+), 104 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/forge/LodForgeMethodCaller.java b/common/src/main/java/com/seibel/distanthorizons/common/forge/LodForgeMethodCaller.java index b8b2add63..afa8fa468 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/forge/LodForgeMethodCaller.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/forge/LodForgeMethodCaller.java @@ -22,7 +22,7 @@ package com.seibel.distanthorizons.common.forge; import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftClientWrapper; import net.minecraft.client.renderer.block.model.BakedQuad; import net.minecraft.core.Direction; -#if MC_VER > MC_1_19_2 +#if MC_VER >= MC_1_19_2 import net.minecraft.util.RandomSource; #endif import net.minecraft.world.level.ColorResolver; diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintGetterOverrideFast.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintGetterOverrideFast.java index 04c8c1d98..da3e8d4cf 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintGetterOverrideFast.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintGetterOverrideFast.java @@ -50,7 +50,7 @@ public class TintGetterOverrideFast implements BlockAndTintGetter private Biome _getBiome(BlockPos pos) { - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 return parent.getBiome(pos).value(); #else return parent.getBiome(pos); @@ -167,7 +167,7 @@ public class TintGetterOverrideFast implements BlockAndTintGetter return parent.getMaxBuildHeight(); } - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 @Override public Optional getBlockEntity(BlockPos blockPos, BlockEntityType blockEntityType) { diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintGetterOverrideSmooth.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintGetterOverrideSmooth.java index c67d8c3e4..240c4e848 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintGetterOverrideSmooth.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintGetterOverrideSmooth.java @@ -53,7 +53,7 @@ public class TintGetterOverrideSmooth implements BlockAndTintGetter private Biome _getBiome(BlockPos pos) { - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 return parent.getBiome(pos).value(); #else return parent.getBiome(pos); @@ -193,7 +193,7 @@ public class TintGetterOverrideSmooth implements BlockAndTintGetter return parent.getMaxBuildHeight(); } - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 @Override public Optional getBlockEntity(BlockPos blockPos, BlockEntityType blockEntityType) { diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintWithoutLevelOverrider.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintWithoutLevelOverrider.java index ab8876e74..6f425019e 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintWithoutLevelOverrider.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintWithoutLevelOverrider.java @@ -29,7 +29,7 @@ import net.minecraft.world.level.lighting.LevelLightEngine; import net.minecraft.world.level.material.FluidState; import org.jetbrains.annotations.Nullable; -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 import net.minecraft.core.Holder; #endif @@ -46,9 +46,9 @@ public class TintWithoutLevelOverrider implements BlockAndTintGetter { return colorResolver.getColor(_unwrap(biome.biome), blockPos.getX(), blockPos.getZ()); } - private Biome _unwrap(#if MC_VER > MC_1_18_2 Holder #else Biome #endif biome) + private Biome _unwrap(#if MC_VER >= MC_1_18_2 Holder #else Biome #endif biome) { - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 return biome.value(); #else return biome; @@ -84,7 +84,7 @@ public class TintWithoutLevelOverrider implements BlockAndTintGetter } - #if MC_VER == MC_1_17_1 || MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_17_1 @Override public int getHeight() { diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintWithoutLevelSmoothOverrider.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintWithoutLevelSmoothOverrider.java index 0c293eb7f..04a9b41b1 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintWithoutLevelSmoothOverrider.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/TintWithoutLevelSmoothOverrider.java @@ -30,7 +30,7 @@ import net.minecraft.world.level.lighting.LevelLightEngine; import net.minecraft.world.level.material.FluidState; import org.jetbrains.annotations.Nullable; -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 import net.minecraft.core.Holder; #endif @@ -49,9 +49,9 @@ public class TintWithoutLevelSmoothOverrider implements BlockAndTintGetter { return colorResolver.getColor(_unwrap(biome.biome), blockPos.getX(), blockPos.getZ()); } - private Biome _unwrap(#if MC_VER > MC_1_18_2 Holder #else Biome #endif biome) + private Biome _unwrap(#if MC_VER >= MC_1_18_2 Holder #else Biome #endif biome) { - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 return biome.value(); #else return biome; @@ -116,7 +116,7 @@ public class TintWithoutLevelSmoothOverrider implements BlockAndTintGetter } - #if MC_VER >= MC_1_17_1 && MC_VER != MC_1_18_2 + #if MC_VER >= MC_1_17_1 @Override public int getHeight() { diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/cache/ClientBlockStateCache.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/cache/ClientBlockStateCache.java index 629a705f3..45612b100 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/cache/ClientBlockStateCache.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/cache/ClientBlockStateCache.java @@ -38,7 +38,7 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.FlowerBlock; import net.minecraft.world.level.block.LeavesBlock; import net.minecraft.world.level.block.RotatedPillarBlock; -#if MC_VER > MC_1_19_2 +#if MC_VER >= MC_1_19_2 import net.minecraft.util.RandomSource; #else import java.util.Random; diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java index b92d0e8ce..36cb5c311 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java @@ -47,7 +47,7 @@ import org.apache.logging.log4j.Logger; import java.util.*; import java.util.concurrent.ConcurrentLinkedQueue; -#if MC_VER > MC_1_17_1 +#if MC_VER >= MC_1_17_1 import net.minecraft.core.QuartPos; #endif @@ -67,7 +67,7 @@ import net.minecraft.world.level.chunk.LevelChunkSection; import net.minecraft.world.level.chunk.LevelChunkSection; #endif -#if MC_VER > MC_1_20_1 +#if MC_VER >= MC_1_20_1 import net.minecraft.world.level.chunk.LevelChunkSection; import net.minecraft.world.level.lighting.LevelLightEngine; import net.minecraft.core.SectionPos; @@ -490,7 +490,7 @@ public class ChunkWrapper implements IChunkWrapper #endif } } - #if MC_VER > MC_1_20_1 + #if MC_VER >= MC_1_20_1 private static boolean checkLightSectionsOnChunk(LevelChunk chunk, LevelLightEngine engine) { LevelChunkSection[] sections = chunk.getSections(); diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java index a7a87c7cb..7577120fb 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java @@ -49,7 +49,7 @@ import net.minecraft.client.gui.components.events.GuiEventListener; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; import net.minecraft.client.resources.language.I18n; // translation -#if MC_VER > MC_1_17_1 +#if MC_VER >= MC_1_17_1 import net.minecraft.client.gui.narration.NarratableEntry; #endif import net.minecraft.resources.ResourceLocation; @@ -642,7 +642,7 @@ public class ClassicConfigGUI // Only for 1.17 and over // Remove in 1.16 and below - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 @Override public List narratables() { diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/MinecraftScreen.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/MinecraftScreen.java index 6dcc5a746..1b3c1298c 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/MinecraftScreen.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/MinecraftScreen.java @@ -4,7 +4,7 @@ import com.mojang.blaze3d.platform.Window; import com.mojang.blaze3d.vertex.PoseStack; import com.seibel.distanthorizons.core.config.gui.AbstractScreen; import net.minecraft.client.Minecraft; -#if MC_VER > MC_1_20_1 +#if MC_VER >= MC_1_20_1 import net.minecraft.client.gui.GuiGraphics; #endif import net.minecraft.client.gui.components.ContainerObjectSelectionList; diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/TexturedButtonWidget.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/TexturedButtonWidget.java index c589fcf4c..c69a9ad49 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/TexturedButtonWidget.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/TexturedButtonWidget.java @@ -34,7 +34,7 @@ import net.minecraft.client.gui.components.ImageButton; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; -#if MC_VER > MC_1_17_1 +#if MC_VER >= MC_1_17_1 import net.minecraft.client.renderer.GameRenderer; #endif #if MC_VER < MC_1_20_1 diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java index e66d7c3f8..1328a5ba9 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java @@ -15,7 +15,7 @@ import net.minecraft.client.gui.components.events.GuiEventListener; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; -#if MC_VER > MC_1_17_1 +#if MC_VER >= MC_1_17_1 import net.minecraft.client.gui.narration.NarratableEntry; #endif @@ -244,7 +244,7 @@ public class ChangelogScreen extends DhScreen { return children; } - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 @Override public List narratables() { diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java index 6207d06ff..074e96b21 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java @@ -11,7 +11,7 @@ import com.seibel.distanthorizons.core.jar.JarUtils; import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter; import com.seibel.distanthorizons.core.jar.updater.SelfUpdater; import net.minecraft.client.Minecraft; -#if MC_VER > MC_1_20_1 +#if MC_VER >= MC_1_20_1 import net.minecraft.client.gui.GuiGraphics; #else import com.mojang.blaze3d.vertex.PoseStack; diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java index 65e9c37b9..0ba131419 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java @@ -56,7 +56,7 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.step.StepStruc import com.seibel.distanthorizons.common.wrappers.worldGeneration.step.StepStructureStart; import com.seibel.distanthorizons.common.wrappers.worldGeneration.step.StepSurface; -#if MC_VER > MC_1_19_4 +#if MC_VER >= MC_1_19_4 import net.minecraft.core.registries.Registries; #else import net.minecraft.core.Registry; @@ -365,8 +365,8 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv private static ProtoChunk EmptyChunk(ServerLevel level, ChunkPos chunkPos) { return new ProtoChunk(chunkPos, UpgradeData.EMPTY - #if MC_VER > MC_1_17_1 , level #endif - #if MC_VER > MC_1_18_2 , level.registryAccess().registryOrThrow( + #if MC_VER >= MC_1_17_1 , level #endif + #if MC_VER >= MC_1_18_2 , level.registryAccess().registryOrThrow( #if MC_VER < MC_1_19_4 Registry.BIOME_REGISTRY #else @@ -463,8 +463,8 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv if (target == null) { target = new ProtoChunk(chunkPos, UpgradeData.EMPTY - #if MC_VER > MC_1_17_1 , params.level #endif - #if MC_VER > MC_1_18_2 , params.biomes, null #endif + #if MC_VER >= MC_1_17_1 , params.level #endif + #if MC_VER >= MC_1_18_2 , params.biomes, null #endif ); } return target; @@ -520,7 +520,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv } boolean isFull = target.getStatus() == ChunkStatus.FULL || target instanceof LevelChunk; - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 boolean isPartial = target.isOldNoiseGeneration(); #endif if (isFull) @@ -528,7 +528,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv LOAD_LOGGER.info("Detected full existing chunk at {}", target.getPos()); genEvent.resultConsumer.accept(wrappedChunk); } - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 else if (isPartial) { LOAD_LOGGER.info("Detected old existing chunk at {}", target.getPos()); diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/GlobalParameters.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/GlobalParameters.java index 51da9ca78..ac7e1c639 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/GlobalParameters.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/GlobalParameters.java @@ -31,7 +31,7 @@ import net.minecraft.server.level.ThreadedLevelLightEngine; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.BiomeManager; import net.minecraft.world.level.chunk.ChunkGenerator; -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 import net.minecraft.world.level.chunk.storage.ChunkScanAccess; #endif import net.minecraft.world.level.levelgen.WorldGenSettings; @@ -40,7 +40,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana #else import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager; import net.minecraft.world.level.levelgen.RandomState; -#if MC_VER > MC_1_19_4 +#if MC_VER >= MC_1_19_4 import net.minecraft.world.level.levelgen.WorldOptions; import net.minecraft.core.registries.Registries; #endif @@ -67,7 +67,7 @@ public final class GlobalParameters public final RegistryAccess registry; public final long worldSeed; public final DataFixer fixerUpper; - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 public final BiomeManager biomeManager; public final ChunkScanAccess chunkScanner; // FIXME: Figure out if this is actually needed #endif @@ -90,14 +90,14 @@ public final class GlobalParameters biomes = registry.registryOrThrow(Registries.BIOME); worldSeed = worldOptions.seed(); #endif - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 biomeManager = new BiomeManager(level, BiomeManager.obfuscateSeed(worldSeed)); chunkScanner = level.getChunkSource().chunkScanner(); #endif structures = server.getStructureManager(); generator = level.getChunkSource().getGenerator(); fixerUpper = server.getFixerUpper(); - #if MC_VER > MC_1_19_2 + #if MC_VER >= MC_1_19_2 randomState = level.getChunkSource().randomState(); #endif } diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/ThreadedParameters.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/ThreadedParameters.java index db8a70195..71cc834c3 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/ThreadedParameters.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/ThreadedParameters.java @@ -25,7 +25,7 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.mimicObject.Wo import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.WorldGenLevel; -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 import net.minecraft.world.level.levelgen.structure.StructureCheck; #endif @@ -35,7 +35,7 @@ public final class ThreadedParameters final ServerLevel level; public WorldGenStructFeatManager structFeat = null; - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 public StructureCheck structCheck; #endif boolean isValid = true; @@ -81,14 +81,14 @@ public final class ThreadedParameters public void makeStructFeat(WorldGenLevel genLevel, GlobalParameters param) { #if MC_VER < MC_1_19_4 - structFeat = new WorldGenStructFeatManager(param.worldGenSettings, genLevel #if MC_VER > MC_1_18_2 , structCheck #endif ); + structFeat = new WorldGenStructFeatManager(param.worldGenSettings, genLevel #if MC_VER >= MC_1_18_2 , structCheck #endif ); #else structFeat = new WorldGenStructFeatManager(param.worldOptions, genLevel, structCheck); #endif } - #if MC_VER > MC_1_18_2 && MC_VER < MC_1_19_2 + #if MC_VER >= MC_1_18_2 && MC_VER < MC_1_19_2 public void recreateStructureCheck() { if (previousGlobalParameters != null) 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 bdae4bb2e..7edb2d77e 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 @@ -37,7 +37,7 @@ import java.util.Objects; import net.minecraft.core.Registry; import net.minecraft.core.SectionPos; -#if MC_VER > MC_1_19_4 +#if MC_VER >= MC_1_19_4 import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; #endif @@ -55,7 +55,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.*; import net.minecraft.world.level.chunk.storage.ChunkSerializer; import net.minecraft.world.level.levelgen.Heightmap; -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 import net.minecraft.world.level.levelgen.blending.BlendingData; #if MC_VER < MC_1_19_2 import net.minecraft.world.level.levelgen.feature.StructureFeature; @@ -64,7 +64,7 @@ import net.minecraft.world.level.levelgen.structure.StructureStart; import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceSerializationContext; import net.minecraft.world.ticks.LevelChunkTicks; #endif -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 import net.minecraft.core.Holder; import net.minecraft.core.RegistryAccess; #if MC_VER < MC_1_19_2 @@ -81,9 +81,9 @@ import net.minecraft.world.level.material.Fluid; public class ChunkLoader { - #if MC_VER > MC_1_19_2 + #if MC_VER >= MC_1_19_2 private static final Codec> BLOCK_STATE_CODEC = PalettedContainer.codecRW(Block.BLOCK_STATE_REGISTRY, BlockState.CODEC, PalettedContainer.Strategy.SECTION_STATES, Blocks.AIR.defaultBlockState()); - #elif MC_VER > MC_1_18_2 + #elif MC_VER >= MC_1_18_2 private static final Codec> BLOCK_STATE_CODEC = PalettedContainer.codec(Block.BLOCK_STATE_REGISTRY, BlockState.CODEC, PalettedContainer.Strategy.SECTION_STATES, Blocks.AIR.defaultBlockState()); #endif private static final String TAG_UPGRADE_DATA = "UpgradeData"; @@ -93,7 +93,7 @@ public class ChunkLoader private static final String FLUID_TICKS_TAG_PRE18 = "LiquidTicks"; private static final ConfigBasedLogger LOGGER = BatchGenerationEnvironment.LOAD_LOGGER; - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 private static BlendingData readBlendingData(CompoundTag chunkData) { BlendingData blendingData = null; @@ -109,7 +109,7 @@ public class ChunkLoader private static LevelChunkSection[] readSections(LevelAccessor level, ChunkPos chunkPos, CompoundTag chunkData) { - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 #if MC_VER < MC_1_19_4 Registry biomes = level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY); #else @@ -255,25 +255,25 @@ public class ChunkLoader //================== Read params for making the LevelChunk ================== UpgradeData upgradeData = tagLevel.contains(TAG_UPGRADE_DATA, 10) - ? new UpgradeData(tagLevel.getCompound(TAG_UPGRADE_DATA)#if MC_VER > MC_1_17_1 , level #endif ) + ? new UpgradeData(tagLevel.getCompound(TAG_UPGRADE_DATA)#if MC_VER >= MC_1_17_1 , level #endif ) : UpgradeData.EMPTY; boolean isLightOn = tagLevel.getBoolean("isLightOn"); #if MC_VER < MC_1_18_2 ChunkBiomeContainer chunkBiomeContainer = new ChunkBiomeContainer( - level.getLevel().registryAccess().registryOrThrow(Registry.BIOME_REGISTRY)#if MC_VER > MC_1_17_1 , level #endif , + level.getLevel().registryAccess().registryOrThrow(Registry.BIOME_REGISTRY)#if MC_VER >= MC_1_17_1 , level #endif , chunkPos, level.getLevel().getChunkSource().getGenerator().getBiomeSource(), tagLevel.contains("Biomes", 11) ? tagLevel.getIntArray("Biomes") : null); TickList blockTicks = tagLevel.contains(BLOCK_TICKS_TAG_PRE18, 9) ? ChunkTickList.create(tagLevel.getList(BLOCK_TICKS_TAG_PRE18, 10), Registry.BLOCK::getKey, Registry.BLOCK::get) : new ProtoTickList(block -> (block == null || block.defaultBlockState().isAir()), chunkPos, - tagLevel.getList("ToBeTicked", 9)#if MC_VER > MC_1_17_1 , level #endif ); + tagLevel.getList("ToBeTicked", 9)#if MC_VER >= MC_1_17_1 , level #endif ); TickList fluidTicks = tagLevel.contains(FLUID_TICKS_TAG_PRE18, 9) ? ChunkTickList.create(tagLevel.getList(FLUID_TICKS_TAG_PRE18, 10), Registry.FLUID::getKey, Registry.FLUID::get) : new ProtoTickList(fluid -> (fluid == null || fluid == Fluids.EMPTY), chunkPos, - tagLevel.getList("LiquidsToBeTicked", 9)#if MC_VER > MC_1_17_1 , level #endif ); + tagLevel.getList("LiquidsToBeTicked", 9)#if MC_VER >= MC_1_17_1 , level #endif ); #else #if MC_VER < MC_1_19_4 LevelChunkTicks blockTicks = LevelChunkTicks.load(tagLevel.getList(BLOCK_TICKS_TAG_18, 10), 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 d287ea3f7..b73e18c43 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 @@ -41,7 +41,7 @@ import net.minecraft.util.Mth; import net.minecraft.world.entity.Entity; import net.minecraft.world.level.ChunkPos; import net.minecraft.world.level.ColorResolver; -#if MC_VER > MC_1_17_1 +#if MC_VER >= MC_1_17_1 import net.minecraft.world.level.LevelHeightAccessor; #endif import net.minecraft.world.level.LightLayer; @@ -104,7 +104,7 @@ public class DhLitWorldGenRegion extends WorldGenRegion List chunkList, ChunkStatus chunkStatus, int writeRadius, BatchGenerationEnvironment.EmptyChunkGenerator generator) { - super(serverLevel, chunkList #if MC_VER > MC_1_17_1 , chunkStatus, writeRadius #endif ); + super(serverLevel, chunkList #if MC_VER >= MC_1_17_1 , chunkStatus, writeRadius #endif ); this.firstPos = chunkList.get(0).getPos(); this.generator = generator; this.lightEngine = lightEngine; @@ -115,7 +115,7 @@ public class DhLitWorldGenRegion extends WorldGenRegion - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 // Bypass BCLib mixin overrides. @Override public boolean ensureCanWrite(BlockPos blockPos) @@ -130,7 +130,7 @@ public class DhLitWorldGenRegion extends WorldGenRegion { return false; } - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 if (center.isUpgrading()) { LevelHeightAccessor levelHeightAccessor = center.getHeightAccessorForGeneration(); @@ -185,7 +185,7 @@ public class DhLitWorldGenRegion extends WorldGenRegion BlockState blockState = this.getBlockState(blockPos); // This is a bypass for the spawner block since MC complains about not having it - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 if (blockState.getBlock() instanceof SpawnerBlock) { return ((EntityBlock) blockState.getBlock()).newBlockEntity(blockPos, blockState); @@ -269,7 +269,7 @@ public class DhLitWorldGenRegion extends WorldGenRegion ChunkAccess chunk = getChunkAccess(i, j, chunkStatus, bl); if (chunk instanceof LevelChunk) { - chunk = new ImposterProtoChunk((LevelChunk) chunk #if MC_VER > MC_1_18_2 , true #endif ); + chunk = new ImposterProtoChunk((LevelChunk) chunk #if MC_VER >= MC_1_18_2 , true #endif ); } return chunk; } @@ -331,7 +331,7 @@ public class DhLitWorldGenRegion extends WorldGenRegion private Biome _getBiome(BlockPos pos) { - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 return getBiome(pos).value(); #else return getBiome(pos); diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/DummyLightEngine.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/DummyLightEngine.java index 0be2237ff..f46b77131 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/DummyLightEngine.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/DummyLightEngine.java @@ -87,7 +87,7 @@ public class DummyLightEngine extends LevelLightEngine @Override public void retainData(ChunkPos chunkPos, boolean bl) { } - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 @Override public int getLightSectionCount() { throw new UnsupportedOperationException("This should never be used!"); } @Override diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/LightGetterAdaptor.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/LightGetterAdaptor.java index 268445fa2..097962b94 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/LightGetterAdaptor.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/LightGetterAdaptor.java @@ -23,12 +23,12 @@ import com.seibel.distanthorizons.core.dependencyInjection.ModAccessorInjector; import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IStarlightAccessor; import net.minecraft.world.level.BlockGetter; -#if MC_VER > MC_1_17_1 +#if MC_VER >= MC_1_17_1 import net.minecraft.world.level.LevelHeightAccessor; #endif import net.minecraft.world.level.chunk.ChunkStatus; import net.minecraft.world.level.chunk.LightChunkGetter; -#if MC_VER > MC_1_20_1 +#if MC_VER >= MC_1_20_1 import net.minecraft.world.level.chunk.LightChunk; #endif @@ -64,7 +64,7 @@ public class LightGetterAdaptor implements LightChunkGetter return shouldReturnNull ? null : (genRegion != null ? genRegion : heightGetter); } - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 public LevelHeightAccessor getLevelHeightAccessor() { return heightGetter; diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/WorldGenStructFeatManager.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/WorldGenStructFeatManager.java index 69777916e..05c846540 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/WorldGenStructFeatManager.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/WorldGenStructFeatManager.java @@ -41,13 +41,13 @@ import net.minecraft.world.level.levelgen.WorldGenSettings; import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature; import net.minecraft.world.level.StructureFeatureManager; #else -#if MC_VER > MC_1_19_4 +#if MC_VER >= MC_1_19_4 import net.minecraft.world.level.levelgen.WorldOptions; #endif import net.minecraft.world.level.levelgen.structure.Structure; import net.minecraft.world.level.StructureManager; #endif -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 import net.minecraft.world.level.levelgen.structure.StructureCheck; #endif @@ -69,17 +69,17 @@ public class WorldGenStructFeatManager extends #if MC_VER < MC_1_19_2 StructureF WorldOptions worldOptions; #endif - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 StructureCheck structureCheck; #endif #if MC_VER < MC_1_19_4 public WorldGenStructFeatManager( WorldGenSettings worldGenSettings, - WorldGenLevel genLevel #if MC_VER > MC_1_18_2 , StructureCheck structureCheck #endif ) + WorldGenLevel genLevel #if MC_VER >= MC_1_18_2 , StructureCheck structureCheck #endif ) { - super(genLevel, worldGenSettings #if MC_VER > MC_1_18_2 , structureCheck #endif ); + super(genLevel, worldGenSettings #if MC_VER >= MC_1_18_2 , structureCheck #endif ); this.genLevel = genLevel; this.worldGenSettings = worldGenSettings; } @@ -101,7 +101,7 @@ public class WorldGenStructFeatManager extends #if MC_VER < MC_1_19_2 StructureF if (worldGenRegion == genLevel) return this; #if MC_VER < MC_1_19_4 - return new WorldGenStructFeatManager(worldGenSettings, worldGenRegion #if MC_VER > MC_1_18_2 , structureCheck #endif ); + return new WorldGenStructFeatManager(worldGenSettings, worldGenRegion #if MC_VER >= MC_1_18_2 , structureCheck #endif ); #else return new WorldGenStructFeatManager(worldOptions, worldGenRegion, structureCheck); #endif diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepBiomes.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepBiomes.java index 150b7f3bd..f0ee76c04 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepBiomes.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepBiomes.java @@ -32,7 +32,7 @@ import net.minecraft.server.level.WorldGenRegion; import net.minecraft.world.level.chunk.ChunkAccess; import net.minecraft.world.level.chunk.ChunkStatus; import net.minecraft.world.level.chunk.ProtoChunk; -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 import net.minecraft.world.level.levelgen.blending.Blender; #endif diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepFeatures.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepFeatures.java index f5b7d1016..65092f701 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepFeatures.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepFeatures.java @@ -32,7 +32,7 @@ import net.minecraft.world.level.chunk.ChunkAccess; import net.minecraft.world.level.chunk.ChunkStatus; import net.minecraft.world.level.chunk.ProtoChunk; import net.minecraft.world.level.levelgen.Heightmap; -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 #endif public final class StepFeatures diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepNoise.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepNoise.java index f3c01a650..1974e385d 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepNoise.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepNoise.java @@ -28,14 +28,14 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.ThreadedParame import com.seibel.distanthorizons.core.util.objects.UncheckedInterruptedException; import net.minecraft.server.level.WorldGenRegion; -#if MC_VER > MC_1_17_1 +#if MC_VER >= MC_1_17_1 #endif #if MC_VER < MC_1_19_2 #endif import net.minecraft.world.level.chunk.ChunkAccess; import net.minecraft.world.level.chunk.ChunkStatus; import net.minecraft.world.level.chunk.ProtoChunk; -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 import net.minecraft.world.level.levelgen.blending.Blender; #endif diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepStructureStart.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepStructureStart.java index 0a22eae65..63cc74800 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepStructureStart.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepStructureStart.java @@ -110,7 +110,7 @@ public final class StepStructureStart tParams.structFeat, chunk, environment.params.structures); #endif - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 try { tParams.structCheck.onStructureLoad(chunk.getPos(), chunk.getAllStarts()); diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java index 4ef561058..97eb41228 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java @@ -59,7 +59,7 @@ public class FabricMain if (Config.Client.Advanced.Graphics.Fog.disableVanillaFog.get() && SingletonInjector.INSTANCE.get(IModChecker.class).isModLoaded("bclib")) ModAccessorInjector.INSTANCE.get(IBCLibAccessor.class).setRenderCustomFog(false); // Remove BCLib's fog - #if MC_VER > MC_1_20_1 + #if MC_VER >= MC_1_20_1 if (SingletonInjector.INSTANCE.get(IModChecker.class).isModLoaded("sodium")) ModAccessorInjector.INSTANCE.get(ISodiumAccessor.class).setFogOcclusion(false); // FIXME: This is a tmp fix for sodium 0.5.0, and 0.5.1. This is fixed in sodium 0.5.2 #endif diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinClientLevel.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinClientLevel.java index 7dc45f784..59c290576 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinClientLevel.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinClientLevel.java @@ -24,7 +24,7 @@ import com.seibel.distanthorizons.common.wrappers.world.ClientLevelWrapper; import com.seibel.distanthorizons.core.api.internal.ClientApi; import com.seibel.distanthorizons.core.api.internal.SharedApi; import net.minecraft.client.multiplayer.ClientLevel; -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 #endif import net.minecraft.world.level.chunk.LevelChunk; import org.spongepowered.asm.mixin.Mixin; @@ -44,14 +44,14 @@ public class MixinClientLevel // //Moved to MixinClientPacketListener // @Inject(method = "", at = @At("TAIL")) // private void loadWorldEvent(ClientPacketListener clientPacketListener, ClientLevel.ClientLevelData clientLevelData, ResourceKey resourceKey, -// #if MC_VER > MC_1_18_2 Holder holder, #else DimensionType dimensionType, #endif int i, -// #if MC_VER > MC_1_18_2 int j, #endif Supplier supplier, LevelRenderer levelRenderer, boolean bl, long l, CallbackInfo ci) +// #if MC_VER >= MC_1_18_2 Holder holder, #else DimensionType dimensionType, #endif int i, +// #if MC_VER >= MC_1_18_2 int j, #endif Supplier supplier, LevelRenderer levelRenderer, boolean bl, long l, CallbackInfo ci) // { // ClientApi.INSTANCE.clientLevelLoadEvent(WorldWrapper.getWorldWrapper((ClientLevel)(Object)this)); // } // Moved to overriding the enableChunkLight(...) method over at ClientPacketListener for 1.20+ - #if MC_VER > MC_1_18_2 && MC_VER < MC_1_20_1 // Only the setLightReady is only available after 1.18. This ensures the light data is ready. + #if MC_VER >= MC_1_18_2 && MC_VER < MC_1_20_1 // Only the setLightReady is only available after 1.18. This ensures the light data is ready. @Inject(method = "setLightReady", at = @At("HEAD")) private void onChunkLightReady(int x, int z, CallbackInfo ci) { diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinClientPacketListener.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinClientPacketListener.java index ac6c09572..2e7716b87 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinClientPacketListener.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinClientPacketListener.java @@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -#if MC_VER > MC_1_20_1 +#if MC_VER >= MC_1_20_1 import com.seibel.distanthorizons.core.wrapperInterfaces.world.IClientLevelWrapper; import net.minecraft.world.level.chunk.LevelChunk; import com.seibel.distanthorizons.common.wrappers.chunk.ChunkWrapper; @@ -45,7 +45,7 @@ public class MixinClientPacketListener ClientApi.INSTANCE.onClientOnlyDisconnected(); } - #if MC_VER > MC_1_20_1 + #if MC_VER >= MC_1_20_1 @Inject(method = "enableChunkLight", at = @At("TAIL")) void onEnableChunkLight(LevelChunk chunk, int x, int z, CallbackInfo ci) { diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinGameRenderer.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinGameRenderer.java index 5a11f09d8..4cc9c68c2 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinGameRenderer.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinGameRenderer.java @@ -16,7 +16,7 @@ public class MixinGameRenderer private static final Logger LOGGER = LogManager.getLogger(MixinGameRenderer.class.getSimpleName()); - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 // FIXME: This I think will dup multiple renderStartupEvent calls... @Inject(method = {"reloadShaders", "preloadUiShader"}, at = @At("TAIL")) public void onStartupShaders(CallbackInfo ci) diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinMinecraft.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinMinecraft.java index f96c258de..3e7e1c12b 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinMinecraft.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinMinecraft.java @@ -61,7 +61,7 @@ public class MixinMinecraft } #endif - #if MC_VER > MC_1_20_2 + #if MC_VER >= MC_1_20_2 @Redirect( method = "Lnet/minecraft/client/Minecraft;onGameLoadFinished(Lnet/minecraft/client/Minecraft$GameLoadCookie;)V", at = @At(value = "INVOKE", target = "Ljava/lang/Runnable;run()V") diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/mods/sodium/MixinSodiumRenderer.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/mods/sodium/MixinSodiumRenderer.java index cde893175..498fdf8c9 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/mods/sodium/MixinSodiumRenderer.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/mods/sodium/MixinSodiumRenderer.java @@ -2,7 +2,7 @@ package com.seibel.distanthorizons.fabric.mixins.mods.sodium; /* Removed since DH now uses Indium so we can use the Fabric rendering API instead -#if MC_VER > MC_1_20_1 +#if MC_VER >= MC_1_20_1 // Sodium 0.5 import com.mojang.blaze3d.vertex.PoseStack; import com.seibel.distanthorizons.core.api.internal.ClientApi; @@ -55,7 +55,7 @@ public class MixinSodiumRenderer } -#elif MC_VER > MC_1_17_1 +#elif MC_VER >= MC_1_17_1 // Sodium 0.3 to 0.4 import com.seibel.distanthorizons.core.api.internal.ClientApi; import com.seibel.distanthorizons.core.dependencyInjection.ModAccessorInjector; diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/MixinUtilBackgroundThread.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/MixinUtilBackgroundThread.java index ed33bc5b0..8bfd986df 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/MixinUtilBackgroundThread.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/MixinUtilBackgroundThread.java @@ -50,7 +50,7 @@ public class MixinUtilBackgroundThread } } - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 @Inject(method = "wrapThreadWithTaskName(Ljava/lang/String;Ljava/lang/Runnable;)Ljava/lang/Runnable;", at = @At("HEAD"), cancellable = true) private static void overrideUtil$wrapThreadWithTaskName(String string, Runnable r, CallbackInfoReturnable ci) @@ -62,7 +62,7 @@ public class MixinUtilBackgroundThread } } #endif - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 @Inject(method = "wrapThreadWithTaskName(Ljava/lang/String;Ljava/util/function/Supplier;)Ljava/util/function/Supplier;", at = @At("HEAD"), cancellable = true) private static void overrideUtil$wrapThreadWithTaskNameForSupplier(String string, Supplier r, CallbackInfoReturnable> ci) diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/unsafe/MixinThreadingDetector.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/unsafe/MixinThreadingDetector.java index 7ea166ef7..24641322f 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/unsafe/MixinThreadingDetector.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/unsafe/MixinThreadingDetector.java @@ -22,7 +22,7 @@ package com.seibel.distanthorizons.fabric.mixins.server.unsafe; import org.spongepowered.asm.mixin.Mixin; //FIXME: Is this still needed? -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 import net.minecraft.util.ThreadingDetector; import org.spongepowered.asm.mixin.Mutable; diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/SodiumAccessor.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/SodiumAccessor.java index 86a6909d2..7145d673a 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/SodiumAccessor.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/SodiumAccessor.java @@ -60,21 +60,21 @@ public class SodiumAccessor implements ISodiumAccessor return "Sodium-Fabric"; } - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 @Override public HashSet getNormalRenderedChunks() { SodiumWorldRenderer renderer = SodiumWorldRenderer.instance(); LevelHeightAccessor height = Minecraft.getInstance().level; - #if MC_VER > MC_1_20_1 + #if MC_VER >= MC_1_20_1 // TODO: This is just a tmp solution, use a proper solution later return MC_RENDER.getMaximumRenderedChunks().stream().filter((DhChunkPos chunk) -> { return (renderer.isBoxVisible( chunk.getMinBlockX() + 1, height.getMinBuildHeight() + 1, chunk.getMinBlockZ() + 1, chunk.getMinBlockX() + 15, height.getMaxBuildHeight() - 1, chunk.getMinBlockZ() + 15)); }).collect(Collectors.toCollection(HashSet::new)); - #elif MC_VER > MC_1_18_2 + #elif MC_VER >= MC_1_18_2 // 0b11 = Lighted chunk & loaded chunk return renderer.getChunkTracker().getChunks(0b00).filter( (long l) -> { @@ -134,7 +134,7 @@ public class SodiumAccessor implements ISodiumAccessor @Override public void setFogOcclusion(boolean b) { - #if MC_VER > MC_1_20_1 + #if MC_VER >= MC_1_20_1 me.jellysquid.mods.sodium.client.SodiumClientMod.options().performance.useFogOcclusion = b; #endif } diff --git a/forge/src/main/java/com/seibel/distanthorizons/forge/ForgeClientProxy.java b/forge/src/main/java/com/seibel/distanthorizons/forge/ForgeClientProxy.java index 836cd6cf3..085d2e477 100644 --- a/forge/src/main/java/com/seibel/distanthorizons/forge/ForgeClientProxy.java +++ b/forge/src/main/java/com/seibel/distanthorizons/forge/ForgeClientProxy.java @@ -44,7 +44,7 @@ import net.minecraftforge.event.level.ChunkEvent; import net.minecraftforge.event.level.LevelEvent; #endif -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 import net.minecraftforge.client.event.RenderLevelStageEvent; #endif import net.minecraftforge.event.entity.player.PlayerInteractEvent; @@ -298,15 +298,15 @@ public class ForgeClientProxy //===========// @SubscribeEvent - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 public void afterLevelRenderEvent(RenderLevelStageEvent event) #else public void afterLevelRenderEvent(TickEvent.RenderTickEvent event) #endif { - #if MC_VER > MC_1_20_1 + #if MC_VER >= MC_1_20_1 if (event.getStage() == RenderLevelStageEvent.Stage.AFTER_LEVEL) - #elif MC_VER > MC_1_18_2 + #elif MC_VER >= MC_1_18_2 if (event.getStage() == RenderLevelStageEvent.Stage.AFTER_SOLID_BLOCKS) #else // FIXME: Is this the correct location for 1.16 & 1.17??? diff --git a/forge/src/main/java/com/seibel/distanthorizons/forge/ForgeMain.java b/forge/src/main/java/com/seibel/distanthorizons/forge/ForgeMain.java index d88441f92..4195b2dea 100644 --- a/forge/src/main/java/com/seibel/distanthorizons/forge/ForgeMain.java +++ b/forge/src/main/java/com/seibel/distanthorizons/forge/ForgeMain.java @@ -39,7 +39,7 @@ import com.seibel.distanthorizons.forge.wrappers.modAccessor.OptifineAccessor; import net.minecraft.client.renderer.block.model.BakedQuad; import net.minecraft.core.Direction; -#if MC_VER > MC_1_19_2 +#if MC_VER >= MC_1_19_2 import net.minecraft.util.RandomSource; #endif import net.minecraft.world.level.ColorResolver; @@ -55,7 +55,7 @@ import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.ExtensionPoint; #elif MC_VER == MC_1_17_1 import net.minecraftforge.fmlclient.ConfigGuiHandler; -#elif MC_VER > MC_1_18_2 && MC_VER < MC_1_19_2 +#elif MC_VER >= MC_1_18_2 && MC_VER < MC_1_19_2 import net.minecraftforge.client.ConfigGuiHandler; #else import net.minecraftforge.client.ConfigScreenHandler; @@ -131,7 +131,7 @@ public class ForgeMain implements LodForgeMethodCaller #if MC_VER < MC_1_17_1 ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY, () -> (client, parent) -> GetConfigScreen.getScreen(parent)); - #elif MC_VER >= MC_1_17_1 && MC_VER <= MC_1_19_2 + #elif MC_VER >= MC_1_17_1 && MC_VER < MC_1_19_2 ModLoadingContext.get().registerExtensionPoint(ConfigGuiHandler.ConfigGuiFactory.class, () -> new ConfigGuiHandler.ConfigGuiFactory((client, parent) -> GetConfigScreen.getScreen(parent))); #else @@ -184,7 +184,7 @@ public class ForgeMain implements LodForgeMethodCaller #else public List getQuads(MinecraftClientWrapper mc, Block block, BlockState blockState, Direction direction, RandomSource random) { - return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, modelData #if MC_VER > MC_1_19_2 , RenderType.solid() #endif ); + return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, modelData #if MC_VER >= MC_1_19_2 , RenderType.solid() #endif ); } #endif diff --git a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinGameRenderer.java b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinGameRenderer.java index 9834b90bf..614054ee2 100644 --- a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinGameRenderer.java +++ b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinGameRenderer.java @@ -16,7 +16,7 @@ public class MixinGameRenderer { private static final Logger LOGGER = LogManager.getLogger(MixinGameRenderer.class.getSimpleName()); - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 // FIXME: This I think will dup multiple renderStartupEvent calls... @Inject(method = {"reloadShaders", "preloadUiShader"}, at = @At("TAIL")) public void onStartupShaders(CallbackInfo ci) diff --git a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinMinecraft.java b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinMinecraft.java index 155c30259..b8c25e6e1 100644 --- a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinMinecraft.java +++ b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinMinecraft.java @@ -61,7 +61,7 @@ public class MixinMinecraft } #endif - #if MC_VER > MC_1_20_2 + #if MC_VER >= MC_1_20_2 @Redirect( method = "Lnet/minecraft/client/Minecraft;onGameLoadFinished(Lnet/minecraft/client/Minecraft$GameLoadCookie;)V", at = @At(value = "INVOKE", target = "Ljava/lang/Runnable;run()V") diff --git a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/server/MixinUtilBackgroundThread.java b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/server/MixinUtilBackgroundThread.java index 900d1115c..dee12f792 100644 --- a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/server/MixinUtilBackgroundThread.java +++ b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/server/MixinUtilBackgroundThread.java @@ -50,7 +50,7 @@ public class MixinUtilBackgroundThread } } - #if MC_VER > MC_1_17_1 + #if MC_VER >= MC_1_17_1 @Inject(method = "wrapThreadWithTaskName(Ljava/lang/String;Ljava/lang/Runnable;)Ljava/lang/Runnable;", at = @At("HEAD"), cancellable = true) private static void overrideUtil$wrapThreadWithTaskName(String string, Runnable r, CallbackInfoReturnable ci) @@ -62,7 +62,7 @@ public class MixinUtilBackgroundThread } } #endif - #if MC_VER > MC_1_18_2 + #if MC_VER >= MC_1_18_2 @Inject(method = "wrapThreadWithTaskName(Ljava/lang/String;Ljava/util/function/Supplier;)Ljava/util/function/Supplier;", at = @At("HEAD"), cancellable = true) private static void overrideUtil$wrapThreadWithTaskNameForSupplier(String string, Supplier r, CallbackInfoReturnable> ci) diff --git a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/server/unsafe/MixinThreadingDetector.java b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/server/unsafe/MixinThreadingDetector.java index 3ce324a04..2cb73c02c 100644 --- a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/server/unsafe/MixinThreadingDetector.java +++ b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/server/unsafe/MixinThreadingDetector.java @@ -20,7 +20,7 @@ package com.seibel.distanthorizons.forge.mixins.server.unsafe; import org.spongepowered.asm.mixin.Mixin; -#if MC_VER > MC_1_18_2 +#if MC_VER >= MC_1_18_2 import net.minecraft.util.ThreadingDetector; import org.spongepowered.asm.mixin.Mutable;