Made the "progress" arrow in the printer GUI correspond to actual completion progress.

Increased energy required for a single print.
This commit is contained in:
Florian Nücke 2015-03-25 22:43:09 +01:00
parent 04e305bea6
commit 3e72a08017
3 changed files with 4 additions and 5 deletions

View File

@ -735,7 +735,7 @@ opencomputers {
eepromWrite: 50
# How much energy is required for a single 3D print.
printerModel: 25
printerModel: 100
}
# The rate at which different blocks accept external power. All of these

View File

@ -66,8 +66,7 @@ class Printer(playerInventory: InventoryPlayer, val printer: tileentity.Printer)
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize)
materialBar.level = printerContainer.amountMaterial / printer.maxAmountMaterial.toDouble
inkBar.level = printerContainer.amountInk / printer.maxAmountInk.toDouble
if (printerContainer.isPrinting) progressBar.level = (System.currentTimeMillis() % 3000) / 3000.0
else progressBar.level = 0
progressBar.level = printerContainer.progress
drawWidgets()
drawInventorySlots()
}

View File

@ -13,14 +13,14 @@ class Printer(playerInventory: InventoryPlayer, val printer: tileentity.Printer)
// Show the player's inventory.
addPlayerInventorySlots(8, 84)
def isPrinting = synchronizedData.getBoolean("isPrinting")
def progress = synchronizedData.getDouble("progress")
def amountMaterial = synchronizedData.getInteger("amountMaterial")
def amountInk = synchronizedData.getInteger("amountInk")
override protected def detectCustomDataChanges(nbt: NBTTagCompound): Unit = {
synchronizedData.setBoolean("isPrinting", printer.isPrinting)
synchronizedData.setDouble("progress", if (printer.isPrinting) printer.progress / 100.0 else 0)
synchronizedData.setInteger("amountMaterial", printer.amountMaterial)
synchronizedData.setInteger("amountInk", printer.amountInk)
super.detectCustomDataChanges(nbt)