Search in sources :

Example 76 with PluginManager

use of org.bukkit.plugin.PluginManager in project SiegeWar by TownyAdvanced.

the class SiegeWar method registerListeners.

private void registerListeners() {
    PluginManager pm = getServer().getPluginManager();
    if (siegeWarPluginError)
        pm.registerEvents(new SiegeWarSafeModeListener(this), this);
    else {
        pm.registerEvents(new SiegeWarActionListener(this), this);
        pm.registerEvents(new SiegeWarBukkitEventListener(this), this);
        pm.registerEvents(new SiegeWarTownyEventListener(this), this);
        pm.registerEvents(new SiegeWarNationEventListener(), this);
        pm.registerEvents(new SiegeWarTownEventListener(this), this);
        pm.registerEvents(new SiegeWarPlotEventListener(this), this);
        pm.registerEvents(new SiegeWarStatusScreenListener(), this);
    }
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) SiegeWarStatusScreenListener(com.gmail.goosius.siegewar.listeners.SiegeWarStatusScreenListener) SiegeWarPlotEventListener(com.gmail.goosius.siegewar.listeners.SiegeWarPlotEventListener) SiegeWarActionListener(com.gmail.goosius.siegewar.listeners.SiegeWarActionListener) SiegeWarTownEventListener(com.gmail.goosius.siegewar.listeners.SiegeWarTownEventListener) SiegeWarNationEventListener(com.gmail.goosius.siegewar.listeners.SiegeWarNationEventListener) SiegeWarBukkitEventListener(com.gmail.goosius.siegewar.listeners.SiegeWarBukkitEventListener) SiegeWarTownyEventListener(com.gmail.goosius.siegewar.listeners.SiegeWarTownyEventListener) SiegeWarSafeModeListener(com.gmail.goosius.siegewar.listeners.SiegeWarSafeModeListener)

Example 77 with PluginManager

use of org.bukkit.plugin.PluginManager in project InventoryHelper by SrBlecaute01.

the class InventoryHelper method enable.

/**
 * Enable inventory helper.
 *
 * @param plugin The @{@link Plugin}
 */
public static void enable(Plugin plugin) {
    if (enabled)
        return;
    PluginManager manager = Bukkit.getPluginManager();
    manager.registerEvents(new InventoryClickListener(), plugin);
    enabled = true;
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) InventoryClickListener(br.com.blecaute.inventory.listener.InventoryClickListener)

Example 78 with PluginManager

use of org.bukkit.plugin.PluginManager in project acidisland by tastybento.

the class ASkyBlock method restartEvents.

public void restartEvents() {
    final PluginManager manager = getServer().getPluginManager();
    lavaListener = new LavaCheck(this);
    manager.registerEvents(lavaListener, this);
    // Enables warp signs in ASkyBlock
    warpSignsListener = new WarpSigns(this);
    manager.registerEvents(warpSignsListener, this);
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) LavaCheck(com.wasteofplastic.acidisland.listeners.LavaCheck)

Example 79 with PluginManager

use of org.bukkit.plugin.PluginManager in project Bukkit by Bukkit.

the class Permission method addParent.

/**
 * Adds this permission to the specified parent permission.
 * <p>
 * If the parent permission does not exist, it will be created and
 * registered.
 *
 * @param name Name of the parent permission
 * @param value The value to set this permission to
 * @return Parent permission it created or loaded
 */
public Permission addParent(String name, boolean value) {
    PluginManager pm = Bukkit.getServer().getPluginManager();
    String lname = name.toLowerCase();
    Permission perm = pm.getPermission(lname);
    if (perm == null) {
        perm = new Permission(lname);
        pm.addPermission(perm);
    }
    addParent(perm, value);
    return perm;
}
Also used : PluginManager(org.bukkit.plugin.PluginManager)

Example 80 with PluginManager

use of org.bukkit.plugin.PluginManager in project HawkEye by oliverwoodings.

the class HawkEye method onEnable.

/**
 * Starts up HawkEye initiation process
 */
@Override
public void onEnable() {
    // Set up config and permissions
    PluginManager pm = getServer().getPluginManager();
    server = getServer();
    name = this.getDescription().getName();
    version = this.getDescription().getVersion();
    Util.info("Starting HawkEye " + version + " initiation process...");
    // Load config and permissions
    config = new Config(this);
    new Permission(this);
    versionCheck();
    new SessionManager();
    // Initiate database connection
    try {
        new DataManager(this);
    } catch (Exception e) {
        Util.severe("Error initiating HawkEye database connection, disabling plugin");
        pm.disablePlugin(this);
        return;
    }
    checkDependencies(pm);
    containerManager = new ContainerAccessManager();
    registerListeners(pm);
    registerCommands();
    Util.info("Version " + version + " enabled!");
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) Config(uk.co.oliwali.HawkEye.util.Config) Permission(uk.co.oliwali.HawkEye.util.Permission) DataManager(uk.co.oliwali.HawkEye.database.DataManager)

Aggregations

PluginManager (org.bukkit.plugin.PluginManager)148 Plugin (org.bukkit.plugin.Plugin)33 JavaPlugin (org.bukkit.plugin.java.JavaPlugin)20 Permission (org.bukkit.permissions.Permission)16 MetricsWrapper (com.earth2me.essentials.metrics.MetricsWrapper)14 Player (org.bukkit.entity.Player)14 Test (org.junit.Test)13 SimplePluginManager (org.bukkit.plugin.SimplePluginManager)12 Map (java.util.Map)11 File (java.io.File)9 IOException (java.io.IOException)9 World (org.bukkit.World)9 PluginCommand (org.bukkit.command.PluginCommand)9 Command (org.bukkit.command.Command)8 Listener (org.bukkit.event.Listener)8 PluginDescriptionFile (org.bukkit.plugin.PluginDescriptionFile)8 HashMap (java.util.HashMap)7 EventHandler (org.bukkit.event.EventHandler)7 ArrayList (java.util.ArrayList)6 Bukkit (org.bukkit.Bukkit)6