本文整理匯總了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();
}