Fix shift not showing real value in grid

This commit is contained in:
Raoul Van den Berge
2016-05-28 16:40:45 +02:00
parent ee5e70edab
commit ed21ec0a45

View File

@@ -244,7 +244,7 @@ public class GuiGrid extends GuiBase {
if (slot < items.size()) { if (slot < items.size()) {
ItemStack stack = items.get(slot).getStack(); ItemStack stack = items.get(slot).getStack();
drawItem(x, y, stack, true, formatQuantity(stack.stackSize)); drawItem(x, y, stack, true, formatQuantity(stack.stackSize, slot));
} }
if (inBounds(x, y, 16, 16, mouseX, mouseY) || !grid.isConnected()) { if (inBounds(x, y, 16, 16, mouseX, mouseY) || !grid.isConnected()) {
@@ -284,7 +284,11 @@ public class GuiGrid extends GuiBase {
} }
} }
private String formatQuantity(int qty) { private String formatQuantity(int qty, int slot) {
if (slotNumber == slot && GuiScreen.isShiftKeyDown() && qty > 1) {
return String.valueOf(qty);
}
if (qty >= 1000000) { if (qty >= 1000000) {
return String.format("%.1f", (float) qty / 1000000).replace(",", ".").replace(".0", "") + "M"; return String.format("%.1f", (float) qty / 1000000).replace(",", ".").replace(".0", "") + "M";
} else if (qty >= 1000) { } else if (qty >= 1000) {