org.bukkit.plugin.ServicesManager Java Examples

The following examples show how to use org.bukkit.plugin.ServicesManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VaultHookManager.java    From LuckPerms with MIT License 6 votes vote down vote up
/**
 * Registers the LuckPerms implementation of {@link Permission} and {@link Chat} with
 * the service manager.
 */
public void hook() {
    try {
        if (this.permission == null) {
            this.permission = new LuckPermsVaultPermission(this.plugin);
        }

        if (this.chat == null) {
            this.chat = new LuckPermsVaultChat(this.plugin, this.permission);
        }

        final ServicesManager sm = this.plugin.getBootstrap().getServer().getServicesManager();
        sm.register(Permission.class, this.permission, this.plugin.getBootstrap(), ServicePriority.High);
        sm.register(Chat.class, this.chat, this.plugin.getBootstrap(), ServicePriority.High);

    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example #2
Source File: VaultInvoker.java    From CloudNet with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example #3
Source File: VaultHookManager.java    From LuckPerms with MIT License 5 votes vote down vote up
/**
 * Unregisters the LuckPerms Vault hooks, if present.
 */
public void unhook() {
    final ServicesManager sm = this.plugin.getBootstrap().getServer().getServicesManager();

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

    if (this.chat != null) {
        sm.unregister(Chat.class, this.chat);
        this.chat = null;
    }
}
 
Example #4
Source File: Helper.java    From helper with MIT License 4 votes vote down vote up
public static ServicesManager services() {
    return server().getServicesManager();
}
 
Example #5
Source File: MockServer.java    From SaneEconomy with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ServicesManager getServicesManager() {
    return null;
}
 
Example #6
Source File: CraftServer.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ServicesManager getServicesManager() {
    return servicesManager;
}
 
Example #7
Source File: Server.java    From Kettle with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Gets a services manager.
 *
 * @return s services manager
 */
public ServicesManager getServicesManager();
 
Example #8
Source File: Bukkit.java    From Kettle with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Gets a services manager.
 *
 * @return s services manager
 */
public static ServicesManager getServicesManager() {
    return server.getServicesManager();
}