Package net.ME1312.Galaxi.Plugin
Class PluginManager
java.lang.Object
net.ME1312.Galaxi.Plugin.PluginManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommand
(Command command, String... handles) Registers a Command<T extends Event>
booleanexecuteEvent
(Class<T> type, T event) Run an Event (as its super class)boolean
executeEvent
(Event event) Run an EventgetListeners
(Class<? extends Event> type) Get Registered Event ListenersGets a PluginGets a Pluginabstract PluginInfo
Gets a Pluginabstract Map<String,
PluginInfo> Get a map of the Pluginsfinal <T extends Event>
voidregisterListener
(PluginInfo plugin, Class<T> event, Number order, Listener<? extends T>... listeners) Register Event Listenersfinal <T extends Event>
voidregisterListener
(PluginInfo plugin, Class<T> event, Listener<? extends T>... listeners) Register Event Listenersvoid
registerListeners
(PluginInfo plugin, Object... listeners) Register Event Listenersvoid
removeCommand
(String... handles) Unregisters a Commandvoid
unregisterListeners
(PluginInfo plugin) Unregister Event Listenersvoid
unregisterListeners
(PluginInfo plugin, Object... listeners) Unregister Event Listeners
-
Constructor Details
-
PluginManager
public PluginManager()
-
-
Method Details
-
getPlugins
Get a map of the Plugins- Returns:
- PluginInfo Map
-
getPlugin
Gets a Plugin- Parameters:
name
- Plugin Name- Returns:
- PluginInfo
-
getPlugin
Gets a Plugin- Parameters:
main
- Plugin Main Class- Returns:
- PluginInfo
-
getPlugin
Gets a Plugin- Parameters:
main
- Plugin Object- Returns:
- PluginInfo
-
addCommand
Registers a Command- Parameters:
command
- Commandhandles
- Aliases
-
removeCommand
Unregisters a Command- Parameters:
handles
- Aliases
-
registerListeners
Register Event Listeners- Parameters:
plugin
- Pluginlisteners
- Listeners- See Also:
-
registerListener
@SafeVarargs public final <T extends Event> void registerListener(PluginInfo plugin, Class<T> event, Listener<? extends T>... listeners) Register Event Listeners- Type Parameters:
T
- Event Type- Parameters:
plugin
- Pluginevent
- Event Typelisteners
- Listeners
-
registerListener
@SafeVarargs public final <T extends Event> void registerListener(PluginInfo plugin, Class<T> event, Number order, Listener<? extends T>... listeners) Register Event Listeners- Type Parameters:
T
- Event Type- Parameters:
plugin
- Pluginevent
- Event Typeorder
- Listener Order (will convert to short)listeners
- Listeners- See Also:
-
getListeners
Get Registered Event Listeners- Parameters:
type
- Event Type- Returns:
- Event Listeners
-
unregisterListeners
Unregister Event Listeners- Parameters:
plugin
- Plugin
-
unregisterListeners
Unregister Event Listeners- Parameters:
plugin
- Pluginlisteners
- Listeners
-
executeEvent
Run an Event- Parameters:
event
- Event
-
executeEvent
Run an Event (as its super class)- Type Parameters:
T
- Event Type- Parameters:
type
- Super Classevent
- Event- Returns:
- true if the event was not cancelled
-