diff --git a/src/main/java/com/gtnewhorizons/angelica/mixins/early/notfine/leaves/MixinBlockLeaves.java b/src/main/java/com/gtnewhorizons/angelica/mixins/early/notfine/leaves/MixinBlockLeaves.java index ba1194887..82df08653 100644 --- a/src/main/java/com/gtnewhorizons/angelica/mixins/early/notfine/leaves/MixinBlockLeaves.java +++ b/src/main/java/com/gtnewhorizons/angelica/mixins/early/notfine/leaves/MixinBlockLeaves.java @@ -31,17 +31,17 @@ public abstract class MixinBlockLeaves extends BlockLeavesBase { //A mod dev had no idea what they were doing. return getIcon(side, world.getBlockMetadata(x, y, z)); } - int renderMode = ((LeavesQuality)Settings.MODE_LEAVES.option.getStore()).ordinal() - 1; int maskedMeta = world.getBlockMetadata(x, y, z) & 3; - renderMode = switch (renderMode) { - case -1 -> SettingsManager.leavesOpaque ? 1 : 0; - case 4 -> world.getBlock( + int renderMode; + if(Settings.MODE_LEAVES.option.getStore() == LeavesQuality.SHELLED_FAST) { + renderMode = world.getBlock( x + Facing.offsetsXForSide[side], y + Facing.offsetsYForSide[side], z + Facing.offsetsZForSide[side] ) instanceof ILeafBlock ? 1 : 0; - default -> renderMode > 1 ? 0 : renderMode; - }; + } else { + renderMode = SettingsManager.leavesOpaque ? 1 : 0; + } maskedMeta = maskedMeta >= field_150129_M[renderMode].length ? 0 : maskedMeta; return field_150129_M[renderMode][maskedMeta]; } diff --git a/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/thaumcraft/MixinBlockMagicalLeaves.java b/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/thaumcraft/MixinBlockMagicalLeaves.java index 51226d65f..ca8ce93fe 100644 --- a/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/thaumcraft/MixinBlockMagicalLeaves.java +++ b/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/thaumcraft/MixinBlockMagicalLeaves.java @@ -20,17 +20,17 @@ public abstract class MixinBlockMagicalLeaves extends Block implements ILeafBloc @Override public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - int renderMode = ((LeavesQuality)Settings.MODE_LEAVES.option.getStore()).ordinal() - 1; int maskedMeta = world.getBlockMetadata(x, y, z) & 3; - renderMode = switch (renderMode) { - case -1 -> SettingsManager.leavesOpaque ? 1 : 0; - case 4 -> world.getBlock( + int renderMode; + if(Settings.MODE_LEAVES.option.getStore() == LeavesQuality.SHELLED_FAST) { + renderMode = world.getBlock( x + Facing.offsetsXForSide[side], y + Facing.offsetsYForSide[side], z + Facing.offsetsZForSide[side] ) instanceof ILeafBlock ? 1 : 0; - default -> renderMode > 1 ? 0 : renderMode; - }; + } else { + renderMode = SettingsManager.leavesOpaque ? 1 : 0; + } maskedMeta = maskedMeta > 1 ? 0 : maskedMeta; return icon[renderMode + maskedMeta * 2]; } diff --git a/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/twilightforest/MixinBlockTFLeaves.java b/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/twilightforest/MixinBlockTFLeaves.java index a9a51afe4..834a2e6c5 100644 --- a/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/twilightforest/MixinBlockTFLeaves.java +++ b/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/twilightforest/MixinBlockTFLeaves.java @@ -17,17 +17,17 @@ public abstract class MixinBlockTFLeaves extends BlockLeaves { @Override public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - int renderMode = ((LeavesQuality)Settings.MODE_LEAVES.option.getStore()).ordinal() - 1; int maskedMeta = world.getBlockMetadata(x, y, z) & 3; - renderMode = switch (renderMode) { - case -1 -> SettingsManager.leavesOpaque ? 1 : 0; - case 4 -> world.getBlock( + int renderMode; + if(Settings.MODE_LEAVES.option.getStore() == LeavesQuality.SHELLED_FAST) { + renderMode = world.getBlock( x + Facing.offsetsXForSide[side], y + Facing.offsetsYForSide[side], z + Facing.offsetsZForSide[side] ) instanceof ILeafBlock ? 1 : 0; - default -> renderMode > 1 ? 0 : renderMode; - }; + } else { + renderMode = SettingsManager.leavesOpaque ? 1 : 0; + } maskedMeta = maskedMeta > 1 ? 0 : maskedMeta; return Blocks.leaves.field_150129_M[renderMode][maskedMeta]; } diff --git a/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/twilightforest/MixinBlockTFLeaves3.java b/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/twilightforest/MixinBlockTFLeaves3.java index cab3d6c45..f48b639db 100644 --- a/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/twilightforest/MixinBlockTFLeaves3.java +++ b/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/twilightforest/MixinBlockTFLeaves3.java @@ -17,16 +17,16 @@ public abstract class MixinBlockTFLeaves3 extends BlockLeaves { @Override public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - int renderMode = ((LeavesQuality)Settings.MODE_LEAVES.option.getStore()).ordinal() - 1; - renderMode = switch (renderMode) { - case -1 -> SettingsManager.leavesOpaque ? 1 : 0; - case 4 -> world.getBlock( + int renderMode; + if(Settings.MODE_LEAVES.option.getStore() == LeavesQuality.SHELLED_FAST) { + renderMode = world.getBlock( x + Facing.offsetsXForSide[side], y + Facing.offsetsYForSide[side], z + Facing.offsetsZForSide[side] ) instanceof ILeafBlock ? 1 : 0; - default -> renderMode > 1 ? 0 : renderMode; - }; + } else { + renderMode = SettingsManager.leavesOpaque ? 1 : 0; + } return Blocks.leaves.field_150129_M[renderMode][0]; } diff --git a/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/twilightforest/MixinBlockTFMagicLeaves.java b/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/twilightforest/MixinBlockTFMagicLeaves.java index a1eea3b40..185e4f797 100644 --- a/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/twilightforest/MixinBlockTFMagicLeaves.java +++ b/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/twilightforest/MixinBlockTFMagicLeaves.java @@ -16,17 +16,17 @@ import twilightforest.block.BlockTFMagicLeaves; public abstract class MixinBlockTFMagicLeaves extends BlockLeaves { @Override public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - int renderMode = ((LeavesQuality)Settings.MODE_LEAVES.option.getStore()).ordinal() - 1; int maskedMeta = world.getBlockMetadata(x, y, z) & 3; - renderMode = switch (renderMode) { - case -1 -> SettingsManager.leavesOpaque ? 1 : 0; - case 4 -> world.getBlock( + int renderMode; + if(Settings.MODE_LEAVES.option.getStore() == LeavesQuality.SHELLED_FAST) { + renderMode = world.getBlock( x + Facing.offsetsXForSide[side], y + Facing.offsetsYForSide[side], z + Facing.offsetsZForSide[side] ) instanceof ILeafBlock ? 1 : 0; - default -> renderMode > 1 ? 0 : renderMode; - }; + } else { + renderMode = SettingsManager.leavesOpaque ? 1 : 0; + } maskedMeta = maskedMeta > 1 ? 0 : maskedMeta; return switch (maskedMeta) { case 1 -> renderMode == 1 ? SPR_TRANSLEAVES_OPAQUE : SPR_TRANSLEAVES; diff --git a/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/witchery/MixinBlockWitchLeaves.java b/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/witchery/MixinBlockWitchLeaves.java index 1b7e172c5..17a82f5b3 100644 --- a/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/witchery/MixinBlockWitchLeaves.java +++ b/src/main/java/com/gtnewhorizons/angelica/mixins/late/notfine/leaves/witchery/MixinBlockWitchLeaves.java @@ -28,17 +28,17 @@ public abstract class MixinBlockWitchLeaves extends BlockLeavesBase { @Override public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - int renderMode = ((LeavesQuality)Settings.MODE_LEAVES.option.getStore()).ordinal() - 1; int maskedMeta = world.getBlockMetadata(x, y, z) & 3; - renderMode = switch (renderMode) { - case -1 -> SettingsManager.leavesOpaque ? 1 : 0; - case 4 -> world.getBlock( + int renderMode; + if(Settings.MODE_LEAVES.option.getStore() == LeavesQuality.SHELLED_FAST) { + renderMode = world.getBlock( x + Facing.offsetsXForSide[side], y + Facing.offsetsYForSide[side], z + Facing.offsetsZForSide[side] ) instanceof ILeafBlock ? 1 : 0; - default -> renderMode > 1 ? 0 : renderMode; - }; + } else { + renderMode = SettingsManager.leavesOpaque ? 1 : 0; + } maskedMeta = maskedMeta > 1 ? 0 : maskedMeta; return iconsForModes[renderMode][maskedMeta]; } diff --git a/src/main/java/jss/notfine/core/SettingsManager.java b/src/main/java/jss/notfine/core/SettingsManager.java index e63bd6cec..469b6232e 100644 --- a/src/main/java/jss/notfine/core/SettingsManager.java +++ b/src/main/java/jss/notfine/core/SettingsManager.java @@ -85,7 +85,7 @@ public class SettingsManager { //Do not re-enable, see MixinBlockLeaves workaround for Angelica/Sodium style menus. //mc.renderGlobal.loadRenderers(); LeavesQuality value = (LeavesQuality)Settings.MODE_LEAVES.option.getStore(); - leavesOpaque = value == LeavesQuality.FANCY || (value == LeavesQuality.DEFAULT && !mc.gameSettings.fancyGraphics); + leavesOpaque = value == LeavesQuality.FAST || (value == LeavesQuality.DEFAULT && !mc.gameSettings.fancyGraphics); Blocks.leaves.setGraphicsLevel(!leavesOpaque); Blocks.leaves2.setGraphicsLevel(!leavesOpaque); } diff --git a/src/main/java/jss/notfine/util/LeafRenderUtil.java b/src/main/java/jss/notfine/util/LeafRenderUtil.java index 849b08427..2820abe10 100644 --- a/src/main/java/jss/notfine/util/LeafRenderUtil.java +++ b/src/main/java/jss/notfine/util/LeafRenderUtil.java @@ -32,7 +32,7 @@ public class LeafRenderUtil { } if(otherBlock instanceof ILeafBlock) { switch ((LeavesQuality)Settings.MODE_LEAVES.option.getStore()) { - case FANCY, SMART -> { + case FAST, SMART -> { return false; } case SHELLED_FANCY, SHELLED_FAST -> { diff --git a/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java b/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java index 62c68a7b1..d11b6bf06 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java @@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableList; import com.gtnewhorizons.angelica.config.AngelicaConfig; import com.gtnewhorizons.angelica.glsm.GLStateManager; import jss.notfine.core.Settings; +import jss.notfine.core.SettingsManager; import me.flashyreese.mods.reeses_sodium_options.client.gui.ReeseSodiumVideoOptionsScreen; import me.jellysquid.mods.sodium.client.gui.options.OptionFlag; import me.jellysquid.mods.sodium.client.gui.options.OptionGroup; @@ -162,7 +163,8 @@ public class SodiumGameOptionPages { .setTooltip(I18n.format("sodium.options.graphics_quality.tooltip")) .setControl(option -> new CyclingControl<>(option, GraphicsMode.class)) .setBinding( - (opts, value) -> opts.fancyGraphics = value.isFancy(), + (opts, value) -> { opts.fancyGraphics = value.isFancy(); + SettingsManager.graphicsUpdated(); }, opts -> GraphicsMode.fromBoolean(opts.fancyGraphics)) .setImpact(OptionImpact.HIGH) .setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD)