//package name and importpackagemy.package.location.mypluginimportcom.craftererer.boardgamesapi.BoardGame//this class is the main plugin class. BoardGame implements Bukkits JavaPluginpublicclassMyPluginextendsBoardGame{@OverridepublicvoidonEnable(){RESTARTING=false;// if restarting is true, end/queue timers will be bypassed CONFIG=newMyConfig(this);// used for interfacing with the config fileLISTENER=newMyListener(this);// listener settingsGAMEBOARD=newMyBoard(this);// board creation and usageCOMMANDS=newMyCommands(this);// handles the commandsGAME=newMyGame(this);// game settingsCONFIG.startPlugin();//starts the board game pluginGAMEBOARD.setProtection();//sets board protection// Register events and commandsgetServer().getPluginManager().registerEvents(LISTENER,this);getCommand("mycommand").setExecutor(COMMANDS);LOG.info(getName()+"Plugin enabled.");// output to console}@OverridepublicvoidonDisable(){RESTARTING=true;// set restarting to true to bypass timersGAME.stopAllGames();// stops all gamesLOG.info(getName()+" Plugin disabled.");// output to console }}
Comments
To post a comment, please login or register a new account.
Comments