From eb8fcaee36699a4bb4ffac539b93dd14ba4c4d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20=C5=A0okala?= Date: Thu, 7 May 2026 15:34:26 +0200 Subject: [PATCH] Fix compilation of modern --- buildSrc/src/main/groovy/dh-loader.gradle | 2 +- .../common/commonMixins/MixinVanillaFogCommon.java | 6 +++++- .../common/wrappers/block/BlockStateWrapper.java | 10 +++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/buildSrc/src/main/groovy/dh-loader.gradle b/buildSrc/src/main/groovy/dh-loader.gradle index d22153c59..c5d762d28 100644 --- a/buildSrc/src/main/groovy/dh-loader.gradle +++ b/buildSrc/src/main/groovy/dh-loader.gradle @@ -403,7 +403,7 @@ if (isNotCommonProject) { runTask.jvmArgs = filteredArgs if(project.name == "forge" || project.name == "neoforge" || project.name == "cleanroom") { - // fix (Neo)forge debug running + // fix (Neo)forge, Cleanroom debug running doFirst { def modsDir = rootProject.file("run/${isClient ? 'client' : 'server'}/mods") modsDir.mkdirs() diff --git a/common/src/main/java/com/seibel/distanthorizons/common/commonMixins/MixinVanillaFogCommon.java b/common/src/main/java/com/seibel/distanthorizons/common/commonMixins/MixinVanillaFogCommon.java index cc8538f2f..1b0e962d2 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/commonMixins/MixinVanillaFogCommon.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/commonMixins/MixinVanillaFogCommon.java @@ -77,8 +77,12 @@ public class MixinVanillaFogCommon Entity entity = camera.entity(); #endif - + #if MC_VER <= MC_1_12_2 boolean cameraNotInFluid = cameraNotInFluid(mc); + #else + boolean cameraNotInFluid = cameraNotInFluid(camera); + #endif + #if MC_VER <= MC_1_12_2 boolean isSpecialFog = entity.isPotionActive(MobEffects.BLINDNESS); #else diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java index 931962d56..4c90bb846 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java @@ -483,7 +483,7 @@ public class BlockStateWrapper implements IBlockStateWrapper { return EDhApiBlockMaterial.LAVA; } - else if (isLiquid || #if MC_VER <= MC_1_12_2 blockState.getBlock() == Blocks.WATER || blockState.getBlock() == Blocks.FLOWING_WATER #else this.blockState.is(Blocks.WATER) #endif) + else if (isLiquid || #if MC_VER <= MC_1_12_2 blockState.getBlock() == Blocks.WATER || blockState.getBlock() == Blocks.FLOWING_WATER #else blockState.is(Blocks.WATER) #endif) { return EDhApiBlockMaterial.WATER; } @@ -615,7 +615,7 @@ public class BlockStateWrapper implements IBlockStateWrapper if (blockState != null) { #if MC_VER <= MC_1_12_2 - canOcclude = blockState.isOpaqueCube(); + canOcclude = blockState.getMaterial().isSolid(); #else canOcclude = blockState.canOcclude(); #endif @@ -1085,16 +1085,16 @@ public class BlockStateWrapper implements IBlockStateWrapper #if MC_VER <= MC_1_12_2 java.util.Collection> blockPropertyCollection = blockState.getPropertyKeys(); #else - java.util.Collection> blockPropertyCollection = blockState.getProperties();; + java.util.Collection> blockPropertyCollection = blockState.getProperties();; #endif // alphabetically sort the list so they are always in the same order - List<#if MC_VER <= MC_1_12_2 IProperty #else Property #endif> sortedBlockPropteryList = new ArrayList<>(blockPropertyCollection); + List<#if MC_VER <= MC_1_12_2 IProperty #else net.minecraft.world.level.block.state.properties.Property #endif> sortedBlockPropteryList = new ArrayList<>(blockPropertyCollection); sortedBlockPropteryList.sort((a, b) -> a.getName().compareTo(b.getName())); StringBuilder stringBuilder = new StringBuilder(); - for (#if MC_VER <= MC_1_12_2 IProperty #else Property #endif property : sortedBlockPropteryList) + for (#if MC_VER <= MC_1_12_2 IProperty #else net.minecraft.world.level.block.state.properties.Property #endif property : sortedBlockPropteryList) { String propertyName = property.getName();