add support for MC 1.21.11

This commit is contained in:
James Seibel
2025-12-09 21:15:09 -06:00
parent a9c4f3ea46
commit c2e45f3d65
57 changed files with 493 additions and 107 deletions
@@ -160,9 +160,12 @@ public class MixinFogRenderer
{
#if MC_VER < MC_1_21_6
Entity entity = camera.getEntity();
#elif MC_VER <= MC_1_21_10
Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera();
Entity entity = camera.getEntity();
#else
Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera();
Entity entity = camera.getEntity();
Entity entity = camera.entity();
#endif
@@ -28,7 +28,6 @@ import net.minecraft.network.chat.Component;
#if MC_VER < MC_1_19_2
import net.minecraft.network.chat.TranslatableComponent;
#endif
import net.minecraft.resources.ResourceLocation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
@@ -51,6 +50,11 @@ import net.minecraft.client.gui.screens.OptionsScreen;
import net.minecraft.client.gui.screens.options.OptionsScreen;
#endif
#if MC_VER <= MC_1_21_10
import net.minecraft.resources.ResourceLocation;
#else
import net.minecraft.resources.Identifier;
#endif
/**
* Adds a button to the menu to goto the config
@@ -62,13 +66,16 @@ import net.minecraft.client.gui.screens.options.OptionsScreen;
public class MixinOptionsScreen extends Screen
{
/** Texture used for the config opening button */
#if MC_VER <= MC_1_20_6
@Unique
private static final ResourceLocation ICON_TEXTURE =
#if MC_VER < MC_1_21_1
new ResourceLocation(ModInfo.ID, "textures/gui/button.png");
#else
ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png");
#endif
private static final ResourceLocation ICON_TEXTURE = new ResourceLocation(ModInfo.ID, "textures/gui/button.png");
#elif MC_VER <= MC_1_21_10
@Unique
private static final ResourceLocation ICON_TEXTURE = ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png");
#else
@Unique
private static final Identifier ICON_TEXTURE = Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png");
#endif
@Unique
@@ -23,7 +23,11 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.BatchGeneratio
import com.seibel.distanthorizons.core.util.objects.RunOnThisThreadExecutorService;
import org.spongepowered.asm.mixin.Mixin;
#if MC_VER <= MC_1_21_10
import net.minecraft.Util;
#else
import net.minecraft.util.Util;
#endif
#if MC_VER < MC_1_21_3
import org.spongepowered.asm.mixin.injection.At;
@@ -24,17 +24,26 @@ package com.seibel.distanthorizons.neoforge.wrappers.modAccessor;
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IIrisAccessor;
#if MC_VER != MC_1_21_9
#if MC_VER != MC_1_21_9 && MC_VER != MC_1_21_11
import net.irisshaders.iris.Iris;
import net.irisshaders.iris.api.v0.IrisApi;
#endif
public class IrisAccessor implements IIrisAccessor
{
public IrisAccessor()
{
#if MC_VER == MC_1_21_11
throw new UnsupportedOperationException("Iris isn't supported on this version of DH. When this version of DH was created Iris wasn't available for Neoforge yet.");
#endif
}
@Override
public String getModName()
{
#if MC_VER == MC_1_21_9
#if MC_VER == MC_1_21_9 || MC_VER == MC_1_21_11
return "iris"; // Iris doesn't support this MC version
#else
return Iris.MODID;
@@ -44,7 +53,7 @@ public class IrisAccessor implements IIrisAccessor
@Override
public boolean isShaderPackInUse()
{
#if MC_VER == MC_1_21_9
#if MC_VER == MC_1_21_9 || MC_VER == MC_1_21_11
return true; // Iris doesn't support this MC version
#else
return IrisApi.getInstance().isShaderPackInUse();
@@ -54,7 +63,7 @@ public class IrisAccessor implements IIrisAccessor
@Override
public boolean isRenderingShadowPass()
{
#if MC_VER == MC_1_21_9
#if MC_VER == MC_1_21_9 || MC_VER == MC_1_21_11
return false; // Iris doesn't support this MC version
#else
return IrisApi.getInstance().isRenderingShadowPass();