Java 类org.bukkit.plugin.ServicesManager 实例源码

项目:LuckPerms    文件:VaultHookManager.java   
/**
 * 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();
    }
}
项目:SwornAPI    文件:VaultHandler.java   
@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();
}
项目:RuBukkit-Template    文件:IntegrateVault.java   
/**
 * Если 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;
}
项目:RuBukkit-Template    文件:IntegrateVault.java   
/**
 * Если 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;
}
项目:RuBukkit-Template    文件:IntegrateVault.java   
/**
 * Если 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;
}
项目:CloudNet    文件:VaultInvoker.java   
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);
}
项目:LuckPerms    文件:VaultHookManager.java   
/**
 * 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;
    }
}
项目:UniversalCoinsVaultPlugin    文件:UniversalCoinsMain.java   
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.");
    }
}
项目:Gringotts-    文件:Gringotts.java   
/**
 * 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.");
    }
}
项目:mcMMOExtras    文件:McMMOExtras.java   
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();
        }
    }
}
项目:Uranium    文件:CraftServer.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:helper    文件:Helper.java   
public static ServicesManager services() {
    return server().getServicesManager();
}
项目:MockBukkit    文件:ServerMock.java   
@Override
public ServicesManager getServicesManager()
{
    // TODO Auto-generated method stub
    throw new UnimplementedOperationException();
}
项目:FlexMC    文件:FlexServerImpl.java   
@Override
public ServicesManager getServicesManager() {
    throw new UnsupportedOperationException( "Not implemented yet" );
}
项目:netherrack    文件:NetherServer.java   
@Override
public ServicesManager getServicesManager() {
    // TODO Auto-generated method stub
    return null;
}
项目:ThermosRebased    文件:CraftServer.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:Thermos-Bukkit    文件:Bukkit.java   
/**
 * @see Server#getServicesManager()
 */
public static ServicesManager getServicesManager() {
    return server.getServicesManager();
}
项目:Brynhildr    文件:NukkitServer.java   
@Override
public ServicesManager getServicesManager() {
    return null;
}
项目:ExilePearl    文件:TestServer.java   
@Override
public ServicesManager getServicesManager() {
       return servicesManager;
}
项目:SaneEconomy    文件:MockServer.java   
@Override
public ServicesManager getServicesManager() {
    return null;
}
项目:Pokkit    文件:CraftServer.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:Thermos    文件:CraftServer.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:KCauldron    文件:CraftServer.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:CauldronGit    文件:Bukkit.java   
/**
 * @see Server#getServicesManager()
 */
public static ServicesManager getServicesManager() {
    return server.getServicesManager();
}
项目:CauldronGit    文件:CraftServer.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:CanaryBukkit    文件:CanaryServer.java   
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:Cauldron-Old    文件:CraftServer.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:DiffUtils    文件:CraftServer_188.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:DiffUtils    文件:CraftServer_1710.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:Cauldron-Reloaded    文件:CraftServer.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:FFoKC    文件:CraftServer.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:CraftBukkit    文件:CraftServer.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:Chatterbox    文件:VaultMagic.java   
public VaultMagic(@NotNull final ServicesManager manager) {
    Preconditions.checkNotNull(manager, "manager was null");
    this.servicesManager = manager;
    this.setUpPermission();
    this.setUpChat();
}
项目:Craftbukkit    文件:CraftServer.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:Almura-Server    文件:CraftServer.java   
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:SpongeBukkit    文件:VolatileServer.java   
@Override
public ServicesManager getServicesManager()
{
    return currentServer.getServicesManager();
}
项目:Tweakkit-Server    文件:CraftServer.java   
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
项目:Cauldron    文件:Bukkit.java   
/**
 * @see Server#getServicesManager()
 */
public static ServicesManager getServicesManager() {
    return server.getServicesManager();
}
项目:Cauldron    文件:Bukkit.java   
/**
 * @see Server#getServicesManager()
 */
public static ServicesManager getServicesManager() {
    return server.getServicesManager();
}
项目:Cauldron    文件:Bukkit.java   
/**
 * @see Server#getServicesManager()
 */
public static ServicesManager getServicesManager() {
    return server.getServicesManager();
}