1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-26 04:25:15 +01:00

lets allow to define bossbar segment count

This commit is contained in:
Zrips 2020-05-11 15:15:28 +03:00
parent 1942013d27
commit 5c6a5dcaa3
2 changed files with 19 additions and 1 deletions

View File

@ -113,7 +113,22 @@ public class BossBarManager {
break;
}
}
bar = Bukkit.createBossBar(message, color, BarStyle.SEGMENTED_20);
BarStyle style = BarStyle.SOLID;
switch(Jobs.getGCManager().SegementCount) {
case 6:
style = BarStyle.SEGMENTED_6;
break;
case 10:
style = BarStyle.SEGMENTED_10;
break;
case 12:
style = BarStyle.SEGMENTED_12;
break;
case 20:
style = BarStyle.SEGMENTED_20;
break;
}
bar = Bukkit.createBossBar(message, color, style);
} else
bar.setTitle(message);

View File

@ -159,6 +159,7 @@ public class GeneralConfigManager {
//BossBar
public boolean BossBarEnabled;
public boolean BossBarShowOnEachAction;
public int SegementCount;
public int BossBarTimer;
public boolean BossBarsMessageByDefault;
@ -936,6 +937,8 @@ public class GeneralConfigManager {
c.addComment("BossBar.ShowOnEachAction", "If enabled boss bar will update after each action",
"If disabled, BossBar will update only on each payment. This can save some server resources");
BossBarShowOnEachAction = c.get("BossBar.ShowOnEachAction", false);
c.addComment("BossBar.SegementCount", "Defines in how many parts bossabr will be split visually","Valid options: 1, 6, 10, 12, 20");
SegementCount = c.get("BossBar.SegementCount", 1);
c.addComment("BossBar.Timer", "How long in sec to show BossBar for player",
"If you have disabled ShowOnEachAction, then keep this number higher than payment interval for better experience");
BossBarTimer = c.get("BossBar.Timer", economyBatchDelay + 1);