MyPlugin.java

//package name and import
package my.package.location.myplugin
import com.craftererer.boardgamesapi.BoardGame

//this class is the main plugin class. BoardGame implements Bukkits JavaPlugin
public class MyPlugin extends BoardGame {

	@Override
	public void onEnable() {
		RESTARTING = false; // if restarting is true, end/queue timers will be bypassed 
		CONFIG = new MyConfig(this); // used for interfacing with the config file
		LISTENER = new MyListener(this); // listener settings
		GAMEBOARD = new MyBoard(this); // board creation and usage
		COMMANDS = new MyCommands(this); // handles the commands
		GAME = new MyGame(this); // game settings

		CONFIG.startPlugin(); //starts the board game plugin
		GAMEBOARD.setProtection(); //sets board protection

		// Register events and commands
		getServer().getPluginManager().registerEvents(LISTENER, this);
		getCommand("mycommand").setExecutor(COMMANDS);

		LOG.info(getName() + "Plugin enabled."); // output to console
	}

	@Override
	public void onDisable() {
		RESTARTING = true; // set restarting to true to bypass timers
		GAME.stopAllGames(); // stops all games
		LOG.info(getName() + " Plugin disabled."); // output to console 
	}
}

Comments

Posts Quoted:
Reply
Clear All Quotes