當前位置: 首頁>>代碼示例>>Java>>正文


Java PluginEnableEvent.getPlugin方法代碼示例

本文整理匯總了Java中org.bukkit.event.server.PluginEnableEvent.getPlugin方法的典型用法代碼示例。如果您正苦於以下問題:Java PluginEnableEvent.getPlugin方法的具體用法?Java PluginEnableEvent.getPlugin怎麽用?Java PluginEnableEvent.getPlugin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bukkit.event.server.PluginEnableEvent的用法示例。


在下文中一共展示了PluginEnableEvent.getPlugin方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST)
public void onPluginEnable(PluginEnableEvent event) {
    // Make sure the plugin instance isn't null
    if (event.getPlugin() == null) {
        return;
    }

    final String pluginName = event.getPlugin().getName();

    // Call the onPluginEnable method in the permissions manager
    permissionsManager.onPluginEnable(pluginName);

    if ("Essentials".equalsIgnoreCase(pluginName)) {
        pluginHookService.tryHookToEssentials();
    } else if ("Multiverse-Core".equalsIgnoreCase(pluginName)) {
        pluginHookService.tryHookToMultiverse();
    } else if ("EssentialsSpawn".equalsIgnoreCase(pluginName)) {
        spawnLoader.loadEssentialsSpawn();
    } else if ("CMI".equalsIgnoreCase(pluginName)) {
        pluginHookService.tryHookToCmi();
        spawnLoader.loadCmiSpawn();
    } else if ("ProtocolLib".equalsIgnoreCase(pluginName)) {
        protocolLibService.setup();
    }
}
 
開發者ID:AuthMe,項目名稱:AuthMeReloaded,代碼行數:26,代碼來源:ServerListener.java

示例2: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event) {
    Plugin p = event.getPlugin();
    String name = p.getDescription().getName();
    if (name.equals("dynmap") || name.equals("WorldGuard")) {
        if (this.cubitDynmap.dynmap.isEnabled() && CubitBukkitPlugin.inst().getWorldGuardPlugin().isEnabled())
            this.cubitDynmap.initialize();
    }
}
 
開發者ID:MineGaming,項目名稱:cubit,代碼行數:10,代碼來源:PluginLoadListener.java

示例3: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority=EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event) {
    Plugin p = event.getPlugin();
    String name = p.getDescription().getName();
    if(name.equals("dynmap")) {
        if(dynmap.isEnabled())
            activate(dynmap);
    }
}
 
開發者ID:tastybento,項目名稱:beaconz,代碼行數:10,代碼來源:OurServerListener.java

示例4: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(ignoreCancelled = true)
public void onPluginEnable(final PluginEnableEvent event) {
    final Plugin plugin = event.getPlugin();
    if (!plugin.getName().equals("Vault")) return;
    this.factionsHook.deinit();
    this.factionsHook.init();
}
 
開發者ID:Chatterbox,項目名稱:hooks,代碼行數:8,代碼來源:ServerListener.java

示例5: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(ignoreCancelled = true)
public void onPluginEnable(final PluginEnableEvent event) {
    final Plugin plugin = event.getPlugin();
    if (!plugin.getName().equals("Vault")) return;
    this.vaultHook.deinit();
    this.vaultHook.init();
}
 
開發者ID:Chatterbox,項目名稱:Chatterbox,代碼行數:8,代碼來源:ServerListener.java

示例6: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(final PluginEnableEvent event) {
    final Plugin p = event.getPlugin();
    final String name = p.getDescription().getName();
    if (name.equals("dynmap")) {
        if (this.dynmap.isEnabled() && this.plot2.isEnabled()) {
            initialize();
        }
    }
}
 
開發者ID:boy0001,項目名稱:plot2dynmap,代碼行數:11,代碼來源:Main.java

示例7: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.LOW)
public void onPluginEnable(PluginEnableEvent event) {
    if (event.getPlugin() != plugin) {
        // Try to load again!
        Perms.onOtherPluginEnable();
        plugin.getTreasury().onOtherPluginEnable();
    }
}
 
