Skip to content

Commit

Permalink
Invoking TeamWinEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonUden committed Jan 6, 2024
1 parent c34f2f7 commit a9a0196
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.bukkit.Material;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
Expand Down Expand Up @@ -55,6 +56,7 @@
import net.zeeraa.novacore.spigot.gameengine.module.modules.game.Game;
import net.zeeraa.novacore.spigot.gameengine.module.modules.game.GameEndReason;
import net.zeeraa.novacore.spigot.gameengine.module.modules.game.elimination.PlayerQuitEliminationAction;
import net.zeeraa.novacore.spigot.gameengine.module.modules.game.events.TeamWinEvent;
import net.zeeraa.novacore.spigot.gameengine.module.modules.game.triggers.DelayedGameTrigger;
import net.zeeraa.novacore.spigot.gameengine.module.modules.game.triggers.GameTrigger;
import net.zeeraa.novacore.spigot.gameengine.module.modules.game.triggers.RepeatingGameTrigger;
Expand Down Expand Up @@ -477,9 +479,14 @@ public void onEnd(GameEndReason reason) {

Bukkit.getServer().broadcastMessage(message);

FinalGameMissileWarsGameEndEvent e = new FinalGameMissileWarsGameEndEvent(winner.toTeam(), reason);
Bukkit.getPluginManager().callEvent(e);
// Events
Event e1 = new FinalGameMissileWarsGameEndEvent(winner.toTeam(), reason);
Bukkit.getPluginManager().callEvent(e1);

Event e2 = new TeamWinEvent(teamWin);
Bukkit.getServer().getPluginManager().callEvent(e2);

// Win effect
getGameObject(GameObjectType.WIN).spawn(winner, world);
}
}
Expand Down

0 comments on commit a9a0196

Please sign in to comment.