the minecraft function private void componentHoverEffect(final Font font, final Style hoveredStyle, final int xMouse, final int yMouse) has changed in the version 26.1 . previously the parameter was nullable but in the latest version they made it non nullable.
the LabelComponent however has this draw tooltip function with style function returning nulls
@Override
public void drawTooltip(OwoUIGraphics context, int mouseX, int mouseY, float partialTicks, float delta) {
super.drawTooltip(context, mouseX, mouseY, partialTicks, delta);
context.componentHoverEffect(this.textRenderer, this.styleAt(mouseX - this.x, mouseY - this.y), mouseX, mouseY);
}
@Nullable
protected Style styleAt(int mouseX, int mouseY) {
var clickHandler = new RawLabel.Instance.StyleCollector(this.textRenderer, this.x + mouseX, this.y + mouseY);
this.drawText((renderX, renderY, text, $, $$) -> clickHandler.accept(renderX, renderY, text));
return clickHandler.result();
}
this causes the game to crash because of Null error when you hover over label but only if you hover over empty area of the label component.
for example
if the label has width of 100 but text doesn't need that much space, if you hover over text it works fine but if you hover over empty label area you get null error because there is no text to style at the given location.
the minecraft function
private void componentHoverEffect(final Font font, final Style hoveredStyle, final int xMouse, final int yMouse)has changed in the version26.1. previously the parameter was nullable but in the latest version they made it non nullable.the LabelComponent however has this draw tooltip function with style function returning nulls
this causes the game to crash because of Null error when you hover over label but only if you hover over empty area of the label component.
for example
if the label has width of 100 but text doesn't need that much space, if you hover over text it works fine but if you hover over empty label area you get null error because there is no text to style at the given location.