custom ui textures and name tab
@@ -13,6 +13,8 @@ import java.net.URI;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class AuraApi {
|
public class AuraApi {
|
||||||
private static final String URL = "http://localhost:3000";
|
private static final String URL = "http://localhost:3000";
|
||||||
@@ -20,6 +22,8 @@ public class AuraApi {
|
|||||||
private static String token = null;
|
private static String token = null;
|
||||||
private static String uuid = null;
|
private static String uuid = null;
|
||||||
|
|
||||||
|
public static List<AuraPlayer> players = new ArrayList<>();
|
||||||
|
|
||||||
public static boolean authenticate() {
|
public static boolean authenticate() {
|
||||||
try {
|
try {
|
||||||
MinecraftClient client = MinecraftClient.getInstance();
|
MinecraftClient client = MinecraftClient.getInstance();
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package org.auraclient.auraclient.auth;
|
||||||
|
|
||||||
|
public class AuraPlayer {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package org.auraclient.auraclient.menus;
|
package org.auraclient.auraclient.menus;
|
||||||
|
|
||||||
import org.auraclient.auraclient.cloaks.Cloaks;
|
import org.auraclient.auraclient.cloaks.Cloaks;
|
||||||
|
import org.auraclient.auraclient.widgets.AuraButton;
|
||||||
|
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
public class CloakSelector extends Screen {
|
public class CloakSelector extends Screen {
|
||||||
@@ -13,13 +13,13 @@ public class CloakSelector extends Screen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void init() {
|
protected void init() {
|
||||||
int y = ((this.height - (35 * (Cloaks.availableCloaks.size()))) / 2) + 30;
|
int y = ((this.height - (35 * (Cloaks.availableCloaks.size()))) / 2);
|
||||||
|
|
||||||
for (String cloak : Cloaks.availableCloaks) {
|
for (String cloak : Cloaks.availableCloaks) {
|
||||||
addDrawableChild(ButtonWidget.builder(Text.literal(cloak), (__) -> {
|
addDrawableChild(new AuraButton(Text.literal(cloak), (__) -> {
|
||||||
String uuid = client.player.getUuidAsString().replace("-", "");
|
String uuid = client.player.getUuidAsString().replace("-", "");
|
||||||
Cloaks.setCloak(uuid, cloak);
|
Cloaks.setCloak(uuid, cloak);
|
||||||
}).dimensions((this.width - 50) / 2, y, 50, 30).build());
|
}, (this.width - 50) / 2, y, 50, 30));
|
||||||
|
|
||||||
y += 35;
|
y += 35;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
package org.auraclient.auraclient.menus;
|
package org.auraclient.auraclient.menus;
|
||||||
|
|
||||||
|
import org.auraclient.auraclient.widgets.AuraButton;
|
||||||
|
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
public class MainMenu extends Screen {
|
public class MainMenu extends Screen {
|
||||||
@@ -11,10 +12,16 @@ public class MainMenu extends Screen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void init() {
|
protected void init() {
|
||||||
addDrawableChild(ButtonWidget.builder(Text.literal("Cloaks"), (_button) -> {
|
super.init();
|
||||||
if (client.player != null) {
|
|
||||||
client.setScreen(new CloakSelector());
|
int buttonWidth = 50;
|
||||||
}
|
int buttonHeight = 30;
|
||||||
}).dimensions((this.width - 50) / 2, (this.height - 30) / 2, 50, 30).build());
|
|
||||||
|
addDrawableChild(
|
||||||
|
new AuraButton(Text.literal("Cloaks"), (_button) -> {
|
||||||
|
if (client.player != null) {
|
||||||
|
client.setScreen(new CloakSelector());
|
||||||
|
}
|
||||||
|
}, (this.width - buttonWidth) / 2, (this.height - buttonHeight) / 2, buttonWidth, buttonHeight));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
package org.auraclient.auraclient.mixin;
|
|
||||||
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.render.OverlayTexture;
|
|
||||||
import net.minecraft.client.render.RenderLayer;
|
|
||||||
import net.minecraft.client.render.VertexConsumer;
|
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderer;
|
|
||||||
import net.minecraft.client.render.entity.state.EntityRenderState;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
import net.minecraft.text.Text;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
import net.minecraft.client.render.LightmapTextureManager;
|
|
||||||
|
|
||||||
import org.joml.Matrix4f;
|
|
||||||
import org.joml.Quaternionf;
|
|
||||||
import org.joml.Vector3f;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.Overwrite;
|
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
|
||||||
|
|
||||||
@Mixin(EntityRenderer.class)
|
|
||||||
public abstract class EntityRendererMixin<S extends EntityRenderState> {
|
|
||||||
private static final Identifier BADGE_TEXTURE = Identifier.of("auraclient", "textures/player.png");
|
|
||||||
|
|
||||||
@Shadow
|
|
||||||
public EntityRenderDispatcher dispatcher;
|
|
||||||
|
|
||||||
@Overwrite
|
|
||||||
public void renderLabelIfPresent(S state, Text text, MatrixStack matrices,
|
|
||||||
VertexConsumerProvider vertexConsumers, int light) {
|
|
||||||
|
|
||||||
matrices.push();
|
|
||||||
|
|
||||||
matrices.translate(0.0f, 0.0f, 0.0f);
|
|
||||||
|
|
||||||
int textWidth = MinecraftClient.getInstance().textRenderer.getWidth(text);
|
|
||||||
|
|
||||||
double y = state.nameLabelPos.y;
|
|
||||||
|
|
||||||
renderTextAtOrigin(y, text, matrices, vertexConsumers, light);
|
|
||||||
|
|
||||||
if (state instanceof net.minecraft.client.render.entity.state.PlayerEntityRenderState) {
|
|
||||||
float yawAngle = 0.0f;
|
|
||||||
Quaternionf yawRotation = new Quaternionf().rotateY((float) Math.toRadians(yawAngle));
|
|
||||||
matrices.multiply(yawRotation);
|
|
||||||
|
|
||||||
Quaternionf cameraRotation = dispatcher.camera.getRotation();
|
|
||||||
Vector3f leftVector = new Vector3f(-1, 0, 0).rotate(cameraRotation);
|
|
||||||
|
|
||||||
float xOffset = textWidth * 0.018f;
|
|
||||||
|
|
||||||
matrices.translate(leftVector.x * xOffset, y + 0.4f, leftVector.z * xOffset);
|
|
||||||
|
|
||||||
matrices.scale(0.25F, 0.25F, 0.25F);
|
|
||||||
|
|
||||||
renderBadgeIcon(matrices, vertexConsumers, light);
|
|
||||||
}
|
|
||||||
|
|
||||||
matrices.pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void renderTextAtOrigin(double y, Text text, MatrixStack matrices,
|
|
||||||
VertexConsumerProvider vertexConsumers,
|
|
||||||
int light) {
|
|
||||||
// Push the current matrix stack
|
|
||||||
matrices.push();
|
|
||||||
|
|
||||||
// Translate to the origin (0, 0, 0) and adjust the vertical position slightly
|
|
||||||
matrices.translate(0.0f, y + 0.5f, 0.0f);
|
|
||||||
|
|
||||||
// Apply the camera's rotation to face the text towards the camera
|
|
||||||
matrices.multiply(dispatcher.getRotation());
|
|
||||||
|
|
||||||
// Scale the text to a readable size
|
|
||||||
matrices.scale(0.025F, -0.025F, 0.025F);
|
|
||||||
|
|
||||||
// Get the position matrix for rendering
|
|
||||||
Matrix4f matrix4f = matrices.peek().getPositionMatrix();
|
|
||||||
|
|
||||||
// Obtain the text renderer
|
|
||||||
net.minecraft.client.font.TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer;
|
|
||||||
|
|
||||||
// Calculate the horizontal offset to center the text
|
|
||||||
float textWidth = (float) (-textRenderer.getWidth(text)) / 2.0F;
|
|
||||||
|
|
||||||
// Determine the background opacity
|
|
||||||
int backgroundOpacity = (int) (MinecraftClient.getInstance().options.getTextBackgroundOpacity(0.25F)
|
|
||||||
* 255.0F) << 24;
|
|
||||||
|
|
||||||
// Render the text with a background
|
|
||||||
textRenderer.draw(text, textWidth, 0, -2130706433, false, matrix4f, vertexConsumers,
|
|
||||||
net.minecraft.client.font.TextRenderer.TextLayerType.SEE_THROUGH, backgroundOpacity, light);
|
|
||||||
|
|
||||||
// Render the text without a background if not sneaking
|
|
||||||
textRenderer.draw(text, textWidth, 0, -1, false, matrix4f, vertexConsumers,
|
|
||||||
net.minecraft.client.font.TextRenderer.TextLayerType.NORMAL, 0,
|
|
||||||
LightmapTextureManager.applyEmission(light, 2));
|
|
||||||
|
|
||||||
// Pop the matrix stack to restore the previous state
|
|
||||||
matrices.pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void renderBadgeIcon(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) {
|
|
||||||
float size = .5f;
|
|
||||||
Matrix4f matrix = matrices.peek().getPositionMatrix();
|
|
||||||
VertexConsumer vertexConsumer = vertexConsumers
|
|
||||||
.getBuffer(RenderLayer.getEntityTranslucent(BADGE_TEXTURE));
|
|
||||||
|
|
||||||
// Apply rotation to make the icon face the camera
|
|
||||||
Quaternionf rotation = dispatcher.camera.getRotation();
|
|
||||||
matrices.multiply(rotation);
|
|
||||||
|
|
||||||
vertexConsumer.vertex(matrix, -size, -size, 0).color(255, 255, 255, 255).texture(0, 0).light(light)
|
|
||||||
.overlay(OverlayTexture.DEFAULT_UV).normal(0, 0, 1);
|
|
||||||
vertexConsumer.vertex(matrix, size, -size, 0).color(255, 255, 255, 255).texture(1, 0).light(light)
|
|
||||||
.overlay(OverlayTexture.DEFAULT_UV).normal(0, 0, 1);
|
|
||||||
vertexConsumer.vertex(matrix, size, size, 0).color(255, 255, 255, 255).texture(1, 1).light(light)
|
|
||||||
.overlay(OverlayTexture.DEFAULT_UV).normal(0, 0, 1);
|
|
||||||
vertexConsumer.vertex(matrix, -size, size, 0).color(255, 255, 255, 255).texture(0, 1).light(light)
|
|
||||||
.overlay(OverlayTexture.DEFAULT_UV).normal(0, 0, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,158 @@
|
|||||||
|
package org.auraclient.auraclient.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
import net.minecraft.client.font.TextRenderer;
|
||||||
|
import net.minecraft.client.font.TextRenderer.TextLayerType;
|
||||||
|
import net.minecraft.client.render.OverlayTexture;
|
||||||
|
import net.minecraft.client.render.RenderLayer;
|
||||||
|
import net.minecraft.client.render.VertexConsumer;
|
||||||
|
import net.minecraft.client.render.VertexConsumerProvider;
|
||||||
|
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
||||||
|
import net.minecraft.client.render.entity.EntityRenderer;
|
||||||
|
import net.minecraft.client.render.entity.state.EntityRenderState;
|
||||||
|
import net.minecraft.client.render.entity.state.PlayerEntityRenderState;
|
||||||
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import net.minecraft.client.render.LightmapTextureManager;
|
||||||
|
|
||||||
|
import org.joml.Matrix4f;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|
||||||
|
@Mixin(EntityRenderer.class)
|
||||||
|
public abstract class NameTagMixin<S extends EntityRenderState> {
|
||||||
|
private static final Identifier BADGE_TEXTURE = Identifier.of("auraclient", "textures/player-badge.png");
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public EntityRenderDispatcher dispatcher;
|
||||||
|
|
||||||
|
@Overwrite
|
||||||
|
public void renderLabelIfPresent(S state, Text text, MatrixStack matrices,
|
||||||
|
VertexConsumerProvider vertexConsumers, int light) {
|
||||||
|
if (state instanceof PlayerEntityRenderState) {
|
||||||
|
matrices.push();
|
||||||
|
|
||||||
|
matrices.translate(0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
|
double y = state.nameLabelPos.y;
|
||||||
|
|
||||||
|
renderTextAtOrigin(y, text, matrices, vertexConsumers, light);
|
||||||
|
|
||||||
|
matrices.pop();
|
||||||
|
} else {
|
||||||
|
Vec3d vec3d = state.nameLabelPos;
|
||||||
|
if (vec3d != null) {
|
||||||
|
boolean bl = !state.sneaking;
|
||||||
|
int i = "deadmau5".equals(text.getString()) ? -10 : 0;
|
||||||
|
matrices.push();
|
||||||
|
matrices.translate(vec3d.x, vec3d.y + 0.5, vec3d.z);
|
||||||
|
matrices.multiply(this.dispatcher.getRotation());
|
||||||
|
matrices.scale(0.025F, -0.025F, 0.025F);
|
||||||
|
Matrix4f matrix4f = matrices.peek().getPositionMatrix();
|
||||||
|
TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer;
|
||||||
|
float f = (float) (-textRenderer.getWidth(text)) / 2.0F;
|
||||||
|
int j = (int) (MinecraftClient.getInstance().options.getTextBackgroundOpacity(0.25F) * 255.0F) << 24;
|
||||||
|
textRenderer.draw(text, f, (float) i, -2130706433, false, matrix4f, vertexConsumers,
|
||||||
|
bl ? TextLayerType.SEE_THROUGH : TextLayerType.NORMAL, j, light);
|
||||||
|
if (bl) {
|
||||||
|
textRenderer.draw(text, f, (float) i, -1, false, matrix4f, vertexConsumers, TextLayerType.NORMAL, 0,
|
||||||
|
LightmapTextureManager.applyEmission(light, 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
matrices.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderTextAtOrigin(double y, Text text, MatrixStack matrices,
|
||||||
|
VertexConsumerProvider vertexConsumers, int light) {
|
||||||
|
matrices.push();
|
||||||
|
|
||||||
|
// Move up slightly
|
||||||
|
matrices.translate(0.0f, y + 0.5f, 0.0f);
|
||||||
|
|
||||||
|
// Apply rotation to face the camera
|
||||||
|
matrices.multiply(dispatcher.getRotation());
|
||||||
|
|
||||||
|
// Scale text and badge to a readable size
|
||||||
|
matrices.scale(0.025F, -0.025F, 0.025F);
|
||||||
|
|
||||||
|
// Offset the text to avoid Z-fighting
|
||||||
|
matrices.translate(0.0F, 0.0F, -0.01F);
|
||||||
|
|
||||||
|
Matrix4f matrix4f = matrices.peek().getPositionMatrix();
|
||||||
|
net.minecraft.client.font.TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer;
|
||||||
|
|
||||||
|
float textWidth = textRenderer.getWidth(text);
|
||||||
|
float badgeSize = textWidth * 0.20f;
|
||||||
|
float totalWidth = textWidth + badgeSize + 6;
|
||||||
|
|
||||||
|
// Adjust text position to make space for badge
|
||||||
|
float xStart = -totalWidth / 2 + badgeSize;
|
||||||
|
|
||||||
|
// Draw a single background behind both text and badge
|
||||||
|
drawBackground(matrices, vertexConsumers, -totalWidth / 2 - 4, -1.5f, totalWidth, 10, 0x55000000);
|
||||||
|
|
||||||
|
// Render Badge
|
||||||
|
renderBadgeIcon(matrices, vertexConsumers, xStart - badgeSize + 1, 3.4f, badgeSize);
|
||||||
|
|
||||||
|
// Render Text with adjusted layer
|
||||||
|
textRenderer.draw(text, xStart, 0, -1, false, matrix4f, vertexConsumers,
|
||||||
|
net.minecraft.client.font.TextRenderer.TextLayerType.SEE_THROUGH, 0,
|
||||||
|
LightmapTextureManager.applyEmission(light, 2));
|
||||||
|
|
||||||
|
matrices.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draws a single background behind both text and badge.
|
||||||
|
*/
|
||||||
|
private void drawBackground(MatrixStack matrices, VertexConsumerProvider vertexConsumers,
|
||||||
|
float x, float y, float width, float height, int color) {
|
||||||
|
Matrix4f matrix = matrices.peek().getPositionMatrix();
|
||||||
|
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getTextBackgroundSeeThrough());
|
||||||
|
|
||||||
|
int a = (color >> 24) & 255; // Alpha
|
||||||
|
int r = (color >> 16) & 255; // Red
|
||||||
|
int g = (color >> 8) & 255; // Green
|
||||||
|
int b = color & 255; // Blue
|
||||||
|
|
||||||
|
vertexConsumer.vertex(matrix, x, y + height, 0).color(r, g, b, a).texture(0, 1).light(0xF000F0)
|
||||||
|
.overlay(OverlayTexture.DEFAULT_UV).normal(0, 0, 1);
|
||||||
|
vertexConsumer.vertex(matrix, x + width, y + height, 0).color(r, g, b, a).texture(1, 1).light(0xF000F0)
|
||||||
|
.overlay(OverlayTexture.DEFAULT_UV).normal(0, 0, 1);
|
||||||
|
vertexConsumer.vertex(matrix, x + width, y, 0).color(r, g, b, a).texture(1, 0).light(0xF000F0)
|
||||||
|
.overlay(OverlayTexture.DEFAULT_UV).normal(0, 0, 1);
|
||||||
|
vertexConsumer.vertex(matrix, x, y, 0).color(r, g, b, a).texture(0, 0).light(0xF000F0)
|
||||||
|
.overlay(OverlayTexture.DEFAULT_UV).normal(0, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderBadgeIcon(MatrixStack matrices, VertexConsumerProvider vertexConsumers, float x,
|
||||||
|
float y, float size) {
|
||||||
|
matrices.push();
|
||||||
|
|
||||||
|
// Position badge correctly
|
||||||
|
matrices.translate(x, y, 0);
|
||||||
|
matrices.scale(size, size, size); // Scale properly
|
||||||
|
|
||||||
|
Matrix4f matrix = matrices.peek().getPositionMatrix();
|
||||||
|
VertexConsumer vertexConsumer = vertexConsumers
|
||||||
|
.getBuffer(RenderLayer.getEntityTranslucent(BADGE_TEXTURE));
|
||||||
|
|
||||||
|
int fullBright = LightmapTextureManager.MAX_LIGHT_COORDINATE;
|
||||||
|
|
||||||
|
vertexConsumer.vertex(matrix, -0.5f, -0.5f, 0).color(255, 255, 255, 255).texture(0, 0).light(fullBright)
|
||||||
|
.overlay(OverlayTexture.DEFAULT_UV).normal(0, 0, 1);
|
||||||
|
vertexConsumer.vertex(matrix, 0.5f, -0.5f, 0).color(255, 255, 255, 255).texture(1, 0).light(fullBright)
|
||||||
|
.overlay(OverlayTexture.DEFAULT_UV).normal(0, 0, 1);
|
||||||
|
vertexConsumer.vertex(matrix, 0.5f, 0.5f, 0).color(255, 255, 255, 255).texture(1, 1).light(fullBright)
|
||||||
|
.overlay(OverlayTexture.DEFAULT_UV).normal(0, 0, 1);
|
||||||
|
vertexConsumer.vertex(matrix, -0.5f, 0.5f, 0).color(255, 255, 255, 255).texture(0, 1).light(fullBright)
|
||||||
|
.overlay(OverlayTexture.DEFAULT_UV).normal(0, 0, 1);
|
||||||
|
|
||||||
|
matrices.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package org.auraclient.auraclient.widgets;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
|
||||||
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
import net.minecraft.client.gui.DrawContext;
|
||||||
|
import net.minecraft.client.gui.screen.ButtonTextures;
|
||||||
|
import net.minecraft.client.gui.widget.TextWidget;
|
||||||
|
import net.minecraft.client.gui.widget.TexturedButtonWidget;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
public class AuraButton extends TexturedButtonWidget {
|
||||||
|
private TextWidget textWidget;
|
||||||
|
private static final ButtonTextures BUTTON_TEXTURES = new ButtonTextures(
|
||||||
|
Identifier.ofVanilla("widget/aura_button"), Identifier.ofVanilla("widget/aura_button_disabled"),
|
||||||
|
Identifier.ofVanilla("widget/aura_button_highlighted"));
|
||||||
|
|
||||||
|
public AuraButton(Text message, PressAction onPress, int x, int y, int width, int height) {
|
||||||
|
super(x, y, width, height, BUTTON_TEXTURES, onPress);
|
||||||
|
|
||||||
|
setMessage(message);
|
||||||
|
|
||||||
|
textWidget = new TextWidget(message,
|
||||||
|
MinecraftClient.getInstance().textRenderer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||||
|
super.renderWidget(context, mouseX, mouseY, delta);
|
||||||
|
|
||||||
|
context.drawText(MinecraftClient.getInstance().textRenderer, getMessage(),
|
||||||
|
getX() + (getWidth() - textWidget.getWidth()) / 2,
|
||||||
|
1 + getY() + (getHeight() - textWidget.getHeight()) / 2,
|
||||||
|
Color.WHITE.getRGB(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 391 B After Width: | Height: | Size: 391 B |
|
Before Width: | Height: | Size: 494 B After Width: | Height: | Size: 494 B |
|
Before Width: | Height: | Size: 494 B After Width: | Height: | Size: 494 B |
@@ -3,7 +3,7 @@
|
|||||||
"minVersion": "0.8",
|
"minVersion": "0.8",
|
||||||
"package": "org.auraclient.auraclient.mixin",
|
"package": "org.auraclient.auraclient.mixin",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"client": ["AbstractClientPlayerEntityMixin", "EntityRendererMixin"],
|
"client": ["AbstractClientPlayerEntityMixin", "NameTagMixin"],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
}
|
}
|
||||||
|
|||||||