Developer API: Dependent Functions - BoBoBalloon/InnovativeItemsDOCS GitHub Wiki

Intro

When I refer to functions, I refer to anything that extends the InnovativeFunction<T> class. This includes both keywords and conditions. Not only can you register keywords and conditions with the function manager, but you can also check if a plugin is installed, and if not the plugin will not register the function. This allows you to make functions that only enable if a plugin is installed.

This is useful if you have a function that uses another plugins api that would throw an error if said plugin was not installed.

Example

@Override
public void onLoad() {
    FunctionManager functionManager = InnovativeItemsAPI.getFunctionManager();

    Keyword keyword = null; //null for the purpose of the example, if you use null it will throw a null pointer

    functionManager.registerKeyword("WorldEdit", keyword);
}

This would only register the keyword if a plugin by the name of "WorldEdit" was present in the plugins folder. If the plugin is not present, the method would silently fail.