空字符串不渲染

This commit is contained in:
Color_yr committed 2026-06-27 17:21:33 +08:00
1 parent 8643af0966
commit 2a410060b9
17 files changed
+72

No files matched your search

@@ -71,6 +71,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
Font font = Minecraft.getInstance().font;
Component component = MiniMessage.parse(text);
if (font.width(component) == 0) {
return;
}
int width;
if (shadow) {
@@ -75,6 +75,11 @@ public class CoreRenderTarget extends TextFrameBuffer {
var font = Minecraft.getInstance().font;
Component component = MiniMessage.parse(text);
if (font.width(component) == 0) {
return;
}
int width = font.drawInBatch(component, 0, y, color, shadow, new Matrix4f(), renderBuffers.bufferSource(), Font.DisplayMode.NORMAL, 0, 15728880);
RenderSystem.disableDepthTest();
renderBuffers.bufferSource().endBatch();
@@ -75,6 +75,11 @@ public class CoreRenderTarget extends TextFrameBuffer {
var font = Minecraft.getInstance().font;
Component component = MiniMessage.parse(text);
if (font.width(component) == 0) {
return;
}
int width = font.drawInBatch(component, 0, y, color, shadow, new Matrix4f(), renderBuffers.bufferSource(), Font.DisplayMode.NORMAL, 0, 15728880);
RenderSystem.disableDepthTest();
renderBuffers.bufferSource().endBatch();
@@ -95,6 +95,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
Component component = MiniMessage.parse(text);
int width = font.width(component.getVisualOrderText());
if (width == 0) {
return;
}
int i = (int) minecraft.mouseHandler.getScaledXPos(window);
int j = (int) minecraft.mouseHandler.getScaledYPos(window);
@@ -63,6 +63,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
Component component = MiniMessage.parse(text);
Font font = Minecraft.getInstance().font;
int width = font.width(component);
if (width == 0) {
return;
}
int height = font.lineHeight + (shadow ? 1 : 0);
if (isState) {
y = 0;
@@ -63,6 +63,11 @@ public class CoreRenderTarget extends TextFrameBuffer {
Component component = MiniMessage.parse(text);
Font font = Minecraft.getInstance().font;
int width = font.width(component);
if (width == 0) {
return;
}
int height = font.lineHeight + (shadow ? 1 : 0);
if (isState) {
y = 0;
@@ -92,6 +92,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
Component component = MiniMessage.parse(text);
int width = font.width(component.getVisualOrderText());
if (width == 0) {
return;
}
GuiGraphics graphics = new GuiGraphics(Minecraft.getInstance(), renderState);
color = color | 0xFF000000;
graphics.drawString(font, component, 0, y, color, shadow);
@@ -96,6 +96,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
Component component = MiniMessage.parse(text);
int width = font.width(component.getVisualOrderText());
if (width == 0) {
return;
}
int i = (int) minecraft.mouseHandler.getScaledXPos(window);
int j = (int) minecraft.mouseHandler.getScaledYPos(window);
@@ -83,6 +83,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
Component component = MiniMessage.parse(text);
int width = font.width(component.getVisualOrderText());
if (width == 0) {
return;
}
int i = (int) minecraft.mouseHandler.getScaledXPos(window);
int j = (int) minecraft.mouseHandler.getScaledYPos(window);
@@ -71,6 +71,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
Font font = Minecraft.getInstance().font;
Component component = MiniMessage.parse(text);
if (font.width(component) == 0) {
return;
}
int width;
if (shadow) {
@@ -75,6 +75,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
var font = Minecraft.getInstance().font;
Component component = MiniMessage.parse(text);
if (font.width(component) == 0) {
return;
}
int width = font.drawInBatch(component, 0, y, color, shadow, new Matrix4f(), renderBuffers.bufferSource(), Font.DisplayMode.NORMAL, 0, 15728880);
RenderSystem.disableDepthTest();
renderBuffers.bufferSource().endBatch();
@@ -75,6 +75,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
var font = Minecraft.getInstance().font;
Component component = MiniMessage.parse(text);
if (font.width(component) == 0) {
return;
}
int width = font.drawInBatch(component, 0, y, color, shadow, new Matrix4f(), renderBuffers.bufferSource(), Font.DisplayMode.NORMAL, 0, 15728880);
RenderSystem.disableDepthTest();
renderBuffers.bufferSource().endBatch();
@@ -95,6 +95,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
Component component = MiniMessage.parse(text);
int width = font.width(component.getVisualOrderText());
if (width == 0) {
return;
}
int i = (int) minecraft.mouseHandler.getScaledXPos(window);
int j = (int) minecraft.mouseHandler.getScaledYPos(window);
@@ -63,6 +63,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
Component component = MiniMessage.parse(text);
Font font = Minecraft.getInstance().font;
int width = font.width(component);
if (width == 0) {
return;
}
int height = font.lineHeight + (shadow ? 1 : 0);
if (isState) {
y = 0;
@@ -63,6 +63,11 @@ public class CoreRenderTarget extends TextFrameBuffer {
Component component = MiniMessage.parse(text);
Font font = Minecraft.getInstance().font;
int width = font.width(component);
if (width == 0) {
return;
}
int height = font.lineHeight + (shadow ? 1 : 0);
if (isState) {
y = 0;
@@ -92,6 +92,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
Component component = MiniMessage.parse(text);
int width = font.width(component.getVisualOrderText());
if (width == 0) {
return;
}
GuiGraphics graphics = new GuiGraphics(Minecraft.getInstance(), renderState);
color = color | 0xFF000000;
graphics.drawString(font, component, 0, y, color, shadow);
@@ -84,6 +84,10 @@ public class CoreRenderTarget extends TextFrameBuffer {
Component component = MiniMessage.parse(text);
int width = font.width(component.getVisualOrderText());
if (width == 0) {
return;
}
int i = (int) minecraft.mouseHandler.getScaledXPos(window);
int j = (int) minecraft.mouseHandler.getScaledYPos(window);