Stop fluid stacks from displaying "0" (#1630)

* Changed display logic of fluid stacks

Fluid stacks that contain less than one bucket (999mB or less) of fluid will now display "<1" instead of "0", for aesthetic purposes.

* Update CHANGELOG.md

* typo fix

* Changed to float display
This commit is contained in:
ineternet
2018-01-28 10:28:59 +01:00
committed by Raoul
parent 7365964216
commit 07628a5872
2 changed files with 6 additions and 1 deletions

View File

@@ -6,6 +6,7 @@
- Fixed not being able to extract half a stack of items with max stack size 1 in Grid when using right click (raoulvdberge)
- Fixed 2 same stacks using capabilities without NBT tag not treated equal (raoulvdberge)
- Changed stack quantity of craftable items from 1 to 0 to fix Quantity Sorting (ineternet)
- Changed fluid stack amount to not display "0" anymore (ineternet)
### 1.5.31
- Improved the "cannot craft! loop in processing..." error message (raoulvdberge)

View File

@@ -63,7 +63,11 @@ public class GridStackFluid implements IGridStack {
public void draw(GuiBase gui, int x, int y) {
GuiBase.FLUID_RENDERER.draw(gui.mc, x, y, stack);
gui.drawQuantity(x, y, API.instance().getQuantityFormatter().formatWithUnits((int) ((float) stack.amount / 1000F)));
float amountRaw = ((float) stack.amount / 1000F);
int amount = (int) amountRaw;
String formattedAmount = amount >= 1 ? API.instance().getQuantityFormatter().formatWithUnits(amount) : String.format("%.1f", amountRaw);
gui.drawQuantity(x, y, formattedAmount);
}
@Override