Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.infogroup.infoboard;
- import com.comphenix.protocol.ProtocolLibrary;
- import com.comphenix.protocol.ProtocolManager;
- import com.infogroup.infoboard.animations.AnimationManager;
- import com.infogroup.infoboard.commands.CmdManager;
- import com.infogroup.infoboard.events.PlayerJoin;
- import com.infogroup.infoboard.events.QuitEvent;
- import com.infogroup.infoboard.hooks.PAPI;
- import com.infogroup.infoboard.hooks.WorldGuard;
- import com.infogroup.infoboard.scoreboard.BoardManager;
- import com.infogroup.infoboard.scoreboard.InfoBoardManager;
- import com.infogroup.infoboard.scoreboard.Timer;
- import com.infogroup.infoboard.utils.Settings;
- import com.infogroup.infoboard.utils.UpdateChecker;
- import org.bukkit.plugin.PluginManager;
- import org.bukkit.plugin.java.JavaPlugin;
- public final class InfoBoardReborn extends JavaPlugin {
- public boolean update = false;
- private AnimationManager AM;
- private UpdateChecker UC;
- private Settings settings;
- private InfoBoardManager IBM;
- private ProtocolManager PM;
- private Timer T;
- private BoardManager BM;
- private CmdManager CM;
- //Hooks
- private WorldGuard WG;
- private PAPI PAPI;
- @Override
- public void onEnable() {
- this.Instances();
- IBM.loadAllBoards();
- //Events
- this.registerEvents();
- //Commands
- getCommand("InfoBoard").setExecutor(this.CM);
- }
- @Override
- public void onDisable() {
- // Plugin shutdown logic
- this.T.stop();
- }
- /**
- * Instances classes
- */
- private void Instances(){
- this.AM = new AnimationManager(this);
- this.UC = new UpdateChecker(this);
- this.settings = new Settings(this);
- this.IBM = new InfoBoardManager(this);
- this.BM = new BoardManager(this);
- this.CM = new CmdManager(this);
- this.PM = ProtocolLibrary.getProtocolManager();
- //See what has to happen with this:
- this.T = new Timer(this);
- //HOOKS
- this.WG = new WorldGuard(this);
- this.PAPI = new PAPI(this);
- }
- /**
- * Register events
- */
- private void registerEvents(){
- PluginManager pm = getServer().getPluginManager();
- pm.registerEvents(new PlayerJoin(this), this);
- pm.registerEvents(new QuitEvent(this), this);
- }
- /**
- * Get the AnimationManager
- * @return AnimationManager
- */
- public AnimationManager getAM() {
- return this.AM;
- }
- /**
- * Get the UpdateChecker
- * @return UpdateChecker
- */
- public UpdateChecker getUC(){
- return this.UC;
- }
- /**
- * Get the Settings
- * @return Settings
- */
- public Settings getSettings(){
- return this.settings;
- }
- /**
- * Get the InfoBoardManager
- * @return InfoBoardManager
- */
- public InfoBoardManager getIBM() {
- return this.IBM;
- }
- /**
- * Get the ProtocolManager instanced in ProtocolLib
- * @return ProtocolManager
- */
- public ProtocolManager getPM(){
- return this.PM;
- }
- /**
- * Get the Timer
- * @return Timer
- */
- public Timer getT() {
- return this.T;
- }
- /**
- * Get the BoardManager
- * @return BoardManager
- */
- public BoardManager getBM(){
- return this.BM;
- }
- /**
- * Get the WorldGuard hook class
- *
- * @return WorldGuard
- */
- public WorldGuard getWG() {
- return this.WG;
- }
- /**
- * Get the Command Manager
- *
- * @return CmdManager
- */
- public CmdManager getCM() {
- return this.CM;
- }
- /**
- * Get the PAPI hook class
- *
- * @return PAPI
- */
- public PAPI getPAPI() {
- return this.PAPI;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement