diff --git a/src/client/java/wtf/hak/survivalfabric/mixin/client/BackgroundRendererMixin.java b/src/client/java/wtf/hak/survivalfabric/mixin/client/BackgroundRendererMixin.java index 9270448..0c42d31 100644 --- a/src/client/java/wtf/hak/survivalfabric/mixin/client/BackgroundRendererMixin.java +++ b/src/client/java/wtf/hak/survivalfabric/mixin/client/BackgroundRendererMixin.java @@ -23,24 +23,25 @@ public abstract class BackgroundRendererMixin { @Inject(method = "applyFog", at = @At("RETURN"), cancellable = true) private static void applyFog(Camera camera, BackgroundRenderer.FogType fogType, Vector4f color, float viewDistance, boolean thickenFog, float tickProgress, CallbackInfoReturnable cir) { + CameraSubmersionType submersion = camera.getSubmersionType(); boolean renderFog = true; - CameraSubmersionType subType = camera.getSubmersionType(); - if (subType == CameraSubmersionType.NONE) { - World world = camera.getFocusedEntity().getWorld(); - if (world.getRegistryKey() == World.OVERWORLD && !getConfig().renderOverworldFog) - renderFog = false; - else if (world.getRegistryKey() == World.NETHER && !getConfig().renderNetherFog) - renderFog = false; - else if (world.getRegistryKey() == World.END && !getConfig().renderEndFog) - renderFog = false; - } else if (subType == CameraSubmersionType.WATER && !getConfig().renderWaterFog) - renderFog = false; - else if (subType == CameraSubmersionType.LAVA && !getConfig().renderLavaFog) - renderFog = false; - else if (subType == CameraSubmersionType.POWDER_SNOW && !getConfig().renderSnowFog) - renderFog = false; - if (!renderFog) + switch (submersion) { + case NONE -> { + World world = camera.getFocusedEntity().getWorld(); + if ((world.getRegistryKey() == World.OVERWORLD && !getConfig().renderOverworldFog) + || (world.getRegistryKey() == World.NETHER && !getConfig().renderNetherFog) + || (world.getRegistryKey() == World.END && !getConfig().renderEndFog)) { + renderFog = false; + } + } + case WATER -> renderFog = getConfig().renderWaterFog; + case LAVA -> renderFog = getConfig().renderLavaFog; + case POWDER_SNOW -> renderFog = getConfig().renderSnowFog; + } + + if (!renderFog) { cir.setReturnValue(EMPTY_FOG); + } } } diff --git a/src/client/java/wtf/hak/survivalfabric/modmenu/ModMenuIntegration.java b/src/client/java/wtf/hak/survivalfabric/modmenu/ModMenuIntegration.java index d2f93d7..cb7b2e2 100644 --- a/src/client/java/wtf/hak/survivalfabric/modmenu/ModMenuIntegration.java +++ b/src/client/java/wtf/hak/survivalfabric/modmenu/ModMenuIntegration.java @@ -10,7 +10,6 @@ public class ModMenuIntegration implements ModMenuApi { @Override public ConfigScreenFactory getModConfigScreenFactory() { - System.out.println("Does ModMenuIntegration even load?"); - return parent -> new ConfigScreen(parent); + return ConfigScreen::new; } }