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 runTask.jvmArgs = filteredArgs
if(project.name == "forge" || project.name == "neoforge" || project.name == "cleanroom") { if(project.name == "forge" || project.name == "neoforge" || project.name == "cleanroom") {
// fix (Neo)forge debug running // fix (Neo)forge, Cleanroom debug running
doFirst { doFirst {
def modsDir = rootProject.file("run/${isClient ? 'client' : 'server'}/mods") def modsDir = rootProject.file("run/${isClient ? 'client' : 'server'}/mods")
modsDir.mkdirs() modsDir.mkdirs()
@@ -77,8 +77,12 @@ public class MixinVanillaFogCommon
Entity entity = camera.entity(); Entity entity = camera.entity();
#endif #endif
#if MC_VER <= MC_1_12_2
boolean cameraNotInFluid = cameraNotInFluid(mc); boolean cameraNotInFluid = cameraNotInFluid(mc);
#else
boolean cameraNotInFluid = cameraNotInFluid(camera);
#endif
#if MC_VER <= MC_1_12_2 #if MC_VER <= MC_1_12_2
boolean isSpecialFog = entity.isPotionActive(MobEffects.BLINDNESS); boolean isSpecialFog = entity.isPotionActive(MobEffects.BLINDNESS);
#else #else
@@ -483,7 +483,7 @@ public class BlockStateWrapper implements IBlockStateWrapper
{ {
return EDhApiBlockMaterial.LAVA; 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; return EDhApiBlockMaterial.WATER;
} }
@@ -615,7 +615,7 @@ public class BlockStateWrapper implements IBlockStateWrapper
if (blockState != null) if (blockState != null)
{ {
#if MC_VER <= MC_1_12_2 #if MC_VER <= MC_1_12_2
canOcclude = blockState.isOpaqueCube(); canOcclude = blockState.getMaterial().isSolid();
#else #else
canOcclude = blockState.canOcclude(); canOcclude = blockState.canOcclude();
#endif #endif
@@ -1085,16 +1085,16 @@ public class BlockStateWrapper implements IBlockStateWrapper
#if MC_VER <= MC_1_12_2 #if MC_VER <= MC_1_12_2
java.util.Collection<IProperty<?>> blockPropertyCollection = blockState.getPropertyKeys(); java.util.Collection<IProperty<?>> blockPropertyCollection = blockState.getPropertyKeys();
#else #else
java.util.Collection<Property<?>> blockPropertyCollection = blockState.getProperties();; java.util.Collection<net.minecraft.world.level.block.state.properties.Property<?>> blockPropertyCollection = blockState.getProperties();;
#endif #endif
// alphabetically sort the list so they are always in the same order // 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())); sortedBlockPropteryList.sort((a, b) -> a.getName().compareTo(b.getName()));
StringBuilder stringBuilder = new StringBuilder(); 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(); String propertyName = property.getName();