Fix tooltip

This commit is contained in:
drcrazy 2020-10-24 00:30:37 +03:00
parent 342917851b
commit ca24d58f86
12 changed files with 31 additions and 29 deletions

View file

@ -100,9 +100,9 @@ public class StackToolTipHandler implements ItemTooltipCallback {
if (item instanceof IListInfoProvider) {
((IListInfoProvider) item).addInfo(components, false, false);
} else if (stack.getItem() instanceof EnergyHolder) {
LiteralText line1 = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix(Energy.of(stack).getEnergy()));
LiteralText line1 = new LiteralText(PowerSystem.getLocalizedPowerNoSuffix(Energy.of(stack).getEnergy()));
line1.append("/");
line1.append(PowerSystem.getLocaliszedPowerFormattedNoSuffix(Energy.of(stack).getMaxStored()));
line1.append(PowerSystem.getLocalizedPowerNoSuffix(Energy.of(stack).getMaxStored()));
line1.append(" ");
line1.append(PowerSystem.getDisplayPower().abbreviation);
line1.formatted(Formatting.GOLD);
@ -114,7 +114,7 @@ public class StackToolTipHandler implements ItemTooltipCallback {
Formatting color = StringUtils.getPercentageColour(percentage);
components.add(2, new LiteralText(color + "" + percentage + "%" + Formatting.GRAY + " Charged"));
// TODO: show both input and output rates
components.add(3, new LiteralText(Formatting.GRAY + "I/O Rate: " + Formatting.GOLD + PowerSystem.getLocaliszedPowerFormatted(((EnergyHolder) item).getMaxInput(EnergySide.UNKNOWN))));
components.add(3, new LiteralText(Formatting.GRAY + "I/O Rate: " + Formatting.GOLD + PowerSystem.getLocalizedPower(((EnergyHolder) item).getMaxInput(EnergySide.UNKNOWN))));
}
} else {
try {