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


Java ServicesManager類代碼示例

本文整理匯總了Java中org.bukkit.plugin.ServicesManager的典型用法代碼示例。如果您正苦於以下問題:Java ServicesManager類的具體用法?Java ServicesManager怎麽用?Java ServicesManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: hook

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
/**
 * Registers the LuckPerms implementation of {@link Permission} and {@link Chat} with
 * the service manager.
 *
 * @param plugin the plugin
 */
public void hook(LPBukkitPlugin plugin) {
    try {
        if (this.permissionHook == null) {
            this.permissionHook = new VaultPermissionHook(plugin);
        }

        if (this.chatHook == null) {
            this.chatHook = new VaultChatHook(plugin, this.permissionHook);
        }

        final ServicesManager sm = plugin.getServer().getServicesManager();
        sm.register(Permission.class, this.permissionHook, plugin, ServicePriority.High);
        sm.register(Chat.class, this.chatHook, plugin, ServicePriority.High);

    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
開發者ID:lucko,項目名稱:LuckPerms,代碼行數:25,代碼來源:VaultHookManager.java

示例2: onEnable

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
@Override
public void onEnable()
{
	ServicesManager sm = handler.getServer().getServicesManager();

	RegisteredServiceProvider<Permission> permProvider = sm.getRegistration(Permission.class);
	if (permProvider != null)
		perm = permProvider.getProvider();

	RegisteredServiceProvider<Economy> econProvider = sm.getRegistration(Economy.class);
	if (econProvider != null)
		econ = econProvider.getProvider();

	RegisteredServiceProvider<Chat> chatProvider = sm.getRegistration(Chat.class);
	if (chatProvider != null)
		chat = chatProvider.getProvider();
}
 
開發者ID:dmulloy2,項目名稱:SwornAPI,代碼行數:18,代碼來源:VaultHandler.java

示例3: getVaultChat

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
/**
 * Если Vault установлен на сервере и включён, а также имеется какой-нибудь плагин,
 * предоставляющий нужный интерфейс, он будет возвращён, иначе будет возвращено null.
 * @return net.milkbowl.vault.chat.Chat
 */
public Chat getVaultChat()
{
	if(chat == null)
	{
		if(plugin.getServer().getPluginManager().isPluginEnabled("Vault"))
		{
			plugin.logger.info("Found Vault! Searching for chat plugin...");
			final ServicesManager servicesManager = plugin.getServer().getServicesManager();
			RegisteredServiceProvider<Chat> provider = servicesManager.getRegistration(Chat.class);
			if(provider != null)
				chat = provider.getProvider();
			if(chat != null && chat.isEnabled())
				plugin.logger.log(Level.INFO, "Using {0} as chat provider.", chat.getName());
		}
	}
	return chat;
}
 
開發者ID:RuBukkit,項目名稱:RuBukkit-Template,代碼行數:23,代碼來源:IntegrateVault.java

示例4: getVaultEconomy

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
/**
 * Если Vault установлен на сервере и включён, а также имеется какой-нибудь плагин,
 * предоставляющий нужный интерфейс, он будет возвращён, иначе будет возвращено null.
 * @return net.milkbowl.vault.economy.Economy
 */
public Economy getVaultEconomy()
{
	if(economy == null)
	{
		if(plugin.getServer().getPluginManager().isPluginEnabled("Vault"))
		{
			plugin.logger.info("Found Vault! Searching for economy plugin...");
			final ServicesManager servicesManager = plugin.getServer().getServicesManager();
			RegisteredServiceProvider<Economy> provider = servicesManager.getRegistration(Economy.class);
			if(provider != null)
				economy = provider.getProvider();
			if(economy != null && economy.isEnabled())
				plugin.logger.log(Level.INFO, "Using {0} as chat provider.", economy.getName());
		}
	}
	return economy;
}
 
開發者ID:RuBukkit,項目名稱:RuBukkit-Template,代碼行數:23,代碼來源:IntegrateVault.java

示例5: getVaultPermission

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
/**
 * Если Vault установлен на сервере и включён, а также имеется какой-нибудь плагин,
 * предоставляющий нужный интерфейс, он будет возвращён, иначе будет возвращено null.
 * @return net.milkbowl.vault.permission.Permission
 */
public Permission getVaultPermission()
{
	if(permission == null)
	{
		if(plugin.getServer().getPluginManager().isPluginEnabled("Vault"))
		{
			plugin.logger.info("Found Vault! Searching for permission plugin...");
			final ServicesManager servicesManager = plugin.getServer().getServicesManager();
			RegisteredServiceProvider<Permission> provider = servicesManager.getRegistration(Permission.class);
			if(provider != null)
				permission = provider.getProvider();
			if(permission != null && permission.isEnabled())
				plugin.logger.log(Level.INFO, "Using {0} as chat provider.", permission.getName());
		}
	}
	return permission;
}
 
開發者ID:RuBukkit,項目名稱:RuBukkit-Template,代碼行數:23,代碼來源:IntegrateVault.java

示例6: invoke

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
public static void invoke()
{
    ServicesManager servicesManager = BukkitBootstrap.getPlugin(BukkitBootstrap.class).getServer().getServicesManager();

    Permission permission = new VaultPermissionImpl();

    servicesManager.register(Permission.class, permission, BukkitBootstrap.getPlugin(BukkitBootstrap.class), ServicePriority.Highest);
    servicesManager.register(Chat.class, new VaultChatImpl(permission), BukkitBootstrap.getPlugin(BukkitBootstrap.class), ServicePriority.Highest);
}
 
開發者ID:Dytanic,項目名稱:CloudNet,代碼行數:10,代碼來源:VaultInvoker.java

示例7: unhook

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
/**
 * Unregisters the LuckPerms Vault hooks, if present.
 *
 * @param plugin the plugin
 */
public void unhook(LPBukkitPlugin plugin) {
    final ServicesManager sm = plugin.getServer().getServicesManager();

    if (this.permissionHook != null) {
        sm.unregister(Permission.class, this.permissionHook);
        this.permissionHook.getExecutor().shutdown();
        this.permissionHook = null;
    }

    if (this.chatHook != null) {
        sm.unregister(Chat.class, this.chatHook);
        this.chatHook = null;
    }
}
 
開發者ID:lucko,項目名稱:LuckPerms,代碼行數:20,代碼來源:VaultHookManager.java

示例8: setupEconomy

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
private void setupEconomy() {
	if (getServer().getPluginManager().getPlugin("Vault") != null) {
		final ServicesManager sm = getServer().getServicesManager();
		sm.register(Economy.class, new UCEconomy(), this, ServicePriority.Highest);
		System.out.println("Universal Coins: Registered Vault interface.");
	} else {
		System.out.println("Universal Coins: Vault not detected. Initialization failed.");
	}
}
 
開發者ID:notabadminer,項目名稱:UniversalCoinsVaultPlugin,代碼行數:10,代碼來源:UniversalCoinsMain.java

示例9: registerEconomy

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
/**
 * Register Gringotts as economy provider for vault.
 */
private void registerEconomy() {
    if (DEP.vault.exists()) {
        final ServicesManager sm = getServer().getServicesManager();
        sm.register(Economy.class, new VaultConnector(), this, ServicePriority.Highest);
        log.info("Registered Vault interface.");
    } else {
        log.info("Vault not found. Other plugins may not be able to access Gringotts accounts.");
    }
}
 
開發者ID:sakunc,項目名稱:Gringotts-,代碼行數:13,代碼來源:Gringotts.java

示例10: setupPermissions

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
private void setupPermissions() {
    if (getServer().getPluginManager().isPluginEnabled("Vault")) {
        ServicesManager serviceManager = getServer().getServicesManager();
        RegisteredServiceProvider<Permission> permissionProvider = serviceManager.getRegistration(Permission.class);
        if (permissionProvider != null) {
            permission = permissionProvider.getProvider();
        }
    }
}
 
開發者ID:games647,項目名稱:mcMMOExtras,代碼行數:10,代碼來源:McMMOExtras.java

示例11: getServicesManager

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:5,代碼來源:CraftServer.java

示例12: services

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
public static ServicesManager services() {
    return server().getServicesManager();
}
 
開發者ID:lucko,項目名稱:helper,代碼行數:4,代碼來源:Helper.java

示例13: getServicesManager

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
@Override
public ServicesManager getServicesManager()
{
	// TODO Auto-generated method stub
	throw new UnimplementedOperationException();
}
 
開發者ID:seeseemelk,項目名稱:MockBukkit,代碼行數:7,代碼來源:ServerMock.java

示例14: getServicesManager

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
@Override
public ServicesManager getServicesManager() {
    throw new UnsupportedOperationException( "Not implemented yet" );
}
 
開發者ID:lukas81298,項目名稱:FlexMC,代碼行數:5,代碼來源:FlexServerImpl.java

示例15: getServicesManager

import org.bukkit.plugin.ServicesManager; //導入依賴的package包/類
@Override
public ServicesManager getServicesManager() {
	// TODO Auto-generated method stub
	return null;
}
 
開發者ID:netherrack,項目名稱:netherrack,代碼行數:6,代碼來源:NetherServer.java


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