aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Misc.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinGuiIngame.java23
-rw-r--r--src/main/resources/mixins.skyhanni.json1
3 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
index 12df4bca4..40ecb5f8a 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
@@ -167,4 +167,9 @@ public class Misc {
@ConfigOption(name = "Config Button", desc = "Add a button to the pause menu to configure SkyHanni.")
@ConfigEditorBoolean
public boolean configButtonOnPause = true;
+
+ @Expose
+ @ConfigOption(name = "Red Scoreboard Numbers", desc = "Hide the red scoreboard numbers at the right side of the screen.")
+ @ConfigEditorBoolean
+ public boolean hideScoreboardNumbers = false;
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinGuiIngame.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinGuiIngame.java
new file mode 100644
index 000000000..6a40eb2cf
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinGuiIngame.java
@@ -0,0 +1,23 @@
+package at.hannibal2.skyhanni.mixins.transformers;
+
+import at.hannibal2.skyhanni.SkyHanniMod;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.GuiIngame;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Redirect;
+
+@Mixin(GuiIngame.class)
+public class MixinGuiIngame {
+
+ @Redirect(method = "renderScoreboard", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawString(Ljava/lang/String;III)I"))
+ private int renderItemOverlayPost(FontRenderer instance, String text, int x, int y, int color) {
+ if (SkyHanniMod.feature.misc.hideScoreboardNumbers) {
+ if (text.startsWith("§c") && text.length() <= 4) {
+ return 0;
+ }
+ }
+
+ return instance.drawString(text, x, y, color);
+ }
+}
diff --git a/src/main/resources/mixins.skyhanni.json b/src/main/resources/mixins.skyhanni.json
index 337fe91de..7fe2496a2 100644
--- a/src/main/resources/mixins.skyhanni.json
+++ b/src/main/resources/mixins.skyhanni.json
@@ -17,6 +17,7 @@
"tileentity.TileEntitySignMixin"
],
"client": [
+ "MixinGuiIngame",
"gui.MixinGuiNewChat"
]
}