Skip to content

Commit

Permalink
修复不使用独立血量时,血条最大血量显示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lt-name committed Nov 12, 2023
1 parent 8dca8f5 commit 25c9d72
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/cn/lanink/gunwar/tasks/game/ShowHealthTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,17 @@ public void onRun(int i) {
}
default:
float health;
int maxHealth;
if (this.owner.isEnableAloneHealth()) {
health = this.room.getPlayerHealth(entry.getKey());
maxHealth = 20;
}else {
health = entry.getKey().getHealth();
maxHealth = entry.getKey().getMaxHealth();
}
bossBar.setText(this.language.translateString("gameTimeBoosBar",
"§c" + String.format("%.1f", health) + "/20 "));
bossBar.setLength(health / 20 * 100);
"§c" + String.format("%.1f", health) + "/" + maxHealth + "§f "));
bossBar.setLength(health / maxHealth * 100);
break;
}
}
Expand Down

0 comments on commit 25c9d72

Please sign in to comment.