RepositoryKit 1.0

Unifies a ServiceManager and a HookManager for BungeeCord and Bukkit.

  1. BeneIO
    About.png
    The RepositoryKit provides a ServiceManager and a HookManager for BungeeCord as well as Bukkit in one single API. The API of the ServiceManager is the good old known one form the Bukkit API. This Kit brings it also to BungeeCord. That means you are now able to create one API that can be used on Bukkit as well as on BungeeCord! The goal of this idea is to give developers a uniform possibility to create APIs for Bukkit and BungeeCord and unify the registration.


    Developers.png
    The API for Services
    Registering a service:
    Code (Text):
    RepositoryKit.getServicesManager().register(SomeAPI.class, new SomeAPIImplementation(), null, ServicePriority.NORMAL);
    The third argument can be null. In later updates it will get some sense.

    Getting a registration:
    Code (Text):
    SomeAPI api = RepositoryKit.getServicesManager().getRegistration(SomeAPI.class);

    The API for Hooks:
    Registering a hook:
    Code (Text):
    RepositoryKit.getHookManager().registerHook("SomePlugin", new MyHook(), ImportanceLevel.OPTIONAL);
    Implementing the Hook interface:
    Code (Text):
    public class MyHook implements Hook {
     
        @Override
        public void onHook(String pluginName, ImportanceLevel importanceLevel, boolean successfullyHooked) {
         
            if (successfullyHooked) {
                // DO SOMETHING
            } else {
                // TO SOMETHING ELSE
            }
        }
    }
    (All the code above works on Bukkit as well as on BungeeCord.)


    Source.png
    Will be available with the next update.