diff --git a/src/main/java/refinedstorage/gui/GuiGrid.java b/src/main/java/refinedstorage/gui/GuiGrid.java index 67a11b1cc..aff7fa99a 100644 --- a/src/main/java/refinedstorage/gui/GuiGrid.java +++ b/src/main/java/refinedstorage/gui/GuiGrid.java @@ -234,7 +234,7 @@ public class GuiGrid extends GuiBase { int qty = items.get(slot).getQuantity(); - String text = String.valueOf(qty); + String text; if (qty >= 1000000) { @@ -244,6 +244,14 @@ public class GuiGrid extends GuiBase { text = String.valueOf((int) Math.floor(qty / 1000)) + "K"; } + else if (qty == 1) + { + text = null; + } + else + { + text = String.valueOf(qty); + } drawItem(x, y, items.get(slot).toItemStack(), true, text); } diff --git a/src/main/java/refinedstorage/tile/TileInterface.java b/src/main/java/refinedstorage/tile/TileInterface.java index 6868c1f96..76335569e 100644 --- a/src/main/java/refinedstorage/tile/TileInterface.java +++ b/src/main/java/refinedstorage/tile/TileInterface.java @@ -20,6 +20,8 @@ public class TileInterface extends TileMachine implements ICompareSetting, ISide private int compare = 0; + private int currentSlot = 0; + @Override public int getEnergyUsage() { @@ -29,17 +31,34 @@ public class TileInterface extends TileMachine implements ICompareSetting, ISide @Override public void updateMachine() { - for (int i = 0; i < 9; ++i) + if (ticks % 5 == 0) { - if (inventory.getStackInSlot(i) != null) - { - ItemStack slot = inventory.getStackInSlot(i); + ItemStack slot = inventory.getStackInSlot(currentSlot); + while ((slot = inventory.getStackInSlot(currentSlot)) == null) + { + currentSlot++; + + if (currentSlot > 8) + { + break; + } + } + + if (inventory.getStackInSlot(currentSlot) != null) + { if (getController().push(slot)) { - inventory.setInventorySlotContents(i, null); + inventory.setInventorySlotContents(currentSlot, null); } } + + currentSlot++; + + if (currentSlot > 8) + { + currentSlot = 0; + } } for (int i = 9; i < 18; ++i)