Skip to content

Commit

Permalink
Merge pull request #40 from MEEPofFaith/totalProgress
Browse files Browse the repository at this point in the history
Add totalProgress
  • Loading branch information
liplum committed May 16, 2024
2 parents 4031434 + 3cd5bab commit da20cbc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/src/multicraft/MultiCrafter.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ public class MultiCrafterBuild extends PayloadBlockBuild<Payload> implements Hea
* Serialized
*/
public float craftingTime;
public float totalProgress;
/**
* Serialized
*/
Expand Down Expand Up @@ -304,6 +305,7 @@ public void updateTile() {
if (wasVisible && Mathf.chanceDelta(updateEffectChance))
updateEffect.at(x + Mathf.range(size * 4f), y + Mathf.range(size * 4));
} else warmup = Mathf.approachDelta(warmup, 0f, warmupSpeed);
totalProgress += warmup * Time.delta;

if (moveInPayload()) {
yeetPayload(payload);
Expand Down Expand Up @@ -581,6 +583,11 @@ public float progress() {
return Mathf.clamp(cur.craftTime > 0f ? craftingTime / cur.craftTime : 1f);
}

@Override
public float totalProgress(){
return totalProgress;
}

@Override
public void display(Table table) {
super.display(table);
Expand Down

0 comments on commit da20cbc

Please sign in to comment.