From dec3f76e5fe11df8cfb6e1aca73431af577c89bc Mon Sep 17 00:00:00 2001 From: "Josiah \"Rebase\" Roberts" <37082009+josiah-roberts@users.noreply.github.com> Date: Fri, 29 Dec 2023 12:53:58 -0600 Subject: [PATCH] Use locale formatting where possible in WAILA and The One Probe (#2327) --- .../hwyla/provider/ConverterDataProvider.java | 11 +++++++---- .../hwyla/provider/DiodeDataProvider.java | 7 +++++-- .../hwyla/provider/PrimitivePumpDataProvider.java | 4 +++- .../hwyla/provider/RecipeLogicDataProvider.java | 5 +++-- .../hwyla/provider/SteamBoilerDataProvider.java | 4 +++- .../hwyla/provider/TransformerDataProvider.java | 5 +++-- .../theoneprobe/provider/ConverterInfoProvider.java | 13 +++++++++---- .../theoneprobe/provider/CoverInfoProvider.java | 5 +++-- .../provider/ElectricContainerInfoProvider.java | 5 +++-- .../provider/LaserContainerInfoProvider.java | 6 ++++-- .../provider/PrimitivePumpInfoProvider.java | 5 ++++- .../provider/RecipeLogicInfoProvider.java | 7 +++++-- .../provider/SteamBoilerInfoProvider.java | 4 +++- .../provider/TransformerInfoProvider.java | 5 +++-- .../theoneprobe/provider/WorkableInfoProvider.java | 6 ++++-- 15 files changed, 62 insertions(+), 30 deletions(-) diff --git a/src/main/java/gregtech/integration/hwyla/provider/ConverterDataProvider.java b/src/main/java/gregtech/integration/hwyla/provider/ConverterDataProvider.java index 341334681c7..593832936cc 100644 --- a/src/main/java/gregtech/integration/hwyla/provider/ConverterDataProvider.java +++ b/src/main/java/gregtech/integration/hwyla/provider/ConverterDataProvider.java @@ -4,6 +4,7 @@ import gregtech.api.capability.FeCompat; import gregtech.api.capability.GregtechCapabilities; import gregtech.api.util.GTUtility; +import gregtech.api.util.TextFormattingUtil; import gregtech.common.metatileentities.converter.ConverterTrait; import net.minecraft.client.resources.I18n; @@ -67,19 +68,21 @@ protected NBTTagCompound getNBTData(ConverterTrait capability, NBTTagCompound ta tooltip.add(I18n.format("gregtech.top.convert_fe")); if (accessor.getSide() == frontFacing) { tooltip.add(I18n.format("gregtech.top.transform_output") + " " + voltageName + - TextFormatting.RESET + " (" + amperage + "A)"); + TextFormatting.RESET + " (" + TextFormattingUtil.formatNumbers(amperage) + "A)"); } else { tooltip.add(I18n.format("gregtech.top.transform_input") + " " + - FeCompat.toFe(voltage * amperage, FeCompat.ratio(true)) + " FE"); + TextFormattingUtil.formatNumbers(FeCompat.toFe(voltage * amperage, FeCompat.ratio(true))) + + " FE"); } } else { tooltip.add(I18n.format("gregtech.top.convert_eu")); if (accessor.getSide() == frontFacing) { tooltip.add(I18n.format("gregtech.top.transform_output") + " " + - FeCompat.toFe(voltage * amperage, FeCompat.ratio(false)) + " FE"); + TextFormattingUtil.formatNumbers(FeCompat.toFe(voltage * amperage, FeCompat.ratio(false))) + + " FE"); } else { tooltip.add(I18n.format("gregtech.top.transform_input") + " " + voltageName + TextFormatting.RESET + - " (" + amperage + "A)"); + " (" + TextFormattingUtil.formatNumbers(amperage) + "A)"); } } } diff --git a/src/main/java/gregtech/integration/hwyla/provider/DiodeDataProvider.java b/src/main/java/gregtech/integration/hwyla/provider/DiodeDataProvider.java index 1000a11ff55..69e38bfaad7 100644 --- a/src/main/java/gregtech/integration/hwyla/provider/DiodeDataProvider.java +++ b/src/main/java/gregtech/integration/hwyla/provider/DiodeDataProvider.java @@ -3,6 +3,7 @@ import gregtech.api.GTValues; import gregtech.api.capability.IEnergyContainer; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.util.TextFormattingUtil; import gregtech.common.metatileentities.electric.MetaTileEntityDiode; import net.minecraft.client.resources.I18n; @@ -59,9 +60,11 @@ protected NBTTagCompound getNBTData(IEnergyContainer capability, NBTTagCompound final EnumFacing frontFacing = EnumFacing.byIndex(tag.getInteger("FrontFacing")); if (accessor.getSide() == frontFacing) { // output side - tooltip.add(I18n.format("gregtech.top.transform_output") + " " + outputAmperage + " A"); + tooltip.add(I18n.format("gregtech.top.transform_output") + " " + + TextFormattingUtil.formatNumbers(outputAmperage) + " A"); } else { - tooltip.add(I18n.format("gregtech.top.transform_input") + " " + inputAmperage + " A"); + tooltip.add(I18n.format("gregtech.top.transform_input") + " " + + TextFormattingUtil.formatNumbers(inputAmperage) + " A"); } } return tooltip; diff --git a/src/main/java/gregtech/integration/hwyla/provider/PrimitivePumpDataProvider.java b/src/main/java/gregtech/integration/hwyla/provider/PrimitivePumpDataProvider.java index 4af2e2f8915..3598647818f 100644 --- a/src/main/java/gregtech/integration/hwyla/provider/PrimitivePumpDataProvider.java +++ b/src/main/java/gregtech/integration/hwyla/provider/PrimitivePumpDataProvider.java @@ -3,6 +3,7 @@ import gregtech.api.GTValues; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IPrimitivePump; +import gregtech.api.util.TextFormattingUtil; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayerMP; @@ -58,7 +59,8 @@ public List getWailaBody(ItemStack itemStack, List tooltip, IWai if (accessor.getNBTData().hasKey("gregtech.IPrimitivePump")) { NBTTagCompound tag = accessor.getNBTData().getCompoundTag("gregtech.IPrimitivePump"); int production = tag.getInteger("Production"); - tooltip.add(I18n.format("gregtech.top.primitive_pump_production") + " " + TextFormatting.AQUA + production + + tooltip.add(I18n.format("gregtech.top.primitive_pump_production") + " " + TextFormatting.AQUA + + TextFormattingUtil.formatNumbers(production) + TextFormatting.RESET + " L/s"); } return tooltip; diff --git a/src/main/java/gregtech/integration/hwyla/provider/RecipeLogicDataProvider.java b/src/main/java/gregtech/integration/hwyla/provider/RecipeLogicDataProvider.java index f1a2a6b5a4c..655dd57aa20 100644 --- a/src/main/java/gregtech/integration/hwyla/provider/RecipeLogicDataProvider.java +++ b/src/main/java/gregtech/integration/hwyla/provider/RecipeLogicDataProvider.java @@ -9,6 +9,7 @@ import gregtech.api.metatileentity.multiblock.RecipeMapSteamMultiblockController; import gregtech.api.unification.material.Materials; import gregtech.api.util.GTUtility; +import gregtech.api.util.TextFormattingUtil; import gregtech.common.metatileentities.multi.MetaTileEntityLargeBoiler; import net.minecraft.client.resources.I18n; @@ -72,7 +73,7 @@ public List getWailaBody(ItemStack itemStack, List tooltip, IWai MetaTileEntity mte = gtte.getMetaTileEntity(); if (mte instanceof SteamMetaTileEntity || mte instanceof MetaTileEntityLargeBoiler || mte instanceof RecipeMapSteamMultiblockController) { - endText = ": " + absEUt + TextFormatting.RESET + " L/t " + + endText = ": " + TextFormattingUtil.formatNumbers(absEUt) + TextFormatting.RESET + " L/t " + I18n.format(Materials.Steam.getUnlocalizedName()); } AbstractRecipeLogic arl = mte.getRecipeLogic(); @@ -81,7 +82,7 @@ public List getWailaBody(ItemStack itemStack, List tooltip, IWai } } if (endText == null) { - endText = ": " + absEUt + TextFormatting.RESET + " EU/t (" + + endText = ": " + TextFormattingUtil.formatNumbers(absEUt) + TextFormatting.RESET + " EU/t (" + GTValues.VNF[GTUtility.getTierByVoltage(absEUt)] + TextFormatting.RESET + ")"; } diff --git a/src/main/java/gregtech/integration/hwyla/provider/SteamBoilerDataProvider.java b/src/main/java/gregtech/integration/hwyla/provider/SteamBoilerDataProvider.java index 85a3f738ca0..0baaab2927f 100644 --- a/src/main/java/gregtech/integration/hwyla/provider/SteamBoilerDataProvider.java +++ b/src/main/java/gregtech/integration/hwyla/provider/SteamBoilerDataProvider.java @@ -3,6 +3,7 @@ import gregtech.api.GTValues; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.unification.material.Materials; +import gregtech.api.util.TextFormattingUtil; import gregtech.common.metatileentities.steam.boiler.SteamBoiler; import net.minecraft.client.resources.I18n; @@ -65,7 +66,8 @@ public List getWailaBody(ItemStack itemStack, List tooltip, IWai // Creating steam if (steamRate > 0 && hasWater) { - tooltip.add(I18n.format("gregtech.top.energy_production") + ": " + (steamRate / 10) + " L/t " + + tooltip.add(I18n.format("gregtech.top.energy_production") + ": " + + TextFormattingUtil.formatNumbers(steamRate / 10) + " L/t " + I18n.format(Materials.Steam.getUnlocalizedName())); } diff --git a/src/main/java/gregtech/integration/hwyla/provider/TransformerDataProvider.java b/src/main/java/gregtech/integration/hwyla/provider/TransformerDataProvider.java index 49da30bf2da..e54792f8139 100644 --- a/src/main/java/gregtech/integration/hwyla/provider/TransformerDataProvider.java +++ b/src/main/java/gregtech/integration/hwyla/provider/TransformerDataProvider.java @@ -4,6 +4,7 @@ import gregtech.api.capability.IEnergyContainer; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.util.GTUtility; +import gregtech.api.util.TextFormattingUtil; import gregtech.common.metatileentities.electric.MetaTileEntityTransformer; import net.minecraft.client.resources.I18n; @@ -82,7 +83,7 @@ public List getWailaBody(ItemStack itemStack, List tooltip, IWai .append(GTValues.VNF[GTUtility.getTierByVoltage(inputVoltage)]) .append(TextFormatting.RESET) .append(" (") - .append(inputAmperage) + .append(TextFormattingUtil.formatNumbers(inputAmperage)) .append("A)"); StringBuilder output = new StringBuilder() @@ -90,7 +91,7 @@ public List getWailaBody(ItemStack itemStack, List tooltip, IWai .append(GTValues.VNF[GTUtility.getTierByVoltage(outputVoltage)]) .append(TextFormatting.RESET) .append(" (") - .append(outputAmperage) + .append(TextFormattingUtil.formatNumbers(outputAmperage)) .append("A)"); // Step Up/Step Down line diff --git a/src/main/java/gregtech/integration/theoneprobe/provider/ConverterInfoProvider.java b/src/main/java/gregtech/integration/theoneprobe/provider/ConverterInfoProvider.java index 4a635e9058a..2ef4b0e3e05 100644 --- a/src/main/java/gregtech/integration/theoneprobe/provider/ConverterInfoProvider.java +++ b/src/main/java/gregtech/integration/theoneprobe/provider/ConverterInfoProvider.java @@ -5,6 +5,7 @@ import gregtech.api.capability.GregtechCapabilities; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.util.GTUtility; +import gregtech.api.util.TextFormattingUtil; import gregtech.common.metatileentities.converter.ConverterTrait; import net.minecraft.entity.player.EntityPlayer; @@ -45,18 +46,22 @@ protected void addProbeInfo(@NotNull ConverterTrait capability, @NotNull IProbeI if (capability.isFeToEu()) { if (data.getSideHit() == facing) { probeInfo.text(TextStyleClass.INFO + "{*gregtech.top.transform_output*} " + voltageN + - TextFormatting.GREEN + " (" + amperage + "A)"); + TextFormatting.GREEN + " (" + TextFormattingUtil.formatNumbers(amperage) + "A)"); } else { probeInfo.text(TextStyleClass.INFO + "{*gregtech.top.transform_input*} " + TextFormatting.RED + - FeCompat.toFe(capability.getVoltage() * amperage, FeCompat.ratio(true)) + " FE"); + TextFormattingUtil.formatNumbers( + FeCompat.toFe(capability.getVoltage() * amperage, FeCompat.ratio(true))) + + " FE"); } } else { if (data.getSideHit() == facing) { probeInfo.text(TextStyleClass.INFO + "{*gregtech.top.transform_output*} " + TextFormatting.RED + - FeCompat.toFe(capability.getVoltage() * amperage, FeCompat.ratio(false)) + " FE"); + TextFormattingUtil.formatNumbers( + FeCompat.toFe(capability.getVoltage() * amperage, FeCompat.ratio(false))) + + " FE"); } else { probeInfo.text(TextStyleClass.INFO + "{*gregtech.top.transform_input*} " + voltageN + - TextFormatting.GREEN + " (" + amperage + "A)"); + TextFormatting.GREEN + " (" + TextFormattingUtil.formatNumbers(amperage) + "A)"); } } } diff --git a/src/main/java/gregtech/integration/theoneprobe/provider/CoverInfoProvider.java b/src/main/java/gregtech/integration/theoneprobe/provider/CoverInfoProvider.java index 645e6774d3b..6656fcc9d7e 100644 --- a/src/main/java/gregtech/integration/theoneprobe/provider/CoverInfoProvider.java +++ b/src/main/java/gregtech/integration/theoneprobe/provider/CoverInfoProvider.java @@ -204,7 +204,8 @@ private static void transferRateText(@NotNull IProbeInfo probeInfo, @NotNull IIO private static void transferModeText(@NotNull IProbeInfo probeInfo, @NotNull TransferMode mode, @NotNull String rateUnit, int rate, boolean hasFilter) { String text = TextStyleClass.OK + IProbeInfo.STARTLOC + mode.getName() + IProbeInfo.ENDLOC; - if (!hasFilter && mode != TransferMode.TRANSFER_ANY) text += TextStyleClass.LABEL + " " + rate + rateUnit; + if (!hasFilter && mode != TransferMode.TRANSFER_ANY) + text += TextStyleClass.LABEL + " " + TextFormattingUtil.formatNumbers(rate) + rateUnit; probeInfo.text(text); } @@ -220,7 +221,7 @@ private static void transferModeText(@NotNull IProbeInfo probeInfo, @NotNull Tra private static void voidingText(@NotNull IProbeInfo probeInfo, @NotNull VoidingMode mode, @NotNull String unit, int amount, boolean hasFilter) { String text = TextFormatting.RED + IProbeInfo.STARTLOC + mode.getName() + IProbeInfo.ENDLOC; - if (mode != VoidingMode.VOID_ANY && !hasFilter) text += " " + amount + unit; + if (mode != VoidingMode.VOID_ANY && !hasFilter) text += " " + TextFormattingUtil.formatNumbers(amount) + unit; probeInfo.text(text); } diff --git a/src/main/java/gregtech/integration/theoneprobe/provider/ElectricContainerInfoProvider.java b/src/main/java/gregtech/integration/theoneprobe/provider/ElectricContainerInfoProvider.java index 7252ebbca23..4b2e970d7c6 100644 --- a/src/main/java/gregtech/integration/theoneprobe/provider/ElectricContainerInfoProvider.java +++ b/src/main/java/gregtech/integration/theoneprobe/provider/ElectricContainerInfoProvider.java @@ -3,6 +3,7 @@ import gregtech.api.GTValues; import gregtech.api.capability.GregtechCapabilities; import gregtech.api.capability.IEnergyContainer; +import gregtech.api.util.TextFormattingUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; @@ -36,9 +37,9 @@ protected void addProbeInfo(@NotNull IEnergyContainer capability, @NotNull IProb long maxStorage = capability.getEnergyCapacity(); if (maxStorage == 0) return; // do not add empty max storage progress bar probeInfo.progress(capability.getEnergyStored(), maxStorage, probeInfo.defaultProgressStyle() - .suffix(" / " + maxStorage + " EU") + .suffix(" / " + TextFormattingUtil.formatNumbers(maxStorage) + " EU") .filledColor(0xFFEEE600) .alternateFilledColor(0xFFEEE600) - .borderColor(0xFF555555)); + .borderColor(0xFF555555).numberFormat(mcjty.theoneprobe.api.NumberFormat.COMMAS)); } } diff --git a/src/main/java/gregtech/integration/theoneprobe/provider/LaserContainerInfoProvider.java b/src/main/java/gregtech/integration/theoneprobe/provider/LaserContainerInfoProvider.java index d75c6a7c8eb..404bf223680 100644 --- a/src/main/java/gregtech/integration/theoneprobe/provider/LaserContainerInfoProvider.java +++ b/src/main/java/gregtech/integration/theoneprobe/provider/LaserContainerInfoProvider.java @@ -3,6 +3,7 @@ import gregtech.api.GTValues; import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.capability.ILaserContainer; +import gregtech.api.util.TextFormattingUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; @@ -10,6 +11,7 @@ import mcjty.theoneprobe.api.IProbeHitData; import mcjty.theoneprobe.api.IProbeInfo; +import mcjty.theoneprobe.api.NumberFormat; import org.jetbrains.annotations.NotNull; public class LaserContainerInfoProvider extends CapabilityInfoProvider { @@ -31,10 +33,10 @@ protected void addProbeInfo(ILaserContainer capability, IProbeInfo probeInfo, En long maxStorage = capability.getEnergyCapacity(); if (maxStorage == 0) return; // do not add empty max storage progress bar probeInfo.progress(capability.getEnergyStored(), maxStorage, probeInfo.defaultProgressStyle() - .suffix(" / " + maxStorage + " EU") + .suffix(" / " + TextFormattingUtil.formatNumbers(maxStorage) + " EU") .filledColor(0xFFEEE600) .alternateFilledColor(0xFFEEE600) - .borderColor(0xFF555555)); + .borderColor(0xFF555555).numberFormat(NumberFormat.COMMAS)); } @Override diff --git a/src/main/java/gregtech/integration/theoneprobe/provider/PrimitivePumpInfoProvider.java b/src/main/java/gregtech/integration/theoneprobe/provider/PrimitivePumpInfoProvider.java index ea20f8be8a8..3c7d3d79004 100644 --- a/src/main/java/gregtech/integration/theoneprobe/provider/PrimitivePumpInfoProvider.java +++ b/src/main/java/gregtech/integration/theoneprobe/provider/PrimitivePumpInfoProvider.java @@ -4,6 +4,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IPrimitivePump; +import gregtech.api.util.TextFormattingUtil; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; @@ -32,7 +33,9 @@ public void addProbeInfo(@NotNull ProbeMode mode, @NotNull IProbeInfo probeInfo, if (metaTileEntity instanceof IPrimitivePump) { probeInfo.text( TextStyleClass.INFO + "{*gregtech.top.primitive_pump_production*} " + TextFormatting.AQUA + - ((IPrimitivePump) metaTileEntity).getFluidProduction() + TextFormatting.RESET + " L/s"); + TextFormattingUtil + .formatNumbers(((IPrimitivePump) metaTileEntity).getFluidProduction()) + + TextFormatting.RESET + " L/s"); } } } diff --git a/src/main/java/gregtech/integration/theoneprobe/provider/RecipeLogicInfoProvider.java b/src/main/java/gregtech/integration/theoneprobe/provider/RecipeLogicInfoProvider.java index 8ea1a0ac3c7..3a60fab7db6 100644 --- a/src/main/java/gregtech/integration/theoneprobe/provider/RecipeLogicInfoProvider.java +++ b/src/main/java/gregtech/integration/theoneprobe/provider/RecipeLogicInfoProvider.java @@ -10,6 +10,7 @@ import gregtech.api.metatileentity.multiblock.RecipeMapSteamMultiblockController; import gregtech.api.unification.material.Materials; import gregtech.api.util.GTUtility; +import gregtech.api.util.TextFormattingUtil; import gregtech.common.metatileentities.multi.MetaTileEntityLargeBoiler; import net.minecraft.entity.player.EntityPlayer; @@ -53,14 +54,16 @@ protected void addProbeInfo(@NotNull AbstractRecipeLogic capability, @NotNull IP MetaTileEntity mte = gtTileEntity.getMetaTileEntity(); if (mte instanceof SteamMetaTileEntity || mte instanceof MetaTileEntityLargeBoiler || mte instanceof RecipeMapSteamMultiblockController) { - text = TextFormatting.AQUA.toString() + absEUt + TextStyleClass.INFO + " L/t {*" + + text = TextFormatting.AQUA.toString() + TextFormattingUtil.formatNumbers(absEUt) + + TextStyleClass.INFO + " L/t {*" + Materials.Steam.getUnlocalizedName() + "*}"; } } if (text == null) { // Default behavior, if this TE is not a steam machine (or somehow not instanceof // IGregTechTileEntity...) - text = TextFormatting.RED.toString() + absEUt + TextStyleClass.INFO + " EU/t" + TextFormatting.GREEN + + text = TextFormatting.RED.toString() + TextFormattingUtil.formatNumbers(absEUt) + TextStyleClass.INFO + + " EU/t" + TextFormatting.GREEN + " (" + GTValues.VNF[GTUtility.getTierByVoltage(absEUt)] + TextFormatting.GREEN + ")"; } diff --git a/src/main/java/gregtech/integration/theoneprobe/provider/SteamBoilerInfoProvider.java b/src/main/java/gregtech/integration/theoneprobe/provider/SteamBoilerInfoProvider.java index 4ccdc7125d0..248d0fc1d02 100644 --- a/src/main/java/gregtech/integration/theoneprobe/provider/SteamBoilerInfoProvider.java +++ b/src/main/java/gregtech/integration/theoneprobe/provider/SteamBoilerInfoProvider.java @@ -4,6 +4,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.unification.material.Materials; +import gregtech.api.util.TextFormattingUtil; import gregtech.common.metatileentities.steam.boiler.SteamBoiler; import net.minecraft.block.state.IBlockState; @@ -36,7 +37,8 @@ public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer play // Creating steam if (steamOutput > 0 && boiler.hasWater()) { probeInfo.text(TextStyleClass.INFO + "{*gregtech.top.energy_production*} " + - TextFormatting.AQUA + (steamOutput / 10) + TextStyleClass.INFO + " L/t" + " {*" + + TextFormatting.AQUA + TextFormattingUtil.formatNumbers(steamOutput / 10) + + TextStyleClass.INFO + " L/t" + " {*" + Materials.Steam.getUnlocalizedName() + "*}"); } diff --git a/src/main/java/gregtech/integration/theoneprobe/provider/TransformerInfoProvider.java b/src/main/java/gregtech/integration/theoneprobe/provider/TransformerInfoProvider.java index cf77786cc15..0cf94adc4bd 100644 --- a/src/main/java/gregtech/integration/theoneprobe/provider/TransformerInfoProvider.java +++ b/src/main/java/gregtech/integration/theoneprobe/provider/TransformerInfoProvider.java @@ -5,6 +5,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.util.GTUtility; +import gregtech.api.util.TextFormattingUtil; import gregtech.common.metatileentities.electric.MetaTileEntityTransformer; import net.minecraft.entity.player.EntityPlayer; @@ -33,14 +34,14 @@ protected void addProbeInfo(@NotNull IEnergyContainer capability, @NotNull IProb .append(GTValues.VNF[GTUtility.getTierByVoltage(capability.getInputVoltage())]) .append(TextFormatting.GREEN) .append(" (") - .append(capability.getInputAmperage()) + .append(TextFormattingUtil.formatNumbers(capability.getInputAmperage())) .append("A)"); StringBuilder output = new StringBuilder() .append(GTValues.VNF[GTUtility.getTierByVoltage(capability.getOutputVoltage())]) .append(TextFormatting.GREEN) .append(" (") - .append(capability.getOutputAmperage()) + .append(TextFormattingUtil.formatNumbers(capability.getOutputAmperage())) .append("A)"); // Step Up/Step Down line diff --git a/src/main/java/gregtech/integration/theoneprobe/provider/WorkableInfoProvider.java b/src/main/java/gregtech/integration/theoneprobe/provider/WorkableInfoProvider.java index 5d3c500e81e..ac6254aa8b5 100644 --- a/src/main/java/gregtech/integration/theoneprobe/provider/WorkableInfoProvider.java +++ b/src/main/java/gregtech/integration/theoneprobe/provider/WorkableInfoProvider.java @@ -4,6 +4,7 @@ import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.capability.IWorkable; import gregtech.api.capability.impl.ComputationRecipeLogic; +import gregtech.api.util.TextFormattingUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; @@ -11,6 +12,7 @@ import mcjty.theoneprobe.api.IProbeHitData; import mcjty.theoneprobe.api.IProbeInfo; +import mcjty.theoneprobe.api.NumberFormat; import org.jetbrains.annotations.NotNull; public class WorkableInfoProvider extends CapabilityInfoProvider { @@ -52,7 +54,7 @@ protected void addProbeInfo(@NotNull IWorkable capability, @NotNull IProbeInfo p } else { currentProgress = Math.round(currentProgress / 20.0F); maxProgress = Math.round(maxProgress / 20.0F); - text = " / " + maxProgress + " s"; + text = " / " + TextFormattingUtil.formatNumbers(maxProgress) + " s"; } if (maxProgress > 0) { @@ -61,7 +63,7 @@ protected void addProbeInfo(@NotNull IWorkable capability, @NotNull IProbeInfo p .suffix(text) .filledColor(color) .alternateFilledColor(color) - .borderColor(0xFF555555)); + .borderColor(0xFF555555).numberFormat(NumberFormat.COMMAS)); } } }