aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranhgelus <anhgelus.morhtuuzh@proton.me>2024-08-21 23:29:47 +0000
committeranhgelus <anhgelus.morhtuuzh@proton.me>2024-08-21 23:29:47 +0000
commite0a3392795c7abc0c1080d71b6c0d83c8de78a2d (patch)
treef43776a2670c17ac23c6472e16fcffbdae881715
parent0c936086d74adc98c017747684a072022e502e88 (diff)
feat(player): disable tab
-rw-r--r--src/client/java/world/anhgelus/molehunt/client/mixin/NoPlayerListHud.java15
-rw-r--r--src/client/resources/molehunt.client.mixins.json1
-rw-r--r--src/main/java/world/anhgelus/molehunt/Game.java2
-rw-r--r--src/main/java/world/anhgelus/molehunt/utils/TimeUtils.java2
4 files changed, 20 insertions, 0 deletions
diff --git a/src/client/java/world/anhgelus/molehunt/client/mixin/NoPlayerListHud.java b/src/client/java/world/anhgelus/molehunt/client/mixin/NoPlayerListHud.java
new file mode 100644
index 0000000..8ef33fd
--- /dev/null
+++ b/src/client/java/world/anhgelus/molehunt/client/mixin/NoPlayerListHud.java
@@ -0,0 +1,15 @@
+package world.anhgelus.molehunt.client.mixin;
+
+import net.minecraft.client.gui.hud.PlayerListHud;
+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.callback.CallbackInfo;
+
+@Mixin(PlayerListHud.class)
+public class NoPlayerListHud {
+ @Inject(at = @At("HEAD"), method = "render", cancellable = true)
+ public void render(CallbackInfo ci) {
+ ci.cancel();
+ }
+}
diff --git a/src/client/resources/molehunt.client.mixins.json b/src/client/resources/molehunt.client.mixins.json
index c5eb170..2451258 100644
--- a/src/client/resources/molehunt.client.mixins.json
+++ b/src/client/resources/molehunt.client.mixins.json
@@ -5,6 +5,7 @@
"compatibilityLevel": "JAVA_21",
"client": [
"NoNametags",
+ "NoPlayerListHud",
"NoSkin"
],
"injectors": {
diff --git a/src/main/java/world/anhgelus/molehunt/Game.java b/src/main/java/world/anhgelus/molehunt/Game.java
new file mode 100644
index 0000000..f084bfd
--- /dev/null
+++ b/src/main/java/world/anhgelus/molehunt/Game.java
@@ -0,0 +1,2 @@
+package world.anhgelus.molehunt;public class Game {
+}
diff --git a/src/main/java/world/anhgelus/molehunt/utils/TimeUtils.java b/src/main/java/world/anhgelus/molehunt/utils/TimeUtils.java
new file mode 100644
index 0000000..8db8eb0
--- /dev/null
+++ b/src/main/java/world/anhgelus/molehunt/utils/TimeUtils.java
@@ -0,0 +1,2 @@
+package world.anhgelus.molehunt.utils;public class TimeUtils {
+}