Improved Countdown start and scoreboard
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
d81259fac9
Commit
5c95036830
@ -77,6 +77,7 @@ public abstract class Countdown {
|
||||
time = totalTime;
|
||||
task = Bukkit.getScheduler().runTaskTimer(FightSystem.getPlugin(), this::count, 20, 20);
|
||||
currentCountdowns.add(this);
|
||||
show();
|
||||
}
|
||||
|
||||
public void disable() {
|
||||
@ -97,9 +98,10 @@ public abstract class Countdown {
|
||||
smallestTime = countdown.time;
|
||||
}
|
||||
|
||||
smallestTime -= 2;
|
||||
smallestTime--;
|
||||
for(Countdown countdown : currentCountdowns){
|
||||
countdown.time -= smallestTime;
|
||||
countdown.show();
|
||||
}
|
||||
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§aBeide Teams waren damit einverstanden, zum nächsten Event zu beschleunigen!");
|
||||
@ -116,9 +118,12 @@ public abstract class Countdown {
|
||||
return time;
|
||||
}
|
||||
|
||||
void count(){
|
||||
void count() {
|
||||
time--;
|
||||
show();
|
||||
}
|
||||
|
||||
private void show(){
|
||||
switch (time) {
|
||||
case 900: case 600: case 300: case 180: case 120:
|
||||
broadcast("§rNoch §a" + time / 60 + " §rMinuten " + countdownCounting());
|
||||
|
@ -69,14 +69,6 @@ public class FightScoreboard implements Listener, ScoreboardCallback {
|
||||
SWScoreboard.removeScoreboard(event.getPlayer());
|
||||
}
|
||||
|
||||
private void teamScoreboard(FightTeam fightTeam){
|
||||
setTitle(fightTeam.getColoredName());
|
||||
fightTeam.getPlayers().forEach(fp -> {
|
||||
if(fp.isLiving())
|
||||
addScore(fightTeam.getPrefix() + fp.getPlayer().getName(), (int) Math.ceil(fp.getPlayer().getHealth()));
|
||||
});
|
||||
}
|
||||
|
||||
private void generalScoreboard(){
|
||||
setTitle("§eKampf");
|
||||
List<String> scoreList = new ArrayList<>();
|
||||
@ -105,17 +97,21 @@ public class FightScoreboard implements Listener, ScoreboardCallback {
|
||||
}
|
||||
}
|
||||
|
||||
private void teamScoreboard(FightTeam fightTeam){
|
||||
fightTeam.getPlayers().forEach(fp -> {
|
||||
if(fp.isLiving())
|
||||
addScore(fightTeam.getPrefix() + fp.getPlayer().getName(), (int) Math.ceil(fp.getPlayer().getHealth()));
|
||||
});
|
||||
}
|
||||
|
||||
private void updateScoreboard() {
|
||||
scores.clear();
|
||||
switch((index++ / 10) % 3){
|
||||
case 0:
|
||||
generalScoreboard();
|
||||
break;
|
||||
case 1:
|
||||
teamScoreboard(Fight.getBlueTeam());
|
||||
break;
|
||||
case 2:
|
||||
teamScoreboard(Fight.getRedTeam());
|
||||
if ((index++ / 5) % 2 == 0) {
|
||||
generalScoreboard();
|
||||
} else {
|
||||
setTitle(Fight.getBlueTeam().getColoredName() + " " + Fight.getRedTeam().getColoredName());
|
||||
teamScoreboard(Fight.getBlueTeam());
|
||||
teamScoreboard(Fight.getRedTeam());
|
||||
}
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren