Estou tentando e tendo dificuldades em fazer com que o TVT fique com horário fixo.
Exemplo na "events.properties":
# Times TvT will occur (24h format).
TvTEventInterval = 00:00,02:00,04:00,06:00,08:00,10:00,13:34,14:00,16:00,18:00,20:00,22:00
Tem um pequeno erro nesse código que faz com que somente o time ganhador seja teleportado de volta e removido do evento.
Correção:
// Check the winning team.
TeamType teamWinner = TeamType.NONE;
if (_state != EventState.INITIAL)
{
// Tied teams
if (_blueTeamKills == _redTeamKills && !Config.REWARD_DIE)
World.announceToOnlinePlayers("TvT Event: Event ended in a Tie. No rewards will be given!", true);
else if (_blueTeamKills > _redTeamKills)
teamWinner = TeamType.BLUE;
else
teamWinner = TeamType.RED;
if (teamWinner == TeamType.NONE)
World.announceToOnlinePlayers("TvT Event: The event ends in a draw!");
else
{
for (Player player : World.getInstance().getPlayers())
{
if (player == null)
continue;
// Prizes are awarded to the winning team.
if (player.getTeam() == teamWinner)
{
for (IntIntHolder reward : Config.TVT_REWARDS)
player.addItem("TvTReward", reward.getId(), reward.getValue(), null, true);
}
}
}
for (Player player : World.getInstance().getPlayers())
{
if (player.isDead())
player.doRevive();
removePlayer(player);
player.teleToLocation(player.getOriginalCoordinates());
}
}
_blueTeam.clear();
_redTeam.clear();
_blueTeamKills = 0;
_redTeamKills = 0;
}