Improved Countdown start and scoreboard #268
@ -77,6 +77,7 @@ public abstract class Countdown {
|
|||||||
time = totalTime;
|
time = totalTime;
|
||||||
task = Bukkit.getScheduler().runTaskTimer(FightSystem.getPlugin(), this::count, 20, 20);
|
task = Bukkit.getScheduler().runTaskTimer(FightSystem.getPlugin(), this::count, 20, 20);
|
||||||
currentCountdowns.add(this);
|
currentCountdowns.add(this);
|
||||||
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disable() {
|
public void disable() {
|
||||||
@ -97,9 +98,10 @@ public abstract class Countdown {
|
|||||||
smallestTime = countdown.time;
|
smallestTime = countdown.time;
|
||||||
}
|
}
|
||||||
|
|
||||||
smallestTime -= 2;
|
smallestTime--;
|
||||||
for(Countdown countdown : currentCountdowns){
|
for(Countdown countdown : currentCountdowns){
|
||||||
countdown.time -= smallestTime;
|
countdown.time -= smallestTime;
|
||||||
|
countdown.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§aBeide Teams waren damit einverstanden, zum nächsten Event zu beschleunigen!");
|
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;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
void count(){
|
private void count() {
|
||||||
time--;
|
time--;
|
||||||
|
show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void show(){
|
||||||
switch (time) {
|
switch (time) {
|
||||||
case 900: case 600: case 300: case 180: case 120:
|
case 900: case 600: case 300: case 180: case 120:
|
||||||
broadcast("§rNoch §a" + time / 60 + " §rMinuten " + countdownCounting());
|
broadcast("§rNoch §a" + time / 60 + " §rMinuten " + countdownCounting());
|
||||||
|
@ -52,9 +52,7 @@ public class EnternCountdown extends Countdown {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void count(){
|
void show(){
|
||||||
time--;
|
|
||||||
|
|
||||||
Player player = fightPlayer.getPlayer();
|
Player player = fightPlayer.getPlayer();
|
||||||
switch (time) {
|
switch (time) {
|
||||||
case 900: case 600: case 300: case 180: case 120:
|
case 900: case 600: case 300: case 180: case 120:
|
||||||
|
@ -69,14 +69,6 @@ public class FightScoreboard implements Listener, ScoreboardCallback {
|
|||||||
SWScoreboard.removeScoreboard(event.getPlayer());
|
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(){
|
private void generalScoreboard(){
|
||||||
setTitle("§eKampf");
|
setTitle("§eKampf");
|
||||||
List<String> scoreList = new ArrayList<>();
|
List<String> scoreList = new ArrayList<>();
|
||||||
@ -105,16 +97,20 @@ 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() {
|
private void updateScoreboard() {
|
||||||
scores.clear();
|
scores.clear();
|
||||||
switch((index++ / 10) % 3){
|
if ((index++ / 5) % 2 == 0) {
|
||||||
case 0:
|
|
||||||
generalScoreboard();
|
generalScoreboard();
|
||||||
break;
|
} else {
|
||||||
case 1:
|
setTitle(Fight.getBlueTeam().getColoredName() + " " + Fight.getRedTeam().getColoredName());
|
||||||
teamScoreboard(Fight.getBlueTeam());
|
teamScoreboard(Fight.getBlueTeam());
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
teamScoreboard(Fight.getRedTeam());
|
teamScoreboard(Fight.getRedTeam());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren