Make interface a bit slower.

This commit is contained in:
Raoul Van den Berge
2016-03-22 22:04:54 +01:00
parent 9a466d17d4
commit b46bb1c511
2 changed files with 33 additions and 6 deletions

View File

@@ -234,7 +234,7 @@ public class GuiGrid extends GuiBase
{ {
int qty = items.get(slot).getQuantity(); int qty = items.get(slot).getQuantity();
String text = String.valueOf(qty); String text;
if (qty >= 1000000) if (qty >= 1000000)
{ {
@@ -244,6 +244,14 @@ public class GuiGrid extends GuiBase
{ {
text = String.valueOf((int) Math.floor(qty / 1000)) + "K"; 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); drawItem(x, y, items.get(slot).toItemStack(), true, text);
} }

View File

@@ -20,6 +20,8 @@ public class TileInterface extends TileMachine implements ICompareSetting, ISide
private int compare = 0; private int compare = 0;
private int currentSlot = 0;
@Override @Override
public int getEnergyUsage() public int getEnergyUsage()
{ {
@@ -29,17 +31,34 @@ public class TileInterface extends TileMachine implements ICompareSetting, ISide
@Override @Override
public void updateMachine() public void updateMachine()
{ {
for (int i = 0; i < 9; ++i) if (ticks % 5 == 0)
{ {
if (inventory.getStackInSlot(i) != null) ItemStack slot = inventory.getStackInSlot(currentSlot);
{
ItemStack slot = inventory.getStackInSlot(i);
while ((slot = inventory.getStackInSlot(currentSlot)) == null)
{
currentSlot++;
if (currentSlot > 8)
{
break;
}
}
if (inventory.getStackInSlot(currentSlot) != null)
{
if (getController().push(slot)) 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) for (int i = 9; i < 18; ++i)