aboutsummaryrefslogtreecommitdiff
path: root/src/client/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/java')
-rw-r--r--src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java21
1 files changed, 21 insertions, 0 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