mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Re-enable the text rendering on the energy display
Make getOverlayText return a Component instead of Component -> getString -> Component.literal
This commit is contained in:
parent
f1c7b2491e
commit
83828a6def
1 changed files with 5 additions and 6 deletions
|
@ -71,7 +71,7 @@ public class EnergyDisplay {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.drawTextNextTo) {
|
if (this.drawTextNextTo) {
|
||||||
//this.drawString(mc.font, this.getOverlayText(), barX + 25, barY + 78, StringUtil.DECIMAL_COLOR_WHITE);
|
guiGraphics.drawString(mc.font, this.getOverlayText(), barX + 25, barY + 78, 0xFFFFFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,8 +80,8 @@ public class EnergyDisplay {
|
||||||
Minecraft mc = Minecraft.getInstance();
|
Minecraft mc = Minecraft.getInstance();
|
||||||
|
|
||||||
List<Component> text = new ArrayList<>();
|
List<Component> text = new ArrayList<>();
|
||||||
text.add(Component.literal(this.getOverlayText()));
|
text.add(this.getOverlayText());
|
||||||
guiGraphics.renderComponentTooltip(mc.font, text, mouseX, mouseY); //TODO: Check if this is correct, used to call GuiUtils.drawHoveringText
|
guiGraphics.renderComponentTooltip(mc.font, text, mouseX, mouseY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,11 +93,10 @@ public class EnergyDisplay {
|
||||||
: 85);
|
: 85);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getOverlayText() {
|
private Component getOverlayText() {
|
||||||
NumberFormat format = NumberFormat.getInstance();
|
NumberFormat format = NumberFormat.getInstance();
|
||||||
return Component.translatable("misc.actuallyadditions.power_long",
|
return Component.translatable("misc.actuallyadditions.power_long",
|
||||||
format.format(this.rfReference.getEnergyStored()),
|
format.format(this.rfReference.getEnergyStored()),
|
||||||
format.format(this.rfReference.getMaxEnergyStored()))
|
format.format(this.rfReference.getMaxEnergyStored()));
|
||||||
.getString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue