diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 9d84c1c39..4973ecc8c 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -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 diff --git a/src/main/scala/li/cil/oc/client/gui/Printer.scala b/src/main/scala/li/cil/oc/client/gui/Printer.scala index a3ca975bc..c28bbc0a5 100644 --- a/src/main/scala/li/cil/oc/client/gui/Printer.scala +++ b/src/main/scala/li/cil/oc/client/gui/Printer.scala @@ -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() } diff --git a/src/main/scala/li/cil/oc/common/container/Printer.scala b/src/main/scala/li/cil/oc/common/container/Printer.scala index 11cf0691b..8dbe78c5b 100644 --- a/src/main/scala/li/cil/oc/common/container/Printer.scala +++ b/src/main/scala/li/cil/oc/common/container/Printer.scala @@ -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)