mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-28 08:30:03 +07:00
Merge pull request #3676 from Quezler/patch-74
Fix BlockForge progress bar & recenter payload
This commit is contained in:
commit
327442f6fe
@ -41,7 +41,7 @@ public class BlockForge extends PayloadAcceptor{
|
|||||||
public void setBars(){
|
public void setBars(){
|
||||||
super.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
|
@Override
|
||||||
@ -83,6 +83,7 @@ public class BlockForge extends PayloadAcceptor{
|
|||||||
if(progress >= recipe.buildCost){
|
if(progress >= recipe.buildCost){
|
||||||
consume();
|
consume();
|
||||||
payload = new BuildPayload(recipe, team);
|
payload = new BuildPayload(recipe, team);
|
||||||
|
payVector.setZero();
|
||||||
progress = 0f;
|
progress = 0f;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
Loading…
Reference in New Issue
Block a user