diff --git a/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java b/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java index 6954718db..a9d57d78f 100644 --- a/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java +++ b/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java @@ -240,7 +240,7 @@ public class CableBlockEntity extends BlockEntity new TranslatableText("techreborn.tooltip.transferRate") .formatted(Formatting.GRAY) .append(": ") - .append(PowerSystem.getLocaliszedPowerFormatted(getCableType().transferRate)) + .append(PowerSystem.getLocalizedPower(getCableType().transferRate)) .formatted(Formatting.GOLD) .append("/t") ); diff --git a/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java b/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java index 7915b821b..85d10a30b 100644 --- a/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java @@ -226,7 +226,7 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I .formatted(Formatting.GRAY) .append(": ") .append( - new LiteralText(PowerSystem.getLocaliszedPowerFormatted(getMaxStoredPower())) + new LiteralText(PowerSystem.getLocalizedPower(getMaxStoredPower())) .formatted(Formatting.GOLD) ) ); @@ -236,7 +236,7 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I .formatted(Formatting.GRAY) .append(": ") .append( - new LiteralText(PowerSystem.getLocaliszedPowerFormatted(panel.generationRateD)) + new LiteralText(PowerSystem.getLocalizedPower(panel.generationRateD)) .formatted(Formatting.GOLD) ) ); @@ -246,7 +246,7 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I .formatted(Formatting.GRAY) .append(": ") .append( - new LiteralText(PowerSystem.getLocaliszedPowerFormatted(panel.generationRateN)) + new LiteralText(PowerSystem.getLocalizedPower(panel.generationRateN)) .formatted(Formatting.GOLD) ) ); diff --git a/src/main/java/techreborn/blockentity/transformers/TransformerBlockEntity.java b/src/main/java/techreborn/blockentity/transformers/TransformerBlockEntity.java index eb04a49ce..94027c9c5 100644 --- a/src/main/java/techreborn/blockentity/transformers/TransformerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/transformers/TransformerBlockEntity.java @@ -141,12 +141,12 @@ public class TransformerBlockEntity extends PowerAcceptorBlockEntity implements } // IListInfoProvider - // TO-DO: translate + // TODO: translate @Override public void addInfo(List info, boolean isReal, boolean hasData) { - info.add(new LiteralText(Formatting.GRAY + "Input Rate: " + Formatting.GOLD + PowerSystem.getLocaliszedPowerFormatted((int) getMaxInput(EnergySide.UNKNOWN)))); + info.add(new LiteralText(Formatting.GRAY + "Input Rate: " + Formatting.GOLD + PowerSystem.getLocalizedPower(getMaxInput(EnergySide.UNKNOWN)))); info.add(new LiteralText(Formatting.GRAY + "Input Tier: " + Formatting.GOLD + StringUtils.toFirstCapitalAllLowercase(inputTier.toString()))); - info.add(new LiteralText(Formatting.GRAY + "Output Rate: " + Formatting.GOLD + PowerSystem.getLocaliszedPowerFormatted((int) getMaxOutput(EnergySide.UNKNOWN)))); + info.add(new LiteralText(Formatting.GRAY + "Output Rate: " + Formatting.GOLD + PowerSystem.getLocalizedPower(getMaxOutput(EnergySide.UNKNOWN)))); info.add(new LiteralText(Formatting.GRAY + "Output Tier: " + Formatting.GOLD + StringUtils.toFirstCapitalAllLowercase(outputTier.toString()))); } } diff --git a/src/main/java/techreborn/client/gui/GuiAESU.java b/src/main/java/techreborn/client/gui/GuiAESU.java index 74d68e2b4..6704a53ce 100644 --- a/src/main/java/techreborn/client/gui/GuiAESU.java +++ b/src/main/java/techreborn/client/gui/GuiAESU.java @@ -76,9 +76,9 @@ public class GuiAESU extends GuiBase { if (!hideGuiElements()) { RenderSystem.pushMatrix(); RenderSystem.scaled(0.6, 0.6, 1); - Text text = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy())) + Text text = new LiteralText(PowerSystem.getLocalizedPowerNoSuffix((int) blockEntity.getEnergy())) .append("/") - .append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getMaxStoredPower())) + .append(PowerSystem.getLocalizedPowerNoSuffix((int) blockEntity.getMaxStoredPower())) .append(" ") .append(PowerSystem.getDisplayPower().abbreviation); diff --git a/src/main/java/techreborn/client/gui/GuiBatbox.java b/src/main/java/techreborn/client/gui/GuiBatbox.java index 2bf4e5fb4..e1a1004e0 100644 --- a/src/main/java/techreborn/client/gui/GuiBatbox.java +++ b/src/main/java/techreborn/client/gui/GuiBatbox.java @@ -60,9 +60,9 @@ public class GuiBatbox extends GuiBase { if (!hideGuiElements()) { RenderSystem.pushMatrix(); RenderSystem.scaled(0.6, 0.6, 5); - Text text = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy())) + Text text = new LiteralText(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getEnergy())) .append("/") - .append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getMaxStoredPower())) + .append(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getMaxStoredPower())) .append(" ") .append(PowerSystem.getDisplayPower().abbreviation); diff --git a/src/main/java/techreborn/client/gui/GuiFusionReactor.java b/src/main/java/techreborn/client/gui/GuiFusionReactor.java index 2dd97f7a5..22d43e882 100644 --- a/src/main/java/techreborn/client/gui/GuiFusionReactor.java +++ b/src/main/java/techreborn/client/gui/GuiFusionReactor.java @@ -89,7 +89,7 @@ public class GuiFusionReactor extends GuiBase { addHologramButton(6, 4, 212, layer).clickHandler(this::hologramToggle); drawCentredText(matrixStack, blockEntity.getStateText(), 20, Color.BLUE.darker().getColor(), layer); if (blockEntity.state == 2) { - drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocaliszedPowerFormatted((int) blockEntity.getPowerChange())).append("/t"), 30, Color.GREEN.darker().getColor(), layer); + drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocalizedPower(blockEntity.getPowerChange())).append("/t"), 30, Color.GREEN.darker().getColor(), layer); } } else { builder.drawMultiblockMissingBar(matrixStack, this, layer); diff --git a/src/main/java/techreborn/client/gui/GuiIDSU.java b/src/main/java/techreborn/client/gui/GuiIDSU.java index 1e21de43e..44a1bf871 100644 --- a/src/main/java/techreborn/client/gui/GuiIDSU.java +++ b/src/main/java/techreborn/client/gui/GuiIDSU.java @@ -61,9 +61,9 @@ public class GuiIDSU extends GuiBase { RenderSystem.pushMatrix(); RenderSystem.scaled(0.6, 0.6, 1); - Text text = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) idsu.getEnergy())) + Text text = new LiteralText(PowerSystem.getLocalizedPowerNoSuffix(idsu.getEnergy())) .append("/") - .append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) idsu.getMaxStoredPower())) + .append(PowerSystem.getLocalizedPowerNoSuffix(idsu.getMaxStoredPower())) .append(" ") .append(PowerSystem.getDisplayPower().abbreviation); diff --git a/src/main/java/techreborn/client/gui/GuiLESU.java b/src/main/java/techreborn/client/gui/GuiLESU.java index 7de9e8062..b6a9a017b 100644 --- a/src/main/java/techreborn/client/gui/GuiLESU.java +++ b/src/main/java/techreborn/client/gui/GuiLESU.java @@ -24,7 +24,6 @@ package techreborn.client.gui; -import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.LiteralText; @@ -57,12 +56,15 @@ public class GuiLESU extends GuiBase { super.drawForeground(matrixStack, mouseX, mouseY); final Layer layer = Layer.FOREGROUND; - RenderSystem.pushMatrix(); - RenderSystem.scaled(0.6, 0.6, 1); - drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy()) + "/" - + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getMaxStoredPower()) + " " - + PowerSystem.getDisplayPower().abbreviation), 35, 0, 58, layer); - RenderSystem.popMatrix(); + matrixStack.push(); + matrixStack.scale(0.6f, 0.6f, 1.0f); + drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocalizedPowerNoSuffix( blockEntity.getEnergy())) + .append("/") + .append(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getMaxStoredPower())) + .append(" ") + .append(PowerSystem.getDisplayPower().abbreviation), + 35, 0, 58, layer); + matrixStack.pop(); builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer); } diff --git a/src/main/java/techreborn/client/gui/GuiMFE.java b/src/main/java/techreborn/client/gui/GuiMFE.java index e201715ad..207521dd3 100644 --- a/src/main/java/techreborn/client/gui/GuiMFE.java +++ b/src/main/java/techreborn/client/gui/GuiMFE.java @@ -61,9 +61,9 @@ public class GuiMFE extends GuiBase { RenderSystem.pushMatrix(); RenderSystem.scaled(0.6, 0.6, 1); - drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfe.getEnergy())) + drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocalizedPowerNoSuffix(mfe.getEnergy())) .append("/") - .append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfe.getMaxStoredPower())) + .append(PowerSystem.getLocalizedPowerNoSuffix(mfe.getMaxStoredPower())) .append(" ") .append(PowerSystem.getDisplayPower().abbreviation) , 35, 0, 58, layer); diff --git a/src/main/java/techreborn/client/gui/GuiMFSU.java b/src/main/java/techreborn/client/gui/GuiMFSU.java index 05563e267..695aa4a67 100644 --- a/src/main/java/techreborn/client/gui/GuiMFSU.java +++ b/src/main/java/techreborn/client/gui/GuiMFSU.java @@ -59,7 +59,7 @@ public class GuiMFSU extends GuiBase { RenderSystem.pushMatrix(); RenderSystem.scaled(0.6, 0.6, 1); - drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfsu.getEnergy()) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfsu.getMaxStoredPower()) + " " + PowerSystem.getDisplayPower().abbreviation), 35, 0, 58, layer); + drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocalizedPowerNoSuffix(mfsu.getEnergy()) + "/" + PowerSystem.getLocalizedPowerNoSuffix(mfsu.getMaxStoredPower()) + " " + PowerSystem.getDisplayPower().abbreviation), 35, 0, 58, layer); RenderSystem.popMatrix(); builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) mfsu.getEnergy(), (int) mfsu.getMaxStoredPower(), mouseX, mouseY, 0, layer); diff --git a/src/main/java/techreborn/events/StackToolTipHandler.java b/src/main/java/techreborn/events/StackToolTipHandler.java index ce43a095c..3060bb794 100644 --- a/src/main/java/techreborn/events/StackToolTipHandler.java +++ b/src/main/java/techreborn/events/StackToolTipHandler.java @@ -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 { diff --git a/src/main/java/techreborn/items/tool/DebugToolItem.java b/src/main/java/techreborn/items/tool/DebugToolItem.java index 61adba76f..c07d6cd8a 100644 --- a/src/main/java/techreborn/items/tool/DebugToolItem.java +++ b/src/main/java/techreborn/items/tool/DebugToolItem.java @@ -113,9 +113,9 @@ public class DebugToolItem extends Item { String s = "" + Formatting.GREEN; s += "Power: "; s += Formatting.BLUE; - s += PowerSystem.getLocaliszedPower(Energy.of(blockEntity).getEnergy()); + s += PowerSystem.getLocalizedPower(Energy.of(blockEntity).getEnergy()); s += "/"; - s += PowerSystem.getLocaliszedPower(Energy.of(blockEntity).getMaxStored()); + s += PowerSystem.getLocalizedPower(Energy.of(blockEntity).getMaxStored()); return s; }