vendredi 11 septembre 2015

Create Provider failed

I want to implement my API with:

private boolean setupGameAPI() {
    if (getServer().getPluginManager().getPlugin("GameAPI") != null) {
        System.out.println("GameAPI found");
        RegisteredServiceProvider<GameAPI> GameAPIProvider = getServer().getServicesManager().getRegistration(GameAPI.class);
        if (GameAPIProvider != null) {
            gameapi = GameAPIProvider.getProvider();
            System.out.println("GameAPIProvider found");
        } else {
            System.out.println("GameAPIProvider not found");
        }
        return (gameapi != null);
    } else {
        System.out.println("GameAPI not found");
    }
    return false;
}

The output is:

[16:55:07] [Server thread/INFO]: GameAPI found
[16:55:07] [Server thread/INFO]: GameAPIProvider not found

The question how can I do it so that GameAPIProvider is not null? Maybe I have to add something in my API.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire