forked from FiniteReality/embeddium
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from ZZZank/12.x/forge
Fix vignette config
- Loading branch information
Showing
2 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 12 additions & 3 deletions
15
src/main/java/me/jellysquid/mods/sodium/mixin/features/options/MixinInGameHud.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
package me.jellysquid.mods.sodium.mixin.features.options; | ||
|
||
import me.jellysquid.mods.sodium.client.SodiumClientMod; | ||
import net.minecraft.client.gui.GuiIngame; | ||
import net.minecraftforge.client.GuiIngameForge; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(GuiIngame.class) | ||
/** | ||
* note that both {@link net.minecraft.client.gui.GuiIngame} and {@link net.minecraftforge.client.GuiIngameForge} | ||
* implements client GUI rendering, and mixins for GuiIngame can be totally useless since GuiIngame might be | ||
* intentionally ignored and barely invoked | ||
*/ | ||
@Mixin(GuiIngameForge.class) | ||
public class MixinInGameHud { | ||
@Redirect(method = "renderGameOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;isFancyGraphicsEnabled()Z")) | ||
private boolean redirectFancyGraphicsVignette() { | ||
private boolean vintagium$redirectVignette() { | ||
//mixin target is `if (renderVignette && Minecraft.isFancyGraphicsEnabled())` | ||
//we assume that `renderVignette` is always true, because vanilla/forge will not change its value, and mods that | ||
//will change it explicitly must have a reason. | ||
return SodiumClientMod.options().quality.enableVignette; | ||
} | ||
} |