aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD-Cysteine <54219287+D-Cysteine@users.noreply.github.com>2021-08-07 18:10:11 -0600
committerD-Cysteine <54219287+D-Cysteine@users.noreply.github.com>2021-08-08 10:55:10 -0600
commit9f839d9841d8a107022d16cd7605db827563363b (patch)
treeb0f1f01a0fe4d670a189c2f62f0b65e8789d043b
parentdc405f9ae8f5157ca1e2e0530d09c922288206fc (diff)
downloadGT5-Unofficial-9f839d9841d8a107022d16cd7605db827563363b.tar.gz
GT5-Unofficial-9f839d9841d8a107022d16cd7605db827563363b.tar.bz2
GT5-Unofficial-9f839d9841d8a107022d16cd7605db827563363b.zip
Format numbers in tooltips
Former-commit-id: fd8e7ed0571e12f19755312f0240aa4827986b85
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java11
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java10
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java11
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java10
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java4
8 files changed, 42 insertions, 16 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java
index c0d2ed88c6..570fe9c0b4 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java
@@ -30,6 +30,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_GUIContainer;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Utility;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
@@ -56,11 +57,11 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer {
this.drawString(this.fontRendererObj, "L.E.S.U.", 11, 8, 16448255);
if (this.mContainer != null) {
String percell = String.valueOf(ConfigHandler.energyPerCell).substring(1);
- this.drawString(this.fontRendererObj, "EU: " + this.mContainer.mEnergy, 11, 16, 16448255);
- this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? this.mContainer.mOutput + percell : Integer.toString(0)), 11, 24, 16448255);
- this.drawString(this.fontRendererObj, "MAX EU/t IN: " + this.mContainer.mInput, 11, 32, 16448255);
- this.drawString(this.fontRendererObj, "EU/t OUT: " + this.mContainer.mOutput, 11, 40, 16448255);
- this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + this.c.getBaseMetaTileEntity().getInputAmperage(), 11, 48, 16448255);
+ this.drawString(this.fontRendererObj, "EU: " + GT_Utility.formatNumbers(this.mContainer.mEnergy), 11, 16, 16448255);
+ this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? GT_Utility.formatNumbers(this.mContainer.mOutput) + percell : Integer.toString(0)), 11, 24, 16448255);
+ this.drawString(this.fontRendererObj, "MAX EU/t IN: " + GT_Utility.formatNumbers(this.mContainer.mInput), 11, 32, 16448255);
+ this.drawString(this.fontRendererObj, "EU/t OUT: " + GT_Utility.formatNumbers(this.mContainer.mOutput), 11, 40, 16448255);
+ this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + GT_Utility.formatNumbers(this.c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255);
if (this.c.maxEUStore() >= Long.MAX_VALUE - 1) {
this.drawString(this.fontRendererObj, StatCollector.translateToLocal("tooltip.LESU.0.name"), 11, 56, Color.YELLOW.getRGB());
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java
index e292237e58..84837e8760 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java
@@ -160,7 +160,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase {
ArrayList<String> e = new ArrayList<>();
String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";");
Collections.addAll(e, dsc);
- e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + ConfigHandler.energyPerCell + "EU");
+ e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + GT_Utility.formatNumbers(ConfigHandler.energyPerCell) + "EU");
dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";");
Collections.addAll(e, dsc);
e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name"));
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java
index 28e4bd2d7f..ee32f18f84 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java
@@ -124,6 +124,14 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull {
@SuppressWarnings("deprecation")
public String[] getDescription() {
- return new String[]{this.mDescription, StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()};
+ return new String[]{
+ this.mDescription,
+ StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " +
+ ChatColorHelper.YELLOW + GT_Utility.formatNumbers(GT_Values.V[this.mTier]),
+ StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " +
+ ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesIn()),
+ StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " +
+ ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesOut()),
+ BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()};
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java
index e011d08609..49f89d1592 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java
@@ -29,6 +29,7 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer;
+import gregtech.api.util.GT_Utility;
import net.minecraft.util.StatCollector;
public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Transformer {
@@ -71,7 +72,15 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans
}
public String[] getDescription() {
- return new String[]{StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()};
+ return new String[]{
+ StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"),
+ StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " "
+ + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(GT_Values.V[this.mTier]),
+ StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " "
+ + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesIn()),
+ StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " "
+ + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesOut()),
+ BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()};
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java
index 7b554447a2..ba0e4d7bae 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java
@@ -63,11 +63,11 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler {
int tSpecial;
if (recipeDesc == null) {
if (tEUt != 0) {
- GT_NEI_DefaultHandler.drawText(10, lines[0], this.trans("152", "Total: ") + (long) tDuration * (long) tEUt + " EU", -16777216);
- GT_NEI_DefaultHandler.drawText(10, lines[1], this.trans("153", "Usage: ") + tEUt + " EU/t", -16777216);
+ GT_NEI_DefaultHandler.drawText(10, lines[0], this.trans("152", "Total: ") + GT_Utility.formatNumbers((long) tDuration * (long) tEUt) + " EU", -16777216);
+ GT_NEI_DefaultHandler.drawText(10, lines[1], this.trans("153", "Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", -16777216);
if (this.mRecipeMap.mShowVoltageAmperageInNEI) {
- GT_NEI_DefaultHandler.drawText(10, lines[2], this.trans("154", "Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216);
- GT_NEI_DefaultHandler.drawText(10, lines[3], this.trans("155", "Amperage: ") + this.mRecipeMap.mAmperage, -16777216);
+ GT_NEI_DefaultHandler.drawText(10, lines[2], this.trans("154", "Voltage: ") + GT_Utility.formatNumbers(tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216);
+ GT_NEI_DefaultHandler.drawText(10, lines[3], this.trans("155", "Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), -16777216);
} else {
GT_NEI_DefaultHandler.drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216);
GT_NEI_DefaultHandler.drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216);
@@ -76,7 +76,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler {
if (tDuration > 0) {
- GT_NEI_DefaultHandler.drawText(10, lines[4], this.trans("158", "Time: ") + String.format("%.2f " + this.trans("161", " secs"), 0.05F * (float) tDuration), -16777216);
+ GT_NEI_DefaultHandler.drawText(10, lines[4], this.trans("158", "Time: ") + GT_Utility.formatNumbers(0.05d * tDuration) + this.trans("161", " secs"), -16777216);
}
tSpecial = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue;
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java
index abecbe811f..3247af4861 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java
@@ -28,6 +28,7 @@ import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Utility;
public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLaserThingy {
@@ -145,6 +146,9 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase
@Override
public String[] getDescription() {
- return new String[]{"Like a Tranformer... but for LAZORZ", "Transferrate: " + ChatColorHelper.YELLOW + this.getTotalPower() + ChatColorHelper.WHITE + " EU/t", BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()};
+ return new String[]{
+ "Like a Tranformer... but for LAZORZ",
+ "Transfer rate: " + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + ChatColorHelper.WHITE + " EU/t",
+ BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()};
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java
index 307e9307cb..eef208a71e 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java
@@ -27,6 +27,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.util.GT_Utility;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
@@ -70,7 +71,8 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat
public String[] getDescription() {
return new String[]{
this.mDescription,
- StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + this.getTotalPower() + EnumChatFormatting.RESET + " EU/t",
+ StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": "
+ + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + EnumChatFormatting.RESET + " EU/t",
BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()
};
}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java
index 922dea51a8..7274d37af5 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java
@@ -27,6 +27,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.util.GT_Utility;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
@@ -45,7 +46,8 @@ public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatc
public String[] getDescription() {
return new String[]{
this.mDescription,
- StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + this.getTotalPower() + EnumChatFormatting.RESET + " EU/t",
+ StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": "
+ + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + EnumChatFormatting.RESET + " EU/t",
BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()
};
}