diff --git a/common/src/main/java/net/irisshaders/iris/compat/sodium/mixin/MixinSodiumGameOptionPages.java b/common/src/main/java/net/irisshaders/iris/compat/sodium/mixin/MixinSodiumGameOptionPages.java index fd299fd4b8..555b4fb7f1 100644 --- a/common/src/main/java/net/irisshaders/iris/compat/sodium/mixin/MixinSodiumGameOptionPages.java +++ b/common/src/main/java/net/irisshaders/iris/compat/sodium/mixin/MixinSodiumGameOptionPages.java @@ -149,7 +149,7 @@ private static OptionImpl createLimitedVideoSett new Component[]{Component.translatable("options.graphics.fast"), Component.translatable("options.graphics.fancy")})) .setBinding( (opts, value) -> opts.graphicsMode().set(value.toVanilla()), - opts -> SupportedGraphicsMode.fromVanilla(opts.graphicsMode().get())) + opts -> SupportedGraphicsMode.fromVanilla(opts.graphicsMode())) .setImpact(OptionImpact.HIGH) .setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD) .build(); diff --git a/common/src/main/java/net/irisshaders/iris/fantastic/SupportedGraphicsMode.java b/common/src/main/java/net/irisshaders/iris/fantastic/SupportedGraphicsMode.java index a66485becf..83bbe1cfca 100644 --- a/common/src/main/java/net/irisshaders/iris/fantastic/SupportedGraphicsMode.java +++ b/common/src/main/java/net/irisshaders/iris/fantastic/SupportedGraphicsMode.java @@ -1,16 +1,22 @@ package net.irisshaders.iris.fantastic; +import net.irisshaders.iris.Iris; import net.minecraft.client.GraphicsStatus; +import net.minecraft.client.OptionInstance; public enum SupportedGraphicsMode { FAST, FANCY; - public static SupportedGraphicsMode fromVanilla(GraphicsStatus status) { - return switch (status) { + public static SupportedGraphicsMode fromVanilla(OptionInstance status) { + return switch (status.get()) { case FAST -> FAST; case FANCY -> FANCY; - case FABULOUS -> throw new IllegalStateException("Fabulous graphics mode is not supported by Iris"); + case FABULOUS -> { + Iris.logger.warn("Detected Fabulous Graphics being used somehow, changing to Fancy!"); + status.set(GraphicsStatus.FANCY); + yield FANCY; + } }; }