mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-27 23:45:55 +00:00
Improve formatting of large RF values in WAILA
This commit is contained in:
1 parent
899b025e79
commit
a5ac79c351
3 files changed
+10
-7
No files matched your search
@@ -391,9 +391,9 @@ public class BlockCapacitorBank extends BlockEio implements IGuiHandler, IAdvanc
|
||||
TileCapacitorBank cap = (TileCapacitorBank) te;
|
||||
String format = Util.TAB + Util.ALIGNRIGHT + EnumChatFormatting.WHITE;
|
||||
|
||||
tooltip.add(String.format("%s : %s%d%sRF/t ", Lang.localize("capbank.maxIO"), format, cap.getMaxIO(), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(String.format("%s : %s%d%sRF/t ", Lang.localize("capbank.maxIn"), format, cap.getMaxInput(), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(String.format("%s : %s%d%sRF/t ", Lang.localize("capbank.maxOut"), format, cap.getMaxOutput(), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxIO"), format, fmt.format(cap.getMaxIO()), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxIn"), format, fmt.format(cap.getMaxInput()), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxOut"), format, fmt.format(cap.getMaxOutput()), Util.TAB + Util.ALIGNRIGHT));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.waila;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
|
||||
import crazypants.enderio.gui.IAdvancedTooltipProvider;
|
||||
@@ -12,6 +13,8 @@ public interface IWailaInfoProvider {
|
||||
public static final int BIT_COMMON = 0x2;
|
||||
public static final int BIT_DETAILED = 0x4;
|
||||
public static final int ALL_BITS = BIT_BASIC | BIT_COMMON | BIT_DETAILED;
|
||||
|
||||
public static final NumberFormat fmt = NumberFormat.getNumberInstance();
|
||||
|
||||
/**
|
||||
* Adds the block's info to the WAILA information
|
||||
|
||||
@@ -40,7 +40,7 @@ import crazypants.util.Lang;
|
||||
public class WailaCompat implements IWailaDataProvider {
|
||||
|
||||
public static final WailaCompat INSTANCE = new WailaCompat();
|
||||
|
||||
|
||||
public static void load(IWailaRegistrar registrar) {
|
||||
registrar.registerStackProvider(INSTANCE, BlockConduitBundle.class);
|
||||
registrar.registerStackProvider(INSTANCE, BlockDarkSteelAnvil.class);
|
||||
@@ -155,7 +155,7 @@ public class WailaCompat implements IWailaDataProvider {
|
||||
int stored = accessor.getTileEntity() instanceof TileCapacitorBank ? power.getEnergyStored() : accessor.getNBTData().getInteger("storedEnergyRF");
|
||||
int max = power.getMaxEnergyStored();
|
||||
|
||||
currenttip.add(String.format("%s%d%s / %s%d%s RF", EnumChatFormatting.WHITE, stored, EnumChatFormatting.RESET, EnumChatFormatting.WHITE, max,
|
||||
currenttip.add(String.format("%s%s%s / %s%s%s RF", EnumChatFormatting.WHITE, fmt.format(stored), EnumChatFormatting.RESET, EnumChatFormatting.WHITE, fmt.format(max),
|
||||
EnumChatFormatting.RESET));
|
||||
|
||||
} else if(te instanceof IConduitBundle) {
|
||||
@@ -168,8 +168,8 @@ public class WailaCompat implements IWailaDataProvider {
|
||||
NBTTagCompound conduitTag = conduitTags.getCompoundTagAt(i);
|
||||
IConduit conduit = ConduitUtil.readConduitFromNBT(conduitTag, nbtVersion);
|
||||
if(conduit != null && conduit instanceof IPowerConduit) {
|
||||
currenttip.add(String.format("%s%d%s / %s%d%s RF", EnumChatFormatting.WHITE, ((IPowerConduit) conduit).getEnergyStored(), EnumChatFormatting.RESET,
|
||||
EnumChatFormatting.WHITE, ((IConduitBundle) te).getMaxEnergyStored(), EnumChatFormatting.RESET));
|
||||
currenttip.add(String.format("%s%s%s / %s%s%s RF", EnumChatFormatting.WHITE, fmt.format(((IPowerConduit) conduit).getEnergyStored()), EnumChatFormatting.RESET,
|
||||
EnumChatFormatting.WHITE, fmt.format(((IConduitBundle) te).getMaxEnergyStored()), EnumChatFormatting.RESET));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user