Skip to content

Commit 95959a2

Browse files
committed
fix: fixed infinite power display
1 parent ecd4293 commit 95959a2

7 files changed

Lines changed: 5 additions & 7 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// 1.21.1 2025-01-03T14:02:03.414186833 Languages: en_us for mod: chargers
2-
b13b7ead81351fb83eba4ff6bec401e6905d2c32 assets/chargers/lang/en_us.json
1+
// 1.21.1 2025-01-20T20:48:06.0097864 Languages: en_us for mod: chargers
2+
d58199e22345e15cbb3b2b7a5586eaa4d9a67963 assets/chargers/lang/en_us.json

src/generated/resources/assets/chargers/lang/en_us.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"chargers.gui.io.more": "Hold shift for more I/O details",
2727
"chargers.gui.max_in": "Max In: %s",
2828
"chargers.gui.max_out": "Max Out: %s",
29-
"chargers.misc.energy.infinite": "∞ %s",
3029
"chargers.misc.power.info": "Power: %s",
3130
"chargers.tooltip.wireless_charger": "Can be disabled with redstone power",
3231
"itemGroup.chargers.chargers": "Chargers",

src/main/java/se/gory_moon/chargers/EnergyFormatting.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class EnergyFormatting {
1717
public static Component FE_TICK = FE.copy().append(SLASH).append(Component.literal("t").withStyle(ChatFormatting.DARK_AQUA));
1818
public static Component POSITIVE = Component.literal("+").withStyle(ChatFormatting.GREEN);
1919
public static Component NEGATIVE = Component.literal("-").withStyle(ChatFormatting.RED);
20+
public static Component INFINITE = Component.literal("∞").withStyle(ChatFormatting.WHITE).append(FE);
2021

2122
public static Component formatAndClean(long number) {
2223
return Component.literal(new DecimalFormat().format(number)).withStyle(ChatFormatting.WHITE);

src/main/java/se/gory_moon/chargers/LangKeys.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ public enum LangKeys {
66
CHAT_DISABLED("chat.disabled"),
77

88
POWER_INFO("misc.power.info"),
9-
ENERGY_INFINITE("misc.energy.infinite"),
109

1110
GUI_MAX_IN("gui.max_in"),
1211
GUI_MAX_OUT("gui.max_out"),

src/main/java/se/gory_moon/chargers/block/ChargerBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void onRemove(@NotNull BlockState state, Level level, @NotNull BlockPos p
7474
public void appendHoverText(@NotNull ItemStack stack, @NotNull Item.TooltipContext context, @NotNull List<Component> tooltip, @NotNull TooltipFlag tooltipFlag) {
7575
Tier tier = getTier();
7676
if (tier.isCreative())
77-
tooltip.add(Component.translatable(LangKeys.POWER_INFO.key(), Component.translatable(LangKeys.ENERGY_INFINITE.key(), ChatFormatting.DARK_AQUA + "FE")).withStyle(ChatFormatting.GOLD));
77+
tooltip.add(Component.translatable(LangKeys.POWER_INFO.key(), EnergyFormatting.INFINITE).withStyle(ChatFormatting.GOLD));
7878
else
7979
EnergyFormatting.addEnergyTooltip(stack, tooltip);
8080
}

src/main/java/se/gory_moon/chargers/client/ChargerScreen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void render(@NotNull GuiGraphics graphics, int pMouseX, int pMouseY, floa
4141
if (pMouseX >= leftPos + 44 && pMouseX <= leftPos + 44 + 16 && pMouseY >= topPos + 14 && pMouseY <= topPos + 84) {
4242
List<Component> list = new ArrayList<>();
4343
if (menu.isCreative())
44-
list.add(Component.translatable(LangKeys.POWER_INFO.key(), Component.translatable(LangKeys.ENERGY_INFINITE.key(), EnergyFormatting.FE).withStyle(ChatFormatting.WHITE)).withStyle(ChatFormatting.GOLD));
44+
list.add(Component.translatable(LangKeys.POWER_INFO.key(), EnergyFormatting.INFINITE).withStyle(ChatFormatting.GOLD));
4545
else
4646
list.add(EnergyFormatting.formatFilledCapacity(menu.getEnergy(), menu.getEnergyMax()));
4747

src/main/java/se/gory_moon/chargers/data/ChargerLanguageProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ protected void addTranslations() {
4444
add(LangKeys.CHAT_DISABLED, "Disabled");
4545

4646
add(LangKeys.POWER_INFO, "Power: %s");
47-
add(LangKeys.ENERGY_INFINITE, "∞ %s");
4847

4948
add(LangKeys.GUI_MAX_IN, "Max In: %s");
5049
add(LangKeys.GUI_MAX_OUT, "Max Out: %s");

0 commit comments

Comments
 (0)