Advertisement
Guest User

Main-IBR3

a guest
May 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. package com.infogroup.infoboard;
  2.  
  3. import com.comphenix.protocol.ProtocolLibrary;
  4. import com.comphenix.protocol.ProtocolManager;
  5. import com.infogroup.infoboard.animations.AnimationManager;
  6. import com.infogroup.infoboard.commands.CmdManager;
  7. import com.infogroup.infoboard.events.PlayerJoin;
  8. import com.infogroup.infoboard.events.QuitEvent;
  9. import com.infogroup.infoboard.hooks.PAPI;
  10. import com.infogroup.infoboard.hooks.WorldGuard;
  11. import com.infogroup.infoboard.scoreboard.BoardManager;
  12. import com.infogroup.infoboard.scoreboard.InfoBoardManager;
  13. import com.infogroup.infoboard.scoreboard.Timer;
  14. import com.infogroup.infoboard.utils.Settings;
  15. import com.infogroup.infoboard.utils.UpdateChecker;
  16. import org.bukkit.plugin.PluginManager;
  17. import org.bukkit.plugin.java.JavaPlugin;
  18.  
  19.  
  20. public final class InfoBoardReborn extends JavaPlugin {
  21.  
  22. public boolean update = false;
  23.  
  24. private AnimationManager AM;
  25.  
  26. private UpdateChecker UC;
  27. private Settings settings;
  28. private InfoBoardManager IBM;
  29. private ProtocolManager PM;
  30. private Timer T;
  31. private BoardManager BM;
  32. private CmdManager CM;
  33.  
  34. //Hooks
  35. private WorldGuard WG;
  36. private PAPI PAPI;
  37.  
  38. @Override
  39. public void onEnable() {
  40.  
  41. this.Instances();
  42. IBM.loadAllBoards();
  43.  
  44. //Events
  45. this.registerEvents();
  46.  
  47. //Commands
  48. getCommand("InfoBoard").setExecutor(this.CM);
  49.  
  50. }
  51.  
  52. @Override
  53. public void onDisable() {
  54. // Plugin shutdown logic
  55.  
  56. this.T.stop();
  57. }
  58.  
  59. /**
  60. * Instances classes
  61. */
  62. private void Instances(){
  63. this.AM = new AnimationManager(this);
  64. this.UC = new UpdateChecker(this);
  65. this.settings = new Settings(this);
  66. this.IBM = new InfoBoardManager(this);
  67. this.BM = new BoardManager(this);
  68. this.CM = new CmdManager(this);
  69. this.PM = ProtocolLibrary.getProtocolManager();
  70. //See what has to happen with this:
  71. this.T = new Timer(this);
  72.  
  73. //HOOKS
  74. this.WG = new WorldGuard(this);
  75. this.PAPI = new PAPI(this);
  76.  
  77.  
  78. }
  79.  
  80. /**
  81. * Register events
  82. */
  83. private void registerEvents(){
  84. PluginManager pm = getServer().getPluginManager();
  85. pm.registerEvents(new PlayerJoin(this), this);
  86. pm.registerEvents(new QuitEvent(this), this);
  87. }
  88.  
  89. /**
  90. * Get the AnimationManager
  91. * @return AnimationManager
  92. */
  93. public AnimationManager getAM() {
  94. return this.AM;
  95. }
  96.  
  97. /**
  98. * Get the UpdateChecker
  99. * @return UpdateChecker
  100. */
  101. public UpdateChecker getUC(){
  102. return this.UC;
  103. }
  104.  
  105. /**
  106. * Get the Settings
  107. * @return Settings
  108. */
  109. public Settings getSettings(){
  110. return this.settings;
  111. }
  112.  
  113. /**
  114. * Get the InfoBoardManager
  115. * @return InfoBoardManager
  116. */
  117. public InfoBoardManager getIBM() {
  118. return this.IBM;
  119. }
  120.  
  121. /**
  122. * Get the ProtocolManager instanced in ProtocolLib
  123. * @return ProtocolManager
  124. */
  125. public ProtocolManager getPM(){
  126. return this.PM;
  127. }
  128.  
  129. /**
  130. * Get the Timer
  131. * @return Timer
  132. */
  133. public Timer getT() {
  134. return this.T;
  135. }
  136.  
  137. /**
  138. * Get the BoardManager
  139. * @return BoardManager
  140. */
  141. public BoardManager getBM(){
  142. return this.BM;
  143. }
  144.  
  145. /**
  146. * Get the WorldGuard hook class
  147. *
  148. * @return WorldGuard
  149. */
  150. public WorldGuard getWG() {
  151. return this.WG;
  152. }
  153.  
  154. /**
  155. * Get the Command Manager
  156. *
  157. * @return CmdManager
  158. */
  159. public CmdManager getCM() {
  160. return this.CM;
  161. }
  162.  
  163. /**
  164. * Get the PAPI hook class
  165. *
  166. * @return PAPI
  167. */
  168. public PAPI getPAPI() {
  169. return this.PAPI;
  170. }
  171. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement