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

Commit 4491462

Browse files
committed
(1.20.1, 1.21.1) fix nametag-related bugs
1 parent 24dcee0 commit 4491462

File tree

8 files changed

+24
-22
lines changed

8 files changed

+24
-22
lines changed

1.16_combat-6/src/main/java/io/github/axolotlclient/mixin/TitleScreenMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ protected TitleScreenMixin() {
8080
}
8181
if (APIOptions.getInstance().addShortcutButtons.get()) {
8282
int shortcutButtonY = leftButtonY;
83-
Runnable addApiButtons = () -> {
83+
Runnable addApiButtons = () -> client.execute(() -> {
8484
buttons.add(addButton(new ButtonWidget(10, shortcutButtonY, 50, 20, new TranslatableText("api.friends"),
8585
w -> client.openScreen(new FriendsScreen(this)))));
8686
buttons.add(addButton(new ButtonWidget(10, shortcutButtonY+25, 50, 20, new TranslatableText("api.chats"),
8787
w -> client.openScreen(new ChatListScreen(this)))));
88-
};
88+
});
8989
if (API.getInstance().isAuthenticated()) {
9090
addApiButtons.run();
9191
} else {

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public abstract class EntityRendererMixin<T extends Entity> {
5959
if (entity instanceof AbstractClientPlayerEntity && text.getString().contains(entity.getName().getString())) {
6060
if (!entity.isSneaky()) {
6161
if (AxolotlClient.CONFIG.showBadges.get() && UserRequest.getOnline(entity.getUuid().toString())) {
62-
RenderSystem.enableDepthTest();
62+
//RenderSystem.enableDepthTest();
6363
RenderSystem.setShaderTexture(0, AxolotlClient.badgeIcon);
6464

6565
assert MinecraftClient.getInstance().player != null;
@@ -82,7 +82,14 @@ public abstract class EntityRendererMixin<T extends Entity> {
8282

8383
if (AxolotlClient.CONFIG.customBadge.get()) {
8484
Text badgeText = Util.formatFromCodes(AxolotlClient.CONFIG.badgeText.get());
85-
MinecraftClient.getInstance().textRenderer.draw(badgeText, x, 0, -1, AxolotlClient.CONFIG.useShadows.get(),
85+
if (AxolotlClient.CONFIG.useShadows.get()) {
86+
matrices.push();
87+
matrices.translate(0, 0, 0.1f);
88+
MinecraftClient.getInstance().textRenderer.draw(badgeText, x, 0, -1, true,
89+
matrices.peek().getModel(), vertexConsumers, TextRenderer.TextLayerType.NORMAL, 0, 15728880);
90+
matrices.pop();
91+
}
92+
MinecraftClient.getInstance().textRenderer.draw(badgeText, x, 0, -1, false,
8693
matrices.peek().getModel(), vertexConsumers, TextRenderer.TextLayerType.NORMAL, 0, 15728880);
8794
} else {
8895
Tessellator tessellator = Tessellator.getInstance();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ protected TitleScreenMixin() {
8989
}
9090
if (APIOptions.getInstance().addShortcutButtons.get()) {
9191
int shortcutButtonY = leftButtonY;
92-
Runnable addApiButtons = () -> {
92+
Runnable addApiButtons = () -> client.execute(() -> {
9393
buttons.add(addDrawableChild(ButtonWidget.builder(Text.translatable("api.friends"),
9494
w -> client.setScreen(new FriendsScreen(this))).positionAndSize(10, shortcutButtonY, 50, 20).build()));
9595
buttons.add(addDrawableChild(ButtonWidget.builder(Text.translatable("api.chats"),
9696
w -> client.setScreen(new ChatListScreen(this))).positionAndSize(10, shortcutButtonY+25, 50, 20).build()));
97-
};
97+
});
9898
if (API.getInstance().isAuthenticated()) {
9999
addApiButtons.run();
100100
} else {

1.21.4/src/main/java/io/github/axolotlclient/mixin/TitleScreenMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ protected TitleScreenMixin() {
9292
}
9393
if (APIOptions.getInstance().addShortcutButtons.get()) {
9494
int shortcutButtonY = leftButtonY;
95-
Runnable addApiButtons = () -> {
95+
Runnable addApiButtons = () -> minecraft.submit(() -> {
9696
buttons.add(addRenderableWidget(Button.builder(Component.translatable("api.friends"),
9797
w -> minecraft.setScreen(new FriendsScreen(this))).bounds(10, shortcutButtonY, 50, 20).build()));
9898
buttons.add(addRenderableWidget(Button.builder(Component.translatable("api.chats"),
9999
w -> minecraft.setScreen(new ChatListScreen(this))).bounds(10, shortcutButtonY+25, 50, 20).build()));
100-
};
100+
});
101101
if (API.getInstance().isAuthenticated()) {
102102
addApiButtons.run();
103103
} else {

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import net.minecraft.util.Identifier;
4747
import org.joml.Matrix4f;
4848
import org.spongepowered.asm.mixin.Mixin;
49+
import org.spongepowered.asm.mixin.Unique;
4950
import org.spongepowered.asm.mixin.injection.At;
5051
import org.spongepowered.asm.mixin.injection.Inject;
5152
import org.spongepowered.asm.mixin.injection.ModifyArg;
@@ -106,13 +107,7 @@ public abstract class EntityRendererMixin<T extends Entity> {
106107
}
107108
}
108109

109-
void drawTexture(MatrixStack matr, Identifier texture, int x1, int x2, int y1, int y2, int z, int regionWidth, int regionHeight, float u, float v, int textureWidth, int textureHeight) {
110-
this.drawTexturedQuad(matr, texture, x1, x2, y1, y2, z, (u + 0.0F) / (float) textureWidth,
111-
(u + (float) regionWidth) / (float) textureWidth, (v + 0.0F) / (float) textureHeight,
112-
(v + (float) regionHeight) / (float) textureHeight
113-
);
114-
}
115-
110+
@Unique
116111
void drawTexturedQuad(MatrixStack matrices, Identifier texture, int x1, int x2, int y1, int y2, int z, float u1, float u2, float v1, float v2) {
117112
RenderSystem.setShaderTexture(0, texture);
118113
RenderSystem.setShader(GameRenderer::getPositionTexShader);
@@ -127,7 +122,7 @@ void drawTexturedQuad(MatrixStack matrices, Identifier texture, int x1, int x2,
127122
}
128123

129124
@ModifyArg(method = "renderLabelIfPresent", at = @At(value = "INVOKE",
130-
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"),
125+
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),
131126
index = 8)
132127
public int axolotlclient$bgColor(int color) {
133128
if (AxolotlClient.CONFIG.nametagBackground.get()) {
@@ -138,7 +133,7 @@ void drawTexturedQuad(MatrixStack matrices, Identifier texture, int x1, int x2,
138133
}
139134

140135
@ModifyArg(method = "renderLabelIfPresent", at = @At(value = "INVOKE",
141-
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"),
136+
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),
142137
index = 4)
143138
public boolean axolotlclient$enableShadows(boolean shadow) {
144139
return AxolotlClient.CONFIG.useShadows.get();

1.21/src/main/java/io/github/axolotlclient/mixin/TitleScreenMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ protected TitleScreenMixin() {
8989
}
9090
if (APIOptions.getInstance().addShortcutButtons.get()) {
9191
int shortcutButtonY = leftButtonY;
92-
Runnable addApiButtons = () -> {
92+
Runnable addApiButtons = () -> client.execute(() -> {
9393
buttons.add(addDrawableSelectableElement(ButtonWidget.builder(Text.translatable("api.friends"),
9494
w -> client.setScreen(new FriendsScreen(this))).positionAndSize(10, shortcutButtonY, 50, 20).build()));
9595
buttons.add(addDrawableSelectableElement(ButtonWidget.builder(Text.translatable("api.chats"),
9696
w -> client.setScreen(new ChatListScreen(this))).positionAndSize(10, shortcutButtonY+25, 50, 20).build()));
97-
};
97+
});
9898
if (API.getInstance().isAuthenticated()) {
9999
addApiButtons.run();
100100
} else {

1.8.9/src/main/java/io/github/axolotlclient/mixin/TitleScreenMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ public abstract class TitleScreenMixin extends Screen {
7878
}
7979
if (APIOptions.getInstance().addShortcutButtons.get()) {
8080
int y = leftButtonY;
81-
Runnable addApiButtons = () -> {
81+
Runnable addApiButtons = () -> minecraft.submit(() -> {
8282
buttons.add(new ButtonWidget(142, 10, y, 50, 20, I18n.translate("api.friends")));
8383
buttons.add(new ButtonWidget(42, 10, y + 25, 50, 20, I18n.translate("api.chats")));
84-
};
84+
});
8585
if (API.getInstance().isAuthenticated()) {
8686
addApiButtons.run();
8787
} else {

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.11
9+
version=3.1.1-rc.12
1010

1111
maven_group=io.github.axolotlclient
1212

0 commit comments

Comments
 (0)