SteamWar/FightSystem
Archiviert
13
1

Not stable version

Signed-off-by: Yaruma3341 <yaruma3341@gmail.com>
Dieser Commit ist enthalten in:
Yaruma3341 2019-02-23 22:11:53 +01:00
Ursprung 7dc9546c72
Commit 34d24a2476
3 geänderte Dateien mit 8 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -7,6 +7,7 @@ import me.yaruma.fightsystem.fight.FightState;
import me.yaruma.fightsystem.fight.FightTeam; import me.yaruma.fightsystem.fight.FightTeam;
import me.yaruma.fightsystem.manager.FileManager; import me.yaruma.fightsystem.manager.FileManager;
import me.yaruma.fightsystem.utils.countdown.Countdown; import me.yaruma.fightsystem.utils.countdown.Countdown;
import me.yaruma.fightsystem.utils.countdown.CountdownType;
import me.yaruma.fightsystem.utils.countdown.FinishSetupOver; import me.yaruma.fightsystem.utils.countdown.FinishSetupOver;
import me.yaruma.fightsystem.utils.inventory.SetupItems; import me.yaruma.fightsystem.utils.inventory.SetupItems;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -71,6 +72,7 @@ public class PlayerJoinListener implements Listener {
} }
if(Fight.getRedTeam().hasTeamLeader() && Fight.getBlueTeam().hasTeamLeader()) { if(Fight.getRedTeam().hasTeamLeader() && Fight.getBlueTeam().hasTeamLeader()) {
Countdown.cancelTimerType(CountdownType.NO_PLAYERS_ONLINE);
int setupDuration = fileManager.getIntegerFromConfig("Times.SetupDuration"); int setupDuration = fileManager.getIntegerFromConfig("Times.SetupDuration");
Countdown countdown = new Countdown(setupDuration, new FinishSetupOver()); Countdown countdown = new Countdown(setupDuration, new FinishSetupOver());
countdown.startTimer(instance); countdown.startTimer(instance);

Datei anzeigen

@ -58,14 +58,15 @@ public class Countdown {
} }
public static void cancelAllTimers() { public static void cancelAllTimers() {
for(Countdown countdown : countdowns) { for(int i = countdowns.size() - 1; i >= 0; i--) {
countdown.cancelTimer(); countdowns.get(i).cancelTimer();
} }
} }
public static void cancelTimerType(CountdownType countdownType) { public static void cancelTimerType(CountdownType countdownType) {
for(Countdown countdown : countdowns) { for(int i = countdowns.size() - 1; i >= 0; i--) {
if(countdown.getType() == countdownType) countdown.cancelTimer();
if(countdowns.get(i).getType() == countdownType) countdowns.get(i).cancelTimer();
} }
} }

Datei anzeigen

@ -27,7 +27,7 @@ public class Scoreboard {
public void setAutoScoreboard(int delay, Player player) { public void setAutoScoreboard(int delay, Player player) {
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(FightSystem.getPlugin(), new Runnable() { taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(FightSystem.getPlugin(), new Runnable() {
private int index; private int index = 0;
@Override @Override
public void run() { public void run() {