Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 805555d

Browse files
committed
(1.20.1) fix nametag shadow
1 parent 7940cee commit 805555d

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

1.20/src/main/java/io/github/axolotlclient/mixin/EntityRendererMixin.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,15 @@ public abstract class EntityRendererMixin<T extends Entity> {
119119
}
120120
}
121121

122-
@Inject(method = "renderLabelIfPresent", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer;draw(Lnet/minecraft/text/Text;FFIZLorg/joml/Matrix4f;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/client/font/TextRenderer$TextLayerType;II)I", ordinal = 0))
123-
public void axolotlclient$enableShadows(T entity, Text text, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci, @Local boolean notSneaking, @Local Matrix4f matrix4f, @Local(ordinal = 1) int i, @Local(ordinal = 2) float h, @Local(ordinal = 2) int j, @Local TextRenderer textRenderer) {
124-
if (AxolotlClient.CONFIG.useShadows.get()) {
125-
matrices.push();
126-
matrices.translate(0, 0, 0.1);
127-
textRenderer.draw(
128-
text, h, (float) i, notSneaking ? -1 : 553648127, true, matrix4f, vertexConsumers, notSneaking ? TextRenderer.TextLayerType.SEE_THROUGH : TextRenderer.TextLayerType.NORMAL, 0, light
129-
);
130-
matrices.pop();
131-
}
122+
@ModifyArg(method = "renderLabelIfPresent", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer;draw(Lnet/minecraft/text/Text;FFIZLorg/joml/Matrix4f;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/client/font/TextRenderer$TextLayerType;II)I", ordinal = 0), index = 4)
123+
private boolean enableShadows$sneaking(boolean par5, @Local Matrix4f matrix4f, @Local boolean notSneaking) {
124+
matrix4f.scale(1, 1, -1);
125+
return !notSneaking && AxolotlClient.CONFIG.useShadows.get();
126+
}
127+
128+
@ModifyArg(method = "renderLabelIfPresent", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer;draw(Lnet/minecraft/text/Text;FFIZLorg/joml/Matrix4f;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/client/font/TextRenderer$TextLayerType;II)I", ordinal = 1), index = 4)
129+
private boolean enableShadows(boolean par5, @Local Matrix4f matrix4f) {
130+
return AxolotlClient.CONFIG.useShadows.get();
132131
}
133132

134133
@Inject(method = "renderLabelIfPresent", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer;draw(Lnet/minecraft/text/Text;FFIZLorg/joml/Matrix4f;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/client/font/TextRenderer$TextLayerType;II)I", ordinal = 1))

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ org.gradle.parallel=true
66
axolotlclient.modules.all=true
77

88
# Mod Properties
9-
version=3.1.1-rc.16
9+
version=3.1.1-rc.17
1010

1111
maven_group=io.github.axolotlclient
1212

0 commit comments

Comments
 (0)