org.bukkit.event.server.ServiceUnregisterEvent Java Examples

The following examples show how to use org.bukkit.event.server.ServiceUnregisterEvent. 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: Economy_Vault.java    From QuickShop-Reremake with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void onServiceUnregister(ServiceUnregisterEvent event) {
    if (!(event.getProvider() instanceof net.milkbowl.vault.economy.Economy)) {
        return;
    }
    setupEconomy();
}
 
Example #2
Source File: ServiceCallback.java    From helper with MIT License 5 votes vote down vote up
private ServiceCallback(Class<T> serviceClass) {
    this.serviceClass = serviceClass;
    refresh();

    // listen for service updates
    this.listener = Events.merge(ServiceEvent.class, ServiceRegisterEvent.class, ServiceUnregisterEvent.class)
            .filter(e -> e.getProvider() != null && e.getProvider().getService().equals(serviceClass))
            .handler(e -> refresh());
}
 
Example #3
Source File: VaultPermissions.java    From uSkyBlock with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
@SuppressWarnings("unused")
public void onPermissionUnregister(ServiceUnregisterEvent event) {
    if (event.getProvider().getProvider() instanceof Permission) {
        this.permission = null;
        setupPermission().ifPresent((permission) -> this.permission = permission);
    }
}
 
Example #4
Source File: VaultEconomy.java    From uSkyBlock with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
@SuppressWarnings("unused")
public void onEconomyUnregister(ServiceUnregisterEvent event) {
    if (event.getProvider().getProvider() instanceof Economy) {
        this.economy = null;
        setupEconomy().ifPresent((economy) -> this.economy = economy);
    }
}