Class AutoRegister
java.lang.Object
com.miketheshadow.autoregister.util.ReflectionBase
com.miketheshadow.autoregister.api.AutoRegister
The core class of this tool. Automatically reads the jar file and
attempts to register any listener and command available.
Commands need to be annotated with
RegisterCommand
Listeners need to extend Spigots Listener class.-
Field Summary
Fields inherited from class com.miketheshadow.autoregister.util.ReflectionBase
classes, debugLogging, force, initialPackageFound, packageName, plugin -
Constructor Summary
ConstructorsConstructorDescriptionAutoRegister(org.bukkit.plugin.Plugin plugin, String packageName) AutoRegister(org.bukkit.plugin.Plugin plugin, String packageName, boolean forceRegister) -
Method Summary
Modifier and TypeMethodDescriptionvoidThis is what should be used by default.voidRegisters all commandsvoidvoidRegisters all listener classesMethods inherited from class com.miketheshadow.autoregister.util.ReflectionBase
collectAllClasses, debugLog, enableDebugMessages, error, forceLoadAllClasses, getClasses, getClassesAnnotatedWith
-
Constructor Details
-
AutoRegister
- Parameters:
plugin- Your plugin. Do not pass in another plugin but your own into this method, or you will end up with weird/bad side effectspackageName- A package path using . as the separator. Example: com.miketheshadow.autoregister Where autoregister is the base package directory. Do not pass in something like com. or com.name as this could have the unintended effect of registering any library's listeners as well.
-
AutoRegister
-
-
Method Details
-
defaultSetup
public void defaultSetup()This is what should be used by default. Unless you have your own custom auto-registry this method will handle the registering of commands and listeners for you. -
registerListeners
public void registerListeners()Registers all listener classes -
registerCommands
public void registerCommands()Registers all commands -
registerFullCommands
public void registerFullCommands() -
getListeners
- Returns:
- returns a Set of classes that implement Spigot's Listener class
-