Repository navigation
API
The API is very easy. With the API you can create and modify your handler.
If you want to create a new handler, create a new class and implement the IRewardHandler<T> interface. The interface need a generic. The generic, is the reward for the handler. Example: If you want to drop itemstacks, then is your generic ItemStack [See my handler, for more examples]. Now, you have a few methods.
Every listener need 3 fields:
String handlerName - The name for the handler
Location location - The location from the luckyblock
int repeat - If the handler repeat the handle() method (0 for not repeat)
The handle() method is the main method for a handler. In this method, you must implement the code, where called when the luckyblock will open
The setLocation(Location paramLocation) and the setRepeat(int repeat) method, are only the two setter methods, for the location and repeat field. The handlerName field, must be in the constructor.
getHandlerName() and getRewardObject() are the two getter methods.
So, now you have the IRewardHandler methods. And now, you have the serialize method. Here is a link, for a serialization tutorial.
Now, you have the handler class.
Go in your onEnable method and call: MoreLuckyBlocks.getInstance().registerRewardHandler(Class<? extends IRewardHandler> aClass) and, register your custom handler class. And now you must call HandlerRegistry.getRegistry().registerCustomHandler(IRewardHandler iRewardHandler). Now is your handler finish.