当前位置: 首页>>代码示例>>Java>>正文


Java PluginManager.getPlugin方法代码示例

本文整理汇总了Java中org.bukkit.plugin.PluginManager.getPlugin方法的典型用法代码示例。如果您正苦于以下问题:Java PluginManager.getPlugin方法的具体用法?Java PluginManager.getPlugin怎么用?Java PluginManager.getPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.plugin.PluginManager的用法示例。


在下文中一共展示了PluginManager.getPlugin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onEnable

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
@Override
public void onEnable() {
    final PluginManager pm = getServer().getPluginManager();
    this.dynmap = pm.getPlugin("dynmap");
    if (this.dynmap == null) {
        severe("Dynmap not found, disabling Plot2Dynmap");
        return;
    }
    this.dynAPI = (DynmapAPI) this.dynmap;
    this.plot2 = pm.getPlugin("PlotSquared");
    getServer().getPluginManager().registerEvents(this, this);
    
    if (this.dynmap.isEnabled() && this.plot2.isEnabled()) {
        initialize();
    }
}
 
开发者ID:boy0001,项目名称:plot2dynmap,代码行数:17,代码来源:Main.java

示例2: setPermsSystem

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
public void setPermsSystem() {
	PluginManager pm = Bukkit.getServer().getPluginManager();
	for(Plugin pl : pm.getPlugins()){
		if(pl.isEnabled()){
			String plName = pl.getName();
			if(app.contains(plName)){
				permsPlugin = pm.getPlugin(plName);
			}
		}
	}
}
 
开发者ID:DiscowZombie,项目名称:UltimateTs,代码行数:12,代码来源:PermsManager.java

示例3: onEnable

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
@Override
public void onEnable() {
    this.saveDefaultConfig();
    Bukkit.getServer().getPluginManager().registerEvents(new PercentSleepListener(this), this);
    plugin = this;
    PluginManager pm = Bukkit.getServer().getPluginManager();

    // Hook Vanish/Essentials listeners if the plugins exist
    essentials = (IEssentials) Bukkit.getServer().getPluginManager().getPlugin("Essentials");
    if (essentials != null) {
        pm.registerEvents(new PercentSleepEssentialsListener(this), this);
        anyPluginsHooked = true;
        this.getLogger().info("Hooked into Essentials");
    }

    vanish = (VanishPlugin) Bukkit.getServer().getPluginManager().getPlugin("VanishNoPacket");
    if (vanish != null) {
        pm.registerEvents(new PercentSleepVanishListener(this), this);
        anyPluginsHooked = true;
        this.getLogger().info("Hooked into VanishNoPacket");
    }
    if (pm.getPlugin("SuperVanish") != null || pm.getPlugin("PremiumVanish") != null) {
        pm.registerEvents(new SVListener(this), this);
        anyPluginsHooked = true;
        this.getLogger().info("Hooked into SuperVanish/PremiumVanish");
    }

    final List<World> worlds = Bukkit.getWorlds();
    final List<String> ignored = this.getConfig().getStringList("ignored-worlds");

    for (World w: worlds) {
        if (w.getEnvironment().equals(World.Environment.NORMAL) && !ignored.contains(w.getName())) {
            this.worlds.put(w.getName(), new PercentSleepWorld(w));
        }
    }
}
 
开发者ID:disturbedfood,项目名称:PercentSleep,代码行数:37,代码来源:PercentSleep.java

示例4: onEnable

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
@Override
public void onEnable() {
    testCompat();
    if (!isEnabled()) return;

    manager = new NametagManager(this);
    handler = new NametagHandler(this, manager);

    PluginManager pluginManager = Bukkit.getPluginManager();
    if (checkShouldRegister("zPermissions")) {
        pluginManager.registerEvents(new HookZPermissions(handler), this);
    } else if (checkShouldRegister("PermissionsEx")) {
        pluginManager.registerEvents(new HookPermissionsEX(handler), this);
    } else if (checkShouldRegister("GroupManager")) {
        pluginManager.registerEvents(new HookGroupManager(handler), this);
    } else if (checkShouldRegister("LuckPerms")) {
        pluginManager.registerEvents(new HookLuckPerms(handler), this);
    }

    if (pluginManager.getPlugin("LibsDisguises") != null) {
        pluginManager.registerEvents(new HookLibsDisguise(this), this);
    }

    getCommand("ne").setExecutor(new NametagCommand(handler));

    if (api == null) {
        api = new NametagAPI(handler, manager);
    }
}
 
