Skip to content

Commit

Permalink
Simplify boss bar getting.
Browse files Browse the repository at this point in the history
  • Loading branch information
LlmDl committed Jun 29, 2022
1 parent 5b79c9e commit 50c5a3a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void updateBattleSessionBossBar() {
Resident resident = TownyAPI.getInstance().getResident(player);
if (resident == null || ResidentMetaDataController.getBossBarsDisabled(resident))
continue;
BossBar bossBar = bossBarBattleSessionMap.containsKey(player) ? bossBarBattleSessionMap.get(player) : BossBar.bossBar(comp, 0, Color.WHITE, Overlay.PROGRESS);
BossBar bossBar = bossBarBattleSessionMap.getOrDefault(player, BossBar.bossBar(comp, 0, Color.WHITE, Overlay.PROGRESS));
bossBar.progress((float) (remaining/100.0));
bossBar.name(comp);
if (!bossBarBattleSessionMap.containsKey(player)) {
Expand All @@ -66,7 +66,7 @@ public static void updateBannerCapBossBar(Player player, String msg, BannerContr
return;
TextComponent comp = Component.text(msg);
float remaining = getRemainder(bannerControlSession.getSessionEndTime(), SiegeWarSettings.getWarSiegeBannerControlSessionDurationMinutes());
BossBar bossBar = bossBarBannerCapMap.containsKey(player) ? bossBarBannerCapMap.get(player) : BossBar.bossBar(comp, 0, Color.WHITE, Overlay.PROGRESS);
BossBar bossBar = bossBarBannerCapMap.getOrDefault(player, BossBar.bossBar(comp, 0, Color.WHITE, Overlay.PROGRESS));
bossBar.progress(remaining);
bossBar.name(comp);
if (!bossBarBannerCapMap.containsKey(player)) {
Expand Down

0 comments on commit 50c5a3a

Please sign in to comment.