diff options
| author | anhgelus <anhgelus.morhtuuzh@proton.me> | 2024-08-21 18:01:50 +0000 |
|---|---|---|
| committer | anhgelus <anhgelus.morhtuuzh@proton.me> | 2024-08-21 18:02:11 +0000 |
| commit | ec6b3c2d8db90a4100ea493d4a2ef7722d7c064c (patch) | |
| tree | f995f28952ca6c51bc0eeac86819779dbeda17cc /src/client/java/world/anhgelus | |
| parent | e842b9e82f76bb016ea6a099a5d40a2bb5977b22 (diff) | |
feat(player): disable nametag
Diffstat (limited to 'src/client/java/world/anhgelus')
| -rw-r--r-- | src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java | 21 |
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 |
