Public Release

This commit is contained in:
Moulberry committed 2024-08-24 04:41:01 +08:00
1 parent 666398e480
commit 61bb497a22
126 files changed
+8435 -1240

No files matched your search

@@ -7,11 +7,18 @@ import net.minecraft.network.chat.Component;
public class BottomTextWidget extends AbstractStringWidget {
public float horizontalAlignment = 0.5f;
public BottomTextWidget(int width, int height, Component component, Font font) {
super(0, 0, width, height, component, font);
this.active = false;
}
public BottomTextWidget alignLeft() {
this.horizontalAlignment = 0.0f;
return this;
}
public void renderWidget(GuiGraphics guiGraphics, int i, int j, float f) {
Component component = this.getMessage();
@@ -19,7 +26,7 @@ public class BottomTextWidget extends AbstractStringWidget {
int width = this.getWidth();
int textWidth = font.width(component);
int x = this.getX() + Math.round((width - textWidth)/2.0f);
int x = this.getX() + Math.round((width - textWidth) * this.horizontalAlignment);
int y = this.getY() + this.getHeight() - this.getFont().lineHeight + 1;
guiGraphics.drawString(font, component.getVisualOrderText(), x, y, this.getColor());