本文整理汇总了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.
}
示例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();
}
}
示例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();
}
}
}
示例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);
}
示例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));
}
}
}
示例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);
}
示例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();
}
}
示例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!");
}
}
示例9: onPluginDisable
import org.bukkit.event.server.PluginDisableEvent; //导入方法依赖的package包/类
@EventHandler
public void onPluginDisable(PluginDisableEvent event) {
if(event.getPlugin() == Arcadia.getPlugin(Arcadia.class)) {
destroy();
}
}
示例10: onDisable
import org.bukkit.event.server.PluginDisableEvent; //导入方法依赖的package包/类
@EventHandler
public void onDisable(PluginDisableEvent e) {
if (e.getPlugin() == NationZ.plugin) {
NationZ.restart(false);
}
}
示例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));
}
示例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);
}
示例13: onPluginDisable
import org.bukkit.event.server.PluginDisableEvent; //导入方法依赖的package包/类
@EventHandler
public void onPluginDisable(PluginDisableEvent event) {
if (event.getPlugin() != plugin) {
plugin.getPlaceholderManager().unregisterMappings(event.getPlugin());
}
}
示例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();
}
示例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();
}