Search in sources :

Example 1 with BattleSessionStartedEvent

use of com.gmail.goosius.siegewar.events.BattleSessionStartedEvent in project SiegeWar by TownyAdvanced.

the class SiegeWarBattleSessionUtil method startBattleSession.

public static void startBattleSession() {
    BattleSession battleSession = BattleSession.getBattleSession();
    battleSession.setActive(true);
    // Set the start time
    battleSession.setStartTime(System.currentTimeMillis());
    // Set the scheduled end time
    battleSession.setScheduledEndTime(System.currentTimeMillis() + (SiegeWarSettings.getWarSiegeBattleSessionsDurationMinutes() * 60000));
    // Clear the scheduled start time
    battleSession.setScheduledStartTime(null);
    // Send up the Bukkit event for other plugins to listen for.
    Bukkit.getPluginManager().callEvent(new BattleSessionStartedEvent());
    // Send global message to let the server know that the battle session started
    Messaging.sendGlobalMessage(Translatable.of("msg_war_siege_battle_session_started"));
    // Start the bossbar for the Battle Session
    BossBarUtil.updateBattleSessionBossBar();
}
Also used : BattleSession(com.gmail.goosius.siegewar.objects.BattleSession) BattleSessionStartedEvent(com.gmail.goosius.siegewar.events.BattleSessionStartedEvent)

Aggregations

BattleSessionStartedEvent (com.gmail.goosius.siegewar.events.BattleSessionStartedEvent)1 BattleSession (com.gmail.goosius.siegewar.objects.BattleSession)1