-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
14 changed files
with
97 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ bin/ | |
run/ | ||
**/build/ | ||
!src/**/build/ | ||
remappedSrc/ | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
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,4 +1,13 @@ | ||
# | ||
#Wed May 01 20:37:56 IDT 2024 | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=17 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=17 |
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
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
Binary file not shown.
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
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
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
65 changes: 10 additions & 55 deletions
65
src/main/java/io/github/ngspace/hudder/mixin/InGameHudInjections.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,69 +1,24 @@ | ||
package io.github.ngspace.hudder.mixin; | ||
|
||
import static io.github.ngspace.hudder.Hudder.config; | ||
import static io.github.ngspace.hudder.Hudder.ins; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import io.github.ngspace.hudder.Hudder; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.client.gui.hud.InGameHud; | ||
import net.minecraft.entity.JumpingMount; | ||
|
||
@Environment(EnvType.CLIENT) | ||
@Mixin(InGameHud.class) | ||
public class InGameHudInjections { | ||
|
||
public boolean shouldDraw() {return (!config.removegui)||(!config.shouldCompile(ins));} | ||
|
||
//Mount Jump Bar | ||
|
||
@Redirect(method = "render", at = @At(value = "INVOKE", target= | ||
"Lnet/minecraft/client/gui/hud/InGameHud;renderMountJumpBar(Lnet/minecraft/entity/JumpingMount;Lnet/minecraft/client/gui/DrawContext;I)V")) | ||
public void disableMountJumpBar(InGameHud hud, JumpingMount mount, DrawContext context, int x) { | ||
if (shouldDraw()) hud.renderMountJumpBar(mount, context, x); | ||
} | ||
|
||
//EXP | ||
|
||
@Redirect(method = "render", at = @At(value = "INVOKE", target= | ||
"Lnet/minecraft/client/gui/hud/InGameHud;renderExperienceBar(Lnet/minecraft/client/gui/DrawContext;I)V")) | ||
public void disableExperienceBar(InGameHud hud, DrawContext context, int x) { | ||
if (shouldDraw()) hud.renderExperienceBar(context, x); | ||
} | ||
|
||
//Hotbar | ||
|
||
@Redirect(method = "render", at = @At(value = "INVOKE", target= | ||
"Lnet/minecraft/client/gui/hud/InGameHud;renderHotbar(FLnet/minecraft/client/gui/DrawContext;)V")) | ||
public void disabledHotbar(InGameHud hud, float tickdelta, DrawContext context) { | ||
if (shouldDraw()) ((InGameHudAccessor)hud).callRenderHotbar(tickdelta, context); | ||
} | ||
|
||
//Status Bars | ||
|
||
@Redirect(method = "render", at = @At(value = "INVOKE", target= | ||
"Lnet/minecraft/client/gui/hud/InGameHud;renderStatusBars(Lnet/minecraft/client/gui/DrawContext;)V")) | ||
public void disableStatusBars(InGameHud hud, DrawContext context) { | ||
if (shouldDraw()) ((InGameHudAccessor)hud).callRenderStatusBars(context); | ||
} | ||
|
||
//Mount Health | ||
|
||
@Redirect(method = "render", at = @At(value = "INVOKE", target= | ||
"Lnet/minecraft/client/gui/hud/InGameHud;renderMountHealth(Lnet/minecraft/client/gui/DrawContext;)V")) | ||
public void disableMountHealth(InGameHud hud, DrawContext context) { | ||
if (shouldDraw()) ((InGameHudAccessor)hud).callRenderMountHealth(context); | ||
} | ||
|
||
//Mount Health | ||
|
||
@Redirect(method = "render", at = @At(value = "INVOKE", target= | ||
"Lnet/minecraft/client/gui/hud/InGameHud;renderHeldItemTooltip(Lnet/minecraft/client/gui/DrawContext;)V")) | ||
public void renderHeldItemTooltip(InGameHud hud, DrawContext context) { | ||
if (shouldDraw()) hud.renderHeldItemTooltip(context); | ||
} | ||
} | ||
public boolean shouldNotDraw() {return Hudder.config.removegui&&Hudder.config.shouldCompile(Hudder.ins);} | ||
|
||
@Inject(method = "renderMainHud", at = @At("HEAD"),cancellable=true) | ||
public void disableMainHud(DrawContext context, float x, CallbackInfo i) {if (shouldNotDraw()) i.cancel();} | ||
@Inject(method = "renderExperienceLevel", at = @At("HEAD"),cancellable=true) | ||
public void disableExperienceLevel(DrawContext context, float x, CallbackInfo i) {if (shouldNotDraw()) i.cancel();} | ||
} |