Skip to content

Commit

Permalink
Slightly better machine status updates
Browse files Browse the repository at this point in the history
  • Loading branch information
falkreon committed Apr 16, 2017
1 parent 5b39580 commit e355578
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ public void update() {
if (curRecipe!=lastRecipe) {
revolutionsProcessed = 0;
lastRecipe = curRecipe;
this.markDirty();
}
float newRequirement = 0;
if (lastRecipe!=null) {
revolutionsNeeded = curRecipe.getRequiredRevolutions();
revolutionsNeeded = lastRecipe.getRequiredRevolutions();
//rotaryPower.setRequiredTorque(curRecipe.getRequiredTorque());
newRequirement = curRecipe.getRequiredTorque();
newRequirement = lastRecipe.getRequiredTorque();
}
if (existingRequirement<newRequirement) {
//Unfortunately, we need to dump any rotary power delivered prior to this moment
Expand Down Expand Up @@ -147,6 +148,7 @@ public void update() {

if (lastRecipe!=null) {
//Get some processing done!
markActive(true);
revolutionsProcessed += newRevolutions;
if (revolutionsProcessed>revolutionsNeeded) {
if (itemStorage.getStackInSlot(StandardMachineSlots.WORK).isEmpty()) {
Expand All @@ -160,6 +162,7 @@ public void update() {

}
}
this.markDirty();
}
}

Expand Down

0 comments on commit e355578

Please sign in to comment.