開發者ID:ModernDayPlayer,項目名稱:SurvivalGamesX,代碼行數:9,代碼來源:ServerListener.java

示例8: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
void onPluginEnable(PluginEnableEvent event) {
    if (ENABLED || !event.getPlugin().getName().equals("WorldGuard")) return;
    try {
        ENABLED = event.getPlugin() instanceof WorldGuardPlugin;
    } catch (Exception ignored) {
    }
}
 
開發者ID:DemigodsRPG,項目名稱:Stoa,代碼行數:9,代碼來源:WorldGuardUtil.java

示例9: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(final PluginEnableEvent event) {
    if (this.economy.economy == null) {
        final Plugin ec = event.getPlugin();
        if (ec.getClass().getName().equals("org.royaldev.royaleconomy.RoyalEconomy")) {
            final String version = ec.getDescription().getVersion();
            VaultConnector.this.name += version;
            this.economy.economy = (RoyalEconomy) ec;
            VaultConnector.this.plugin.getLogger().info("Hooked into Vault!");
        }
    }
}
 
開發者ID:RoyalDev,項目名稱:RoyalEconomy,代碼行數:13,代碼來源:VaultConnector.java

示例10: onPluginEnabled

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler
public void onPluginEnabled(PluginEnableEvent event) {
	if(event.getPlugin()==this) return;
	PluginDescriptionFile desc = event.getPlugin().getDescription();
	String name = this.getName();
	if( this.containsIgnoreCase(desc.getDepend(), name) || this.containsIgnoreCase(desc.getSoftDepend(), name)) {
		this.usedBy.add(desc.getFullName());
	}
}
 
開發者ID:DevCybran,項目名稱:Controllable-Mobs-API,代碼行數:10,代碼來源:ControllableMobsAPIPlugin.java

示例11: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event)
{
    if (perms == null)
    {
        Plugin p = event.getPlugin();
        if (p.getDescription().getName().equals("BungeePerms"))
        {
            perms = BungeePerms.getInstance();
            log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
        }
    }
}
 
開發者ID:weaondara,項目名稱:BungeePerms,代碼行數:14,代碼來源:Permission_BungeePerms.java

示例12: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event)
{
    if (perms == null)
    {
        Plugin p = event.getPlugin();
        if (p.getDescription().getName().equals("BungeePerms"))
        {
            perms = BungeePerms.getInstance();
            log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), name));
        }
    }
}
 
開發者ID:weaondara,項目名稱:BungeePerms,代碼行數:14,代碼來源:Chat_BungeePerms.java

示例13: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
void onPluginEnable(PluginEnableEvent event) {
    if (ENABLED || !event.getPlugin().getName().equals("WorldGuard")) return;
    try {
        ENABLED = event.getPlugin() instanceof WorldGuardPlugin;
        if (ENABLED) {
            for (Flag<?> flag : flags.values())
                registerFlag(flag);
            callOnEnable();
        }
    } catch (Exception ignored) {
    }
}
 
開發者ID:DemigodsRPG,項目名稱:Demigods3,代碼行數:14,代碼來源:WorldGuards.java

示例14: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event) {
    if (manager == null) {
        Plugin permPlugin = event.getPlugin();
        if (permPlugin.getDescription().getName().equals(name)) {
            totalperms = (TotalPermissions) permPlugin;
            manager = totalperms.getManager();
            log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
        }
    }
}
 
開發者ID:Realmcraft,項目名稱:Vault,代碼行數:12,代碼來源:Permission_TotalPermissions.java

示例15: onPluginEnable

import org.bukkit.event.server.PluginEnableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event) {
    if (!hooked) {
        Plugin p = event.getPlugin();
        if(p.getDescription().getName().equals("bPermissions") && p.isEnabled()) {
            hooked = true;
            log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
        }
    }
}
 
開發者ID:Realmcraft,項目名稱:Vault,代碼行數:11,代碼來源:Permission_bPermissions2.java


注:本文中的org.bukkit.event.server.PluginEnableEvent.getPlugin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。