Package net.tnemc.plugincore.core.api
Class CallbackManager
java.lang.Object
net.tnemc.plugincore.core.api.CallbackManager
CallbackManager used to manage specific callbacks.
- Since:
- 0.1.2.0
- Author:
- creatorfromhell
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCallback
(String identifier, CallbackEntry entry) Used to add a new callback into the system.void
addConsumer
(String name, Function<Callback, Boolean> consumer) Used to add a consumer for this callback.boolean
Used to call all the consumers for this callback.
-
Constructor Details
-
CallbackManager
-
-
Method Details
-
addCallback
Used to add a new callback into the system.- Parameters:
identifier
- The identifier of the callback to add.entry
- TheCallbackEntry
, which manages the consumers.
-
addConsumer
Used to add a consumer for this callback. -
call
Used to call all the consumers for this callback.- Parameters:
callback
- The callback class for this consumer.- Returns:
- This returns a boolean value, which equates to whether this event is cancelled or not.
-