-
-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fda28a8
commit ee3c219
Showing
3 changed files
with
74 additions
and
72 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
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
141 changes: 71 additions & 70 deletions
141
src/main/java/net/wurstclient/mixin/IngameHudMixin.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,70 +1,71 @@ | ||
/* | ||
* Copyright (c) 2014-2024 Wurst-Imperium and contributors. | ||
* | ||
* This source code is subject to the terms of the GNU General Public | ||
* License, version 3. If a copy of the GPL was not distributed with this | ||
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt | ||
*/ | ||
package net.wurstclient.mixin; | ||
|
||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.client.gui.hud.DebugHud; | ||
import net.minecraft.client.gui.hud.InGameHud; | ||
import net.minecraft.util.Identifier; | ||
import net.wurstclient.WurstClient; | ||
import net.wurstclient.event.EventManager; | ||
import net.wurstclient.events.GUIRenderListener.GUIRenderEvent; | ||
|
||
@Mixin(InGameHud.class) | ||
public class IngameHudMixin | ||
{ | ||
@Shadow | ||
@Final | ||
private DebugHud debugHud; | ||
|
||
@Inject( | ||
at = @At(value = "INVOKE", | ||
target = "Lcom/mojang/blaze3d/systems/RenderSystem;enableBlend()V", | ||
remap = false, | ||
ordinal = 3), | ||
method = "render(Lnet/minecraft/client/gui/DrawContext;F)V") | ||
private void onRender(DrawContext context, float tickDelta, CallbackInfo ci) | ||
{ | ||
if(debugHud.shouldShowDebugHud()) | ||
return; | ||
|
||
EventManager.fire(new GUIRenderEvent(context, tickDelta)); | ||
} | ||
|
||
@Inject(at = @At("HEAD"), | ||
method = "renderOverlay(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/util/Identifier;F)V", | ||
cancellable = true) | ||
private void onRenderOverlay(DrawContext context, Identifier texture, | ||
float opacity, CallbackInfo ci) | ||
{ | ||
if(texture == null | ||
|| !"textures/misc/pumpkinblur.png".equals(texture.getPath())) | ||
return; | ||
|
||
if(WurstClient.INSTANCE.getHax().noPumpkinHack.isEnabled()) | ||
ci.cancel(); | ||
} | ||
|
||
@Inject(at = @At("HEAD"), | ||
method = "renderPortalOverlay(Lnet/minecraft/client/util/math/MatrixStack;F)V", | ||
cancellable = true) | ||
private void onRenderPortalOverlay(MatrixStack matrixStack, float nauseaStrength, CallbackInfo ci) | ||
{ | ||
if(!WurstClient.INSTANCE.getHax().noPortalOverlayHack.isEnabled()) | ||
return; | ||
|
||
ci.cancel(); | ||
} | ||
} | ||
/* | ||
* Copyright (c) 2014-2024 Wurst-Imperium and contributors. | ||
* | ||
* This source code is subject to the terms of the GNU General Public | ||
* License, version 3. If a copy of the GPL was not distributed with this | ||
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt | ||
*/ | ||
package net.wurstclient.mixin; | ||
|
||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.client.gui.hud.DebugHud; | ||
import net.minecraft.client.gui.hud.InGameHud; | ||
import net.minecraft.util.Identifier; | ||
import net.wurstclient.WurstClient; | ||
import net.wurstclient.event.EventManager; | ||
import net.wurstclient.events.GUIRenderListener.GUIRenderEvent; | ||
|
||
@Mixin(InGameHud.class) | ||
public class IngameHudMixin | ||
{ | ||
@Shadow | ||
@Final | ||
private DebugHud debugHud; | ||
|
||
@Inject( | ||
at = @At(value = "INVOKE", | ||
target = "Lcom/mojang/blaze3d/systems/RenderSystem;enableBlend()V", | ||
remap = false, | ||
ordinal = 3), | ||
method = "render(Lnet/minecraft/client/gui/DrawContext;F)V") | ||
private void onRender(DrawContext context, float tickDelta, CallbackInfo ci) | ||
{ | ||
if(debugHud.shouldShowDebugHud()) | ||
return; | ||
|
||
EventManager.fire(new GUIRenderEvent(context, tickDelta)); | ||
} | ||
|
||
@Inject(at = @At("HEAD"), | ||
method = "renderOverlay(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/util/Identifier;F)V", | ||
cancellable = true) | ||
private void onRenderOverlay(DrawContext context, Identifier texture, | ||
float opacity, CallbackInfo ci) | ||
{ | ||
if(texture == null | ||
|| !"textures/misc/pumpkinblur.png".equals(texture.getPath())) | ||
return; | ||
|
||
if(WurstClient.INSTANCE.getHax().noPumpkinHack.isEnabled()) | ||
ci.cancel(); | ||
} | ||
|
||
@Inject(at = @At("HEAD"), | ||
method = "renderPortalOverlay(Lnet/minecraft/client/gui/DrawContext;F)V", | ||
cancellable = true) | ||
private void onRenderPortalOverlay(DrawContext context, | ||
float nauseaStrength, CallbackInfo ci) | ||
{ | ||
if(!WurstClient.INSTANCE.getHax().noPortalOverlayHack.isEnabled()) | ||
return; | ||
|
||
ci.cancel(); | ||
} | ||
} |