diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java | 21 | ||||
| -rw-r--r-- | src/client/resources/molehunt.client.mixins.json | 3 | ||||
| -rw-r--r-- | src/main/resources/molehunt.mixins.json | 3 |
3 files changed, 24 insertions, 3 deletions
diff --git a/src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java b/src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java new file mode 100644 index 0000000..d7795dd --- /dev/null +++ b/src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java @@ -0,0 +1,21 @@ +package world.anhgelus.molehunt.client.mixin;
+
+import net.minecraft.client.render.VertexConsumerProvider;
+import net.minecraft.client.render.entity.EntityRenderer;
+import net.minecraft.client.util.math.MatrixStack;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.PlayerEntity;
+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(EntityRenderer.class)
+public abstract class NoNametags<T extends Entity> {
+ @Inject(at = @At("HEAD"), method = "render", cancellable = true)
+ private void renderLabelOrNot(T entity, float yaw, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) {
+ if (!(entity instanceof PlayerEntity)) return;
+
+ ci.cancel();
+ }
+}
\ No newline at end of file diff --git a/src/client/resources/molehunt.client.mixins.json b/src/client/resources/molehunt.client.mixins.json index 149a39e..e6a9f8e 100644 --- a/src/client/resources/molehunt.client.mixins.json +++ b/src/client/resources/molehunt.client.mixins.json @@ -1,9 +1,10 @@ { "required": true, "minVersion": "0.8", - "package": "world.anhgelus.molehunt.mixin.client", + "package": "world.anhgelus.molehunt.client.mixin", "compatibilityLevel": "JAVA_21", "client": [ + "NoNametags" ], "injectors": { "defaultRequire": 1 diff --git a/src/main/resources/molehunt.mixins.json b/src/main/resources/molehunt.mixins.json index 5b76af8..8acee9a 100644 --- a/src/main/resources/molehunt.mixins.json +++ b/src/main/resources/molehunt.mixins.json @@ -3,8 +3,7 @@ "minVersion": "0.8", "package": "world.anhgelus.molehunt.mixin", "compatibilityLevel": "JAVA_21", - "mixins": [ - ], + "mixins": [], "injectors": { "defaultRequire": 1 } |
