Advertisement
Guest User

Main

a guest
Sep 7th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | None | 0 0
  1. package me.pommeskiwi.main;
  2.  
  3.  
  4.  
  5. import java.util.HashMap;
  6.  
  7.  
  8. import org.bukkit.entity.Player;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10.  
  11. import me.pommeskiwi.claim.ClaimedChunksFactory;
  12. import me.pommeskiwi.command.ChatClear;
  13. import me.pommeskiwi.command.Claim;
  14. import me.pommeskiwi.command.Discord;
  15. import me.pommeskiwi.command.FallingBlock;
  16. import me.pommeskiwi.command.Fly;
  17. import me.pommeskiwi.command.Gamble;
  18. import me.pommeskiwi.command.GlobalMute;
  19. import me.pommeskiwi.command.Help;
  20. import me.pommeskiwi.command.Kopf;
  21. import me.pommeskiwi.command.Mute;
  22. import me.pommeskiwi.command.Rang;
  23. import me.pommeskiwi.command.SetSpawn;
  24. import me.pommeskiwi.command.Sozialemedien;
  25. import me.pommeskiwi.command.Spawn;
  26. import me.pommeskiwi.command.Tools;
  27. import me.pommeskiwi.command.Tpa;
  28. import me.pommeskiwi.command.TpaAccept;
  29. import me.pommeskiwi.command.VIP;
  30. import me.pommeskiwi.home.command.DelHome;
  31. import me.pommeskiwi.home.command.Home;
  32. import me.pommeskiwi.home.command.HomeList;
  33. import me.pommeskiwi.home.command.SetHome;
  34. import me.pommeskiwi.listener.BlockBreak;
  35. import me.pommeskiwi.listener.BlockPlace;
  36. import me.pommeskiwi.listener.ChunkUnload;
  37. import me.pommeskiwi.listener.EntityListener;
  38. import me.pommeskiwi.listener.InteractListener;
  39. import me.pommeskiwi.listener.InventoryClickListener;
  40. import me.pommeskiwi.listener.JoinListener;
  41. import me.pommeskiwi.listener.PlayerChatEvent;
  42. import me.pommeskiwi.listener.QuitListener;
  43. import me.pommeskiwi.listener.SpawnListener;
  44. import me.pommeskiwi.stats.PlayerStatsFactory;
  45. import me.pommeskiwi.util.Broadcaster;
  46. import me.pommeskiwi.warps.WarpCommand;
  47. import me.pommeskiwi.warps.WarpFactory;
  48. import me.pommeskiwi.warps.Warps;
  49.  
  50. public class Main
  51. extends JavaPlugin
  52. {
  53. public static HashMap<Player, Player> tpa = new HashMap<Player, Player>();
  54. public static String prefix = "";
  55. public static String noperm = "";
  56. public String Mute;
  57. private boolean globalMute;
  58. private PlayerStatsFactory playerStatsFactory;
  59. private ClaimedChunksFactory claimedChunksFactory;
  60. private WarpFactory warpFactory;
  61.  
  62.  
  63.  
  64.  
  65.  
  66. public void onEnable()
  67. {
  68. this.playerStatsFactory = new PlayerStatsFactory();
  69. this.claimedChunksFactory = new ClaimedChunksFactory(this);
  70. this.warpFactory = new WarpFactory();
  71. this.globalMute = false;
  72. new Broadcaster(this);
  73.  
  74. registerCommands();
  75. registerListener();
  76.  
  77.  
  78. }
  79.  
  80. private void registerListener()
  81. {
  82. getServer().getPluginManager().registerEvents(new QuitListener(this), this);
  83. getServer().getPluginManager().registerEvents(new JoinListener(this), this);
  84. getServer().getPluginManager().registerEvents(new PlayerChatEvent(this), this);
  85. getServer().getPluginManager().registerEvents(new InteractListener(this), this);
  86. getServer().getPluginManager().registerEvents(new SpawnListener(), this);
  87. getServer().getPluginManager().registerEvents(new InventoryClickListener(), this);
  88. getServer().getPluginManager().registerEvents(new EntityListener(this), this);
  89. getServer().getPluginManager().registerEvents(new ChunkUnload(), this);
  90. getServer().getPluginManager().registerEvents(new BlockPlace(this.claimedChunksFactory), this);
  91. getServer().getPluginManager().registerEvents(new BlockBreak(this.claimedChunksFactory), this);
  92. getServer().getPluginManager().registerEvents(new Gamble(), this);
  93. }
  94.  
  95. private void registerCommands()
  96. {
  97. getCommand("Discord").setExecutor(new Discord());
  98. getCommand("Help").setExecutor(new Help());
  99. getCommand("Sozialemedien").setExecutor(new Sozialemedien());
  100. getCommand("Rank").setExecutor(new Rang());
  101. getCommand("YouTuber").setExecutor(new VIP());
  102. getCommand("globalmute").setExecutor(new GlobalMute(this));
  103. getCommand("mute").setExecutor(new Mute(this));
  104. getCommand("kopf").setExecutor(new Kopf());
  105. getCommand("fallingBlock").setExecutor(new FallingBlock());
  106. getCommand("fly").setExecutor(new Fly(this));
  107. getCommand("cc").setExecutor(new ChatClear());
  108. getCommand("tools").setExecutor(new Tools(this));
  109. getCommand("setspawn").setExecutor(new SetSpawn());
  110. getCommand("spawn").setExecutor(new Spawn());
  111. getCommand("home").setExecutor(new Home(this));
  112. getCommand("delhome").setExecutor(new DelHome(this));
  113. getCommand("homelist").setExecutor(new HomeList(this));
  114. getCommand("sethome").setExecutor(new SetHome(this));
  115. getCommand("warp").setExecutor(new WarpCommand(this.warpFactory));
  116. getCommand("warps").setExecutor(new Warps(this.warpFactory));
  117. getCommand("tpa").setExecutor(new Tpa());
  118. getCommand("tpaccept").setExecutor(new TpaAccept());
  119. getCommand("spin").setExecutor(new Gamble());
  120. getCommand("claim").setExecutor(new Claim(this.claimedChunksFactory, this.playerStatsFactory));
  121.  
  122.  
  123. }
  124.  
  125. public ClaimedChunksFactory getClaimedChunksFactory()
  126. {
  127. return this.claimedChunksFactory;
  128. }
  129.  
  130. public WarpFactory getWarpFactory()
  131. {
  132. return this.warpFactory;
  133. }
  134.  
  135. public PlayerStatsFactory getPlayerStatsFactory()
  136. {
  137. return this.playerStatsFactory;
  138. }
  139.  
  140. public boolean isGlobalMute()
  141. {
  142. return this.globalMute;
  143. }
  144.  
  145. public void setGlobalMute(boolean arg)
  146. {
  147. this.globalMute = arg;
  148. }
  149.  
  150.  
  151. }
  152.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement