Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. package com.squallz.wispclasses.events;
  2.  
  3. import com.squallz.nations.NationsMain;
  4. import com.squallz.nations.objects.NPlayer;
  5. import com.squallz.nations.objects.Nation;
  6. import com.squallz.wispclasses.ClassesMain;
  7. import com.squallz.wispclasses.objects.CPlayer;
  8. import org.bukkit.entity.Player;
  9. import org.bukkit.event.Event;
  10. import org.bukkit.event.HandlerList;
  11.  
  12. public abstract class AbilityEvent extends Event {
  13.  
  14. private HandlerList HANDLERS_LIST = new HandlerList();
  15.  
  16. private Player player;
  17. private Nation nation;
  18. private NPlayer nPlayer;
  19. private CPlayer cPlayer;
  20.  
  21. public HandlerList getHandlers() {
  22. return HANDLERS_LIST;
  23. }
  24.  
  25. public AbilityEvent(Player player) {
  26. this.player = player;
  27.  
  28. NPlayer playerNPlayer = NationsMain.getInstance().nPlayerManager.getNPlayerByUUID(player.getUniqueId());
  29. CPlayer playerCPlayer = ClassesMain.getInstance().cPlayerManager.getCPlayerByUUID(player.getUniqueId());
  30.  
  31. this.cPlayer = playerCPlayer;
  32. this.nPlayer = playerNPlayer;
  33.  
  34. if(playerNPlayer.hasNation()) {
  35. this.nation = playerNPlayer.getNation();
  36. } else {
  37. this.nation = null;
  38. }
  39. }
  40.  
  41. public Player getPlayer() {
  42. return player;
  43. }
  44.  
  45. public Nation getNation() {
  46. return nation;
  47. }
  48.  
  49. public CPlayer getCplayer() {
  50. return cPlayer;
  51. }
  52.  
  53. public NPlayer getNPlayer() {
  54. return nPlayer;
  55. }
  56.  
  57. public class PlayerUseRushEvent extends AbilityEvent {
  58. public PlayerUseRushEvent(Player player) {
  59. super(player);
  60. }
  61. }
  62.  
  63. public class PlayerUsePullEvent extends AbilityEvent {
  64. public PlayerUsePullEvent(Player player) {
  65. super(player);
  66. }
  67. }
  68.  
  69. public class PlayerUseMoraleBoostEvent extends AbilityEvent {
  70. public PlayerUseMoraleBoostEvent(Player player) {
  71. super(player);
  72. }
  73. }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement