use of pl.themolka.arcade.game.GameManager in project Arcade2 by ShootGame.
the class MapCommands method setNextMap.
private void setNextMap(Sender sender, OfflineMap map, boolean next) {
GameManager games = this.plugin.getGames();
games.setNextRestart(false);
if (next) {
games.getQueue().setNextMap(map);
sender.sendSuccess(map.getName() + " has been set to next in the queue.");
} else {
games.getQueue().addMap(map);
sender.sendSuccess(map.getName() + " has been added to the queue.");
}
}
use of pl.themolka.arcade.game.GameManager in project Arcade2 by ShootGame.
the class MatchGame method onCycleCountdownAutoStart.
@Handler(priority = Priority.LOWEST)
public void onCycleCountdownAutoStart(MatchEndedEvent event) {
if (!this.isAutoCycle()) {
// auto cycle is disabled
return;
}
GameManager games = event.getPlugin().getGames();
Countdown countdown;
if (games.isNextRestart()) {
countdown = games.getRestartCountdown();
if (!countdown.isTaskRunning()) {
((RestartCountdown) countdown).setDefaultDuration();
}
} else {
countdown = games.getCycleCountdown();
if (!countdown.isTaskRunning()) {
((CycleCountdown) countdown).setDefaultDuration();
}
}
if (!countdown.isTaskRunning()) {
countdown.countSync();
}
}
Aggregations