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


Java PluginDisableEvent.getPlugin方法代碼示例

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


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

示例1: onPluginDisable

import org.bukkit.event.server.PluginDisableEvent; //導入方法依賴的package包/類
@EventHandler
public void onPluginDisable(PluginDisableEvent event) {
    if (event.getPlugin() != Core.getInstance()) // KCv4 isn't unloading.
        return;
    Core.logInfo("Shutting down...");
    getMechanics().forEach(Mechanic::onDisable); // Unload all mechanics.
}
 
開發者ID:Kneesnap,項目名稱:Kineticraft,代碼行數:8,代碼來源:MechanicManager.java

示例2: on

import org.bukkit.event.server.PluginDisableEvent; //導入方法依賴的package包/類
@EventHandler
public void on(PluginDisableEvent event)
{
    if (event.getPlugin() == api.getPlugin() && api.getConfig().canShutDownOnDisable())
    {
        Messenger.send("&c[&fOpGuard was disabled&c] Shutting server down.");
        Bukkit.shutdown();
    }
}
 
開發者ID:RezzedUp,項目名稱:OpGuard,代碼行數:10,代碼來源:PluginDisableHijack.java

示例3: pluginDisable

import org.bukkit.event.server.PluginDisableEvent; //導入方法依賴的package包/類
@EventHandler
private void pluginDisable(PluginDisableEvent event) {
    if (menus == null || menus.isEmpty()) {
        return;
    }
    List<Menu> menusClone = new ArrayList<Menu>(menus);
    for (Menu menu : menusClone) {
        if (menu.plugin == event.getPlugin()) {
            menu.destroyMenu();
        }
    }
}
 
開發者ID:GameBoxx,項目名稱:GameBoxx,代碼行數:13,代碼來源:Menu.java

示例4: onPluginDisable

import org.bukkit.event.server.PluginDisableEvent; //導入方法依賴的package包/類
@EventHandler
public void onPluginDisable(PluginDisableEvent e) {
    Plugin plugin = e.getPlugin();
    PluginHook hook = getActiveHook(plugin);
    if (hook == null) return;
    try {
        hook.onPluginDisable(plugin);
    } catch (Exception e1) {
        this.plugin.logException(new InvalidPluginHookException(e1));
    }
    hook.setPlugin(null);
    activeHooks.remove(hook);
}
 
開發者ID:MyzelYam,項目名稱:SuperVanish,代碼行數:14,代碼來源:PluginHookMgr.java

示例5: onPluginDisable

import org.bukkit.event.server.PluginDisableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginDisable(PluginDisableEvent event)
{

    if (perms != null)
    {
        Plugin permPlugin = event.getPlugin();
        if (permPlugin.getDescription().getName().equals("BungeePerms"))
        {
            perms = null;
            log.info(String.format("[%s][Chat] %s unhooked.", plugin.getDescription().getName(), name));
        }
    }
}
 
開發者ID:weaondara,項目名稱:BungeePerms,代碼行數:15,代碼來源:Chat_BungeePerms.java

示例6: onPluginDisable

import org.bukkit.event.server.PluginDisableEvent; //導入方法依賴的package包/類
/**
 * Check for disabled plugin to remove the associated replacer
 *
 * @param disableEvent the disable event
 */
@EventHandler
public void onPluginDisable(PluginDisableEvent disableEvent) {
    //Remove the listener if the associated plugin was disabled
    Plugin disablePlugin = disableEvent.getPlugin();

    replaceManager.unregisterAll(disablePlugin);
}
 
開發者ID:games647,項目名稱:ScoreboardStats,代碼行數:13,代碼來源:PluginListener.java

示例7: onPluginDisable

import org.bukkit.event.server.PluginDisableEvent; //導入方法依賴的package包/類
/**
 * Method called when a plugin is being disabled.
 *
 * @param event Event instance.
 */
