当前位置: 首页>>代码示例>>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;未经允许,请勿转载。