use of com.gmail.stefvanschiedev.buildinggame.utils.guis.SubjectMenu in project buildinggame by stefvanschie.
the class Arena method nextMatch.
/**
* Moves on to the next match or stops the game if all matches have been played. This won't cancel any timers, and
* if called incorrectly this will mess with the arena resulting in incorrect behaviour.
*
* @since 4.0.6
*/
public void nextMatch() {
YamlConfiguration arenas = SettingsManager.getInstance().getArenas();
setState(GameState.WAITING);
this.lobbyTimer = new LobbyTimer(arenas.getInt(name + ".lobby-timer"), this);
this.buildTimer = new BuildTimer(arenas.getInt(name + ".timer"), this);
this.voteTimer = new VoteTimer(arenas.getInt(name + ".vote-timer"), this);
this.winTimer = new WinTimer(arenas.getInt(name + ".win-timer"), this);
voteScoreboards.replaceAll((plot, voteScoreboard) -> new VoteScoreboard(this));
subject = null;
setFirstPlot(null);
setSecondPlot(null);
setThirdPlot(null);
getVotedPlots().clear();
getUsedPlots().forEach(plot -> {
plot.getTimesVoted().clear();
plot.getVotes().clear();
plot.getAllGamePlayers().forEach(gamePlayer -> {
var player = gamePlayer.getPlayer();
player.setPlayerTime(player.getWorld().getFullTime(), true);
player.resetPlayerWeather();
});
});
getPlots().forEach(plot -> {
plot.restore();
var entities = plot.getEntities();
entities.keySet().forEach(Entity::remove);
entities.clear();
});
subjectMenu = new SubjectMenu();
SignManager.getInstance().updateJoinSigns(this);
if (matches == maxMatches)
stop();
else
postStart();
}
Aggregations