forked from Sk1erLLC/Patcher
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* custom pumpkin opacity * fix spacing * add comment just in case anyone is confused on why its there
- Loading branch information
1 parent
a43c8c4
commit 429dffa
Showing
3 changed files
with
32 additions
and
0 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
23 changes: 23 additions & 0 deletions
23
src/main/java/club/sk1er/patcher/mixins/features/GuiIngameMixin_PumpkinBlurRendering.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package club.sk1er.patcher.mixins.features; | ||
|
||
import club.sk1er.patcher.config.PatcherConfig; | ||
import net.minecraft.client.gui.GuiIngame; | ||
import net.minecraft.client.gui.ScaledResolution; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.ModifyArg; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(GuiIngame.class) | ||
public class GuiIngameMixin_PumpkinBlurRendering { | ||
@Inject(method = "renderPumpkinOverlay", at = @At("HEAD"), cancellable = true) | ||
private void patcher$cancelPumpkinOverlay(ScaledResolution scaledRes, CallbackInfo ci) { | ||
if (PatcherConfig.pumpkinOverlayOpacity == 0) ci.cancel(); // micro-optimization, let's skip all the math to render if it's not going to be visible anyways | ||
} | ||
|
||
@ModifyArg(method = "renderPumpkinOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;color(FFFF)V"), index = 3) | ||
private float patcher$modifyPumpkinOpacity(float alpha) { | ||
return PatcherConfig.pumpkinOverlayOpacity; | ||
} | ||
} |
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