Take the fluid unit from GTNHLib instead of hardcoding L - #157
Conversation
brachy84
left a comment
There was a problem hiding this comment.
The baseUnitPrefix also needs to be adjusted. If the unit is millibucket then it should be SIPrefix.Milli
|
@brachy84 The reason for getUnit() here is that both lines pass the raw fluid.amount, which is in millibuckets. getBaseUnit() drops the prefix, so with the milli prefix the tooltip would read "1,000/4,000,000 B". The capacity line right below already used getUnit() for the same reason, so this just makes the three lines consistent. Keeping getBaseUnit() and converting the value with getBaseUnitAmount() would render "1/4,000 B" instead. Players read fluid amounts in millibuckets everywhere else, in recipes, in NEI and in machine info, so bucket counts in the tooltip would be the odd one out, and small amounts would collapse into fractions. The exact number is what the tooltip is for, so I'd keep it as is. |
Summary
Fluid slots always labelled amounts and capacities as L, ignoring the useForgeFluidMillibuckets option GTNHLib already exposes, so the setting had no effect on any GUI built on ModularUI2.
The unit now falls back to NumberFormatUtil.getFluidUnit() when a widget does not set one explicitly. Calls to fluidUnit() still override it, and UNIT_LITER/UNIT_BUCKET are unchanged.
https://discord.com/channels/181078474394566657/465207956745486336/1456155245708312812
Checklist