Merge pull request #3676 from Quezler/patch-74

Fix BlockForge progress bar & recenter payload
This commit is contained in:
Anuken 2020-12-01 16:53:13 -05:00 committed by GitHub
commit 327442f6fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ public class BlockForge extends PayloadAcceptor{
public void setBars(){
super.setBars();
bars.add("progress", entity -> new Bar("bar.progress", Pal.ammo, () -> ((BlockForgeBuild)entity).progress));
bars.add("progress", (BlockForgeBuild entity) -> new Bar("bar.progress", Pal.ammo, () -> entity.recipe == null ? 0f : (float)(entity.progress / entity.recipe.buildCost)));
}
@Override
@ -83,6 +83,7 @@ public class BlockForge extends PayloadAcceptor{
if(progress >= recipe.buildCost){
consume();
payload = new BuildPayload(recipe, team);
payVector.setZero();
progress = 0f;
}
}else{