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:
@@ -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 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)
|
- 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 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
|
### 1.5.31
|
||||||
- Improved the "cannot craft! loop in processing..." error message (raoulvdberge)
|
- Improved the "cannot craft! loop in processing..." error message (raoulvdberge)
|
||||||
|
|||||||
@@ -63,7 +63,11 @@ public class GridStackFluid implements IGridStack {
|
|||||||
public void draw(GuiBase gui, int x, int y) {
|
public void draw(GuiBase gui, int x, int y) {
|
||||||
GuiBase.FLUID_RENDERER.draw(gui.mc, x, y, stack);
|
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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user