Fix progress bars on Carpenter and Centrifuge jumping to 100% at first

This commit is contained in:
mezz committed 2015-06-19 00:33:36 -07:00
1 parent f1b35a6746
commit fde3b752e1
4 files changed
+4 -5

No files matched your search

@@ -343,8 +343,7 @@ public class MachineCarpenter extends TilePowered implements ISidedInventory, IL
return 0;
}
return (packageTime * i) / totalTime;
return ((totalTime - packageTime) * i) / totalTime;
}
public int getResourceScaled(int i) {
@@ -232,7 +232,7 @@ public class MachineCentrifuge extends TilePowered implements ISidedInventory {
return i;
}
return (productionTime * i) / timePerItem;
return ((timePerItem - productionTime) * i) / timePerItem;
}
/* GUI */
@@ -32,7 +32,7 @@ public class GuiCarpenter extends GuiForestryTitled<ContainerCarpenter, MachineC
MachineCarpenter machine = inventory;
if (machine.isWorking()) {
int progressScaled = 16 - machine.getCraftingProgressScaled(16);
int progressScaled = machine.getCraftingProgressScaled(16);
drawTexturedModalRect(guiLeft + 98, guiTop + 51 + 16 - progressScaled, 176, 60 + 16 - progressScaled, 4, progressScaled);
}
}
@@ -27,7 +27,7 @@ public class GuiCentrifuge extends GuiForestryTitled<ContainerCentrifuge, Machin
super.drawGuiContainerBackgroundLayer(var1, mouseX, mouseY);
MachineCentrifuge machine = inventory;
int progress = 16 - machine.getProgressScaled(16);
int progress = machine.getProgressScaled(16);
drawTexturedModalRect(guiLeft + 62, guiTop + 36 + 17 - progress, 176, 17 - progress, 4, progress);
}
}