mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-12 16:57:32 -04:00
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:
parent
04e305bea6
commit
3e72a08017
@ -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
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user