Search in sources :

Example 1 with CoreCommand

use of me.robotoraccoon.stablemaster.commands.CoreCommand in project StableMaster by RobotoRaccoon.

the class StableMaster method onEnable.

/**
 * Called once when the plugin is instantiated
 */
@Override
public void onEnable() {
    plugin = this;
    pluginFolder = getDataFolder();
    stablesFolder = new File(pluginFolder + File.separator + "stables");
    createDataFolders();
    // Load in config data
    StableUtil.loadConfigData();
    // Register listeners
    PluginManager pm = getServer().getPluginManager();
    pm.registerEvents(new EntityDamageListeners(), this);
    pm.registerEvents(new EntityDeathListener(), this);
    pm.registerEvents(new EntityTameListener(), this);
    pm.registerEvents(new PlayerInteractEntityListener(), this);
    pm.registerEvents(new PlayerJoinListener(), this);
    pm.registerEvents(new PlayerQuitListener(), this);
    // Register commands
    this.getCommand("stablemaster").setExecutor(new CoreCommand());
    // Load all stables for players already online
    for (Player p : this.getServer().getOnlinePlayers()) {
        StableUtil.loadStable(p);
    }
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) Player(org.bukkit.entity.Player) OfflinePlayer(org.bukkit.OfflinePlayer) File(java.io.File) CoreCommand(me.robotoraccoon.stablemaster.commands.CoreCommand)

Aggregations

File (java.io.File)1 CoreCommand (me.robotoraccoon.stablemaster.commands.CoreCommand)1 OfflinePlayer (org.bukkit.OfflinePlayer)1 Player (org.bukkit.entity.Player)1 PluginManager (org.bukkit.plugin.PluginManager)1