public void onPluginDisable(PluginDisableEvent event) {
    // Get the plugin instance and name
    Plugin plugin = event.getPlugin();
    String pluginName = plugin.getName();

    // Is the WorldGuard plugin disabled
    if (isSupportedPlugin(plugin)) {
        this.log.info(pluginName + " plugin disabled, updating hooks!");
        setup();
    }
}
 
開發者ID:timvisee,項目名稱:GlowstoneLanterns,代碼行數:17,代碼來源:PermissionsManager.java

示例8: onPluginDisable

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

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

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

    if ("Essentials".equalsIgnoreCase(pluginName)) {
        pluginHookService.unhookEssentials();
        ConsoleLogger.info("Essentials has been disabled: unhooking");
    } else if ("CMI".equalsIgnoreCase(pluginName)) {
        pluginHookService.unhookCmi();
        spawnLoader.unloadCmiSpawn();
        ConsoleLogger.info("CMI has been disabled: unhooking");
    } else if ("Multiverse-Core".equalsIgnoreCase(pluginName)) {
        pluginHookService.unhookMultiverse();
        ConsoleLogger.info("Multiverse-Core has been disabled: unhooking");
    } else if ("EssentialsSpawn".equalsIgnoreCase(pluginName)) {
        spawnLoader.unloadEssentialsSpawn();
        ConsoleLogger.info("EssentialsSpawn has been disabled: unhooking");
    } else if ("ProtocolLib".equalsIgnoreCase(pluginName)) {
        protocolLibService.disable();
        ConsoleLogger.warning("ProtocolLib has been disabled, unhooking packet adapters!");
    }
}
 
開發者ID:AuthMe,項目名稱:AuthMeReloaded,代碼行數:31,代碼來源:ServerListener.java

示例9: onPluginDisable

import org.bukkit.event.server.PluginDisableEvent; //導入方法依賴的package包/類
@EventHandler
public void onPluginDisable(PluginDisableEvent event) {
    if(event.getPlugin() == Arcadia.getPlugin(Arcadia.class)) {
        destroy();
    }
}
 
開發者ID:ArcadiaPlugins,項目名稱:Arcadia-Spigot,代碼行數:7,代碼來源:Freeze.java

示例10: onDisable

import org.bukkit.event.server.PluginDisableEvent; //導入方法依賴的package包/類
@EventHandler
public void onDisable(PluginDisableEvent e) {
	if (e.getPlugin() == NationZ.plugin) {
		NationZ.restart(false);
	}
}
 
開發者ID:crazyhorse961,項目名稱:NationZ,代碼行數:7,代碼來源:ConnectionListener.java

示例11: disable

import org.bukkit.event.server.PluginDisableEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void disable(PluginDisableEvent e) {
	if(e.getPlugin() != TinyProtocolAPI.getPlugin(TinyProtocolAPI.class)) return;
	Bukkit.getOnlinePlayers().forEach((player) -> remove(player));
}
 
開發者ID:Zahusek,項目名稱:-XclsX-TPAv3-XclsX-,代碼行數:6,代碼來源:TabAPI.java

示例12: onPluginDisable

import org.bukkit.event.server.PluginDisableEvent; //導入方法依賴的package包/類
@EventHandler(ignoreCancelled = true)
public void onPluginDisable(PluginDisableEvent event) {
    Plugin plugin = event.getPlugin();
    cachedLoaders.put(plugin.getClass().getClassLoader(), plugin);
}
 
開發者ID:games647,項目名稱:LagMonitor,代碼行數:6,代碼來源:BlockingActionManager.java

示例13: onPluginDisable

import org.bukkit.event.server.PluginDisableEvent; //導入方法依賴的package包/類
@EventHandler
public void onPluginDisable(PluginDisableEvent event) {
    if (event.getPlugin() != plugin) {
        plugin.getPlaceholderManager().unregisterMappings(event.getPlugin());
    }
}
 
開發者ID:csh,項目名稱:placeholders,代碼行數:7,代碼來源:PlaceholderPlugin.java

示例14: onPluginDisable

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

示例15: onPluginDisable

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


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