Fix compilation of modern

This commit is contained in:
Vojtěch Šokala
2026-05-07 15:34:26 +02:00
parent 32a71933d6
commit eb8fcaee36
3 changed files with 11 additions and 7 deletions
+1 -1
View File
@@ -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()
@@ -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
@@ -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<IProperty<?>> blockPropertyCollection = blockState.getPropertyKeys();
#else
java.util.Collection<Property<?>> blockPropertyCollection = blockState.getProperties();;
java.util.Collection<net.minecraft.world.level.block.state.properties.Property<?>> 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();