开发者ID:sgtcaze,项目名称:NametagEdit,代码行数:30,代码来源:NametagEdit.java

示例5: loadArenaListeners

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
/**
 * Loads listeners for the Arena plugins.
 * 
 * @param plugin the floAuction instance to pass into the listener
 */
public static void loadArenaListeners(FloAuction plugin) 
{
	PluginManager pluginManager = Bukkit.getPluginManager();
	// Load plugins
	if (ArenaManager.mobArena == null)
	{
		mobArena = (MobArena) pluginManager.getPlugin("MobArena");
	}
	
	if (ArenaManager.mobArena != null) 
	{
		if(!ArenaManager.mobArenaListenerEnabled)
		{
			pluginManager.registerEvents(new MobArenaListener(), plugin);
			ArenaManager.mobArenaListenerEnabled = true;
		}
	}
	
	if (ArenaManager.pvpArena == null)
	{
		ArenaManager.pvpArena = (PVPArena) pluginManager.getPlugin("pvparena");
	}
	
	if (ArenaManager.pvpArena != null)
	{
		if(!ArenaManager.pvpArenaListenerEnabled)
		{
			pluginManager.registerEvents(new PvpArenaListener(), plugin);
			ArenaManager.pvpArenaListenerEnabled = true;
		}
	}
}
 
开发者ID:virustotalop,项目名称:ObsidianAuctions,代码行数:38,代码来源:ArenaManager.java

示例6: loadArenaPlugins

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
/**
 * Attempts to load arena plugins.
 */
public static void loadArenaPlugins() 
{
	PluginManager pluginManager = Bukkit.getPluginManager();
	// Load plugins
	if (mobArena == null) 
	{
		mobArena = (MobArena) pluginManager.getPlugin("MobArena");
	}
	if (pvpArena == null)
	{
		pvpArena = (PVPArena) pluginManager.getPlugin("pvparena");
	}
	if (war == null)
	{
		war = (War) pluginManager.getPlugin("MobDungeon");
	}

	// Unload if not enabled
	if (mobArena != null && !mobArena.isEnabled())
	{
		mobArena = null;
	}
	if (pvpArena != null && !pvpArena.isEnabled())
	{
		pvpArena = null;
	}
	if (war != null && !war.isEnabled())
	{
		war = null;
	}
	
}
 
开发者ID:virustotalop,项目名称:ObsidianAuctions,代码行数:36,代码来源:ArenaManager.java

示例7: registerWorldGuard

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
/**
 * World Guard Dependence
 */

private void registerWorldGuard(){
	PluginManager PM = this.getServer().getPluginManager();
	
	if(PM.getPlugin("WorldGuard") != null){
		wgp = (WorldGuardPlugin) PM.getPlugin("WorldGuard");
		console(ChatColor.GREEN + "WorldGuard Detected");
		return;
	}else{
		console(ChatColor.RED + "WorldGuard Not Found - Please enable WorldGuard");
		return;
	}
	
}
 
开发者ID:applenick,项目名称:RegionFX,代码行数:18,代码来源:RegionFX.java

示例8: isInit

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
public static boolean isInit()
{
	PluginManager pluginManager = Bukkit.getPluginManager();
	Plugin pvpToggle = pluginManager.getPlugin("PvpToggle");
	if(pvpToggle == null || !(pvpToggle instanceof PvpToggle))
		return false;
	return true;
}
 
开发者ID:xgh69,项目名称:PvpToggle,代码行数:9,代码来源:PvpToggle.java

示例9: onEnable

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
@Override
public void onEnable() {
	log.info("enabled...");
	PluginManager pm = getServer().getPluginManager();
	
	dynmap = pm.getPlugin("dynmap");
	api = (DynmapAPI)dynmap;
	
	civcraft = pm.getPlugin("civcraft");

	markerapi = api.getMarkerAPI();
	
	townBorderSet = markerapi.createMarkerSet("townborder.markerset", "Town Borders", null, false);
	townBorderSet.setLayerPriority(10);
	townBorderSet.setHideByDefault(false);
	
	cultureSet = markerapi.createMarkerSet("townculture.markerset", "Culture", null, false);
	cultureSet.setLayerPriority(15);
	cultureSet.setHideByDefault(false);
	
	structureSet = markerapi.createMarkerSet("structures.markerset", "Structures", null, false);
	structureSet.setLayerPriority(20);
	structureSet.setHideByDefault(false);
	
	getServer().getScheduler().scheduleSyncRepeatingTask(this, 
			new CivCraftUpdateTask(this.api, this.markerapi, this.townBorderSet, this.cultureSet, this.structureSet), 40, 40);
}
 
开发者ID:netizen539,项目名称:civcraft,代码行数:28,代码来源:DynmapCivcraftPlugin.java

示例10: setupHooks

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
/**
 * Setup PlotMe plugin hooks
 */
@Override
public void setupHooks() {
    PluginManager pluginManager = plotMeCorePlugin.getServer().getPluginManager();
    if (pluginManager.getPlugin("WorldEdit") != null) {
        WorldEdit.getInstance().getEventBus().register(new PlotWorldEditListener(plotMeCorePlugin.getAPI()));
    }

    setUsingLwc(pluginManager.getPlugin("LWC") != null);
}
 
开发者ID:WorldCretornica,项目名称:PlotMe-Core,代码行数:13,代码来源:BukkitServerBridge.java

示例11: onLoad

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
@Override
public void onLoad()
{
	// Vault Integration
	PluginManager pm = getServer().getPluginManager();
	if (pm.getPlugin("Vault") != null)
	{
		try
		{
			VaultHandler.setupIntegration(this);
		} catch (Throwable ex) { }
	}
}
 
开发者ID:dmulloy2,项目名称:SwornPermissions,代码行数:14,代码来源:SwornPermissions.java

示例12: onEnable

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
@Override
public void onEnable() {
    this.c = new Config(this);
    this.api = new RoyalEconomyAPI(this);

    this.saveLangFile("en_us");

    try {
        new Language.LanguageHelper(new File(this.getDataFolder(), this.getConf().getLanguageFile()));
    } catch (IOException e) {
        this.getLogger().severe("Could not load language file: " + e.getMessage());
        this.getLogger().severe("Disabling plugin.");
        this.setEnabled(false);
    }

    final BukkitScheduler bs = this.getServer().getScheduler();
    bs.scheduleSyncRepeatingTask(this, new UserdataSaver(), 12000L, 12000L);

    final PluginManager pm = this.getServer().getPluginManager();
    pm.registerEvents(new AccountListener(this), this);

    if (pm.getPlugin("Vault") != null && pm.getPlugin("Vault").getClass().getName().equalsIgnoreCase("net.milkbowl.vault.Vault")) {
        VaultConnector.register(this);
    }

    this.registerCommand(new CmdBalance(this), "balance", this);
    this.registerCommand(new CmdModifyBalance(this), "modifybalance", this);
    this.registerCommand(new CmdSetBalance(this), "setbalance", this);
    this.registerCommand(new CmdTransfer(this), "transfer", this);
    this.registerCommand(new CmdRoyalEconomy(this), "royaleconomy", this);
}
 
开发者ID:RoyalDev,项目名称:RoyalEconomy,代码行数:32,代码来源:RoyalEconomy.java

示例13: onEnable

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
public void onEnable() {
    defaultConfig();

    players = new Players(this);

    PluginManager pm = getServer().getPluginManager();

    Plugin plugin = pm.getPlugin("MyVIP");
    if (plugin != null) {
        myVIP = (iMyVIP) plugin;
    }

    colorListener = new ColorListener(this);
    pm.registerEvents(colorListener, this);
    playerListener = new PlayerListener(this);
    pm.registerEvents(playerListener, this);

    if(config.getBoolean("rpg.enable")) {
        Mobs.load(this);



        pm.registerEvents(new RpgListener(this), this);
    } else {
        log("MyLineagePvpSystem: Rpg game disabled by config (rpg.enable)", ANSI_RED);
    }

    getCommand("pvpstatus").setExecutor(new PvpStatusCommand(this));
    getCommand("pvpspawn").setExecutor(new PvpSpawnCommand(this));
    getCommand("pvpsoe").setExecutor(new PvpSoeCommand(this));
    getCommand("pvpcall").setExecutor(new PvpCallCommand(this));
    getCommand("pvphome").setExecutor(new PvpHomeCommand(this));

    log("MyLineagePvpSystem has been enabled!");

    taskId = getServer().getScheduler().scheduleSyncRepeatingTask(this, new ColorTask(this), 0, 20);
    taskIdSoe = getServer().getScheduler().scheduleSyncRepeatingTask(this, new TickerTask(this), 0, 20);
}
 
开发者ID:truekenny,项目名称:MyLineagePvpSystem,代码行数:39,代码来源:MyLineagePvpSystem.java

示例14: setupHookBooleans

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
public void setupHookBooleans() {
    PluginManager plManager = Bukkit.getServer().getPluginManager();
    this.usingLiteBans = plManager.getPlugin("LiteBans") != null;
    this.usingBanManager = plManager.getPlugin("BanManager") != null;
    this.usingEssentials = (plManager.getPlugin("Essentials") != null || plManager.getPlugin("EssentialsX") != null);
}
 
开发者ID:7rory768,项目名称:SimpleFreeze,代码行数:7,代码来源:SimpleFreezeMain.java

示例15: onEnable

import org.bukkit.plugin.PluginManager; //导入方法依赖的package包/类
public void onEnable() {

        setPlugin(this);

        PluginManager pluginManager = getServer().getPluginManager();
        Plugin pluginVault = pluginManager.getPlugin("Vault");
        Plugin pluginWorldGuard = pluginManager.getPlugin("WorldGuard");

        Set<String> pluginList = new HashSet<>();

        if (!new File(getPlugin().getDataFolder(), "config.yml").exists())
            getPlugin().saveResource("config.yml", false);

        initMaterials();

        for (PluginRegisters.RegisterType register : PluginRegisters.RegisterType.values())
            registerMap.put(register.toString(), new PluginRegisters().registerAll(getPlugin(), register));

        setChestDonationInventory(Bukkit.createInventory(getChestDonationHolder(),
                getPlugin().getConfig().getInt("dchest.size"), ChestLanguage.N_DCHEST));

        setChestRandomInventory(Bukkit.createInventory(getChestRandomHolder(),
                getPlugin().getConfig().getInt("rchest.size"), ChestLanguage.N_RCHEST));

        setChestShuffleInventory(Bukkit.createInventory(null,
                getPlugin().getConfig().getInt("schest.size"), ChestLanguage.N_SCHEST));

        setChestSwapInventory(Bukkit.createInventory(getChestSwapHolder(),
                getPlugin().getConfig().getInt("wchest.size"), ChestLanguage.N_WCHEST));

        setChestDonationHolder(chestDonationHolder);
        setChestRandomHolder(chestRandomHolder);
        setChestSwapHolder(chestSwapHolder);

        chestSwapBusy = false;

        if (pluginVault != null) {
            RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(
                    net.milkbowl.vault.economy.Economy.class);
            if (economyProvider != null) {
                setVaultEconomy(economyProvider.getProvider());
                pluginList.add("Vault");
            }
        }

        if (pluginWorldGuard != null) {
            setWorldGuard((WorldGuardPlugin) pluginWorldGuard);
            pluginList.add("WorldGuard");
        }

        for (String c : new String[]{"", "d", "e", "h", "m", "r", "s", "v", "w", "x"}) {
            chestLockoutMap.put(c + "chest", new ConcurrentHashMap<>());
            chestTypeEnabled.put(c + "chest", getPlugin().getConfig().getBoolean(c + "chest.enabled"));
            getCommand(c + "chest").setExecutor(new ChestExecutor());
        }

        chestLockoutMap.put("dchest_itemlock", new ConcurrentHashMap<>());

        getPlugin().getLogger().log(Level.INFO, "[" + plugin.getName() + "] "
                + "Events: " + registerMap.get(PluginRegisters.RegisterType.EVENT.toString()) + " | "
                + "Tasks: " + registerMap.get(PluginRegisters.RegisterType.TASK.toString()));

        if (pluginList.size() > 0)
            getPlugin().getLogger().log(Level.INFO,
                    "[" + plugin.getName() + "] Hooked: " + StringUtils.join(pluginList, ", "));

        new BukkitRunnable() {
            @Override
            public void run() {
                displayClearMessage = true;
            }
        }.runTaskLater(plugin, 100);

    }
 
开发者ID:Ullarah,项目名称:MinecraftPlugins,代码行数:75,代码来源:ChestInit.java


注:本文中的org.bukkit.plugin.PluginManager.getPlugin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。