documentation/Modded PythonLoader
PythonLoader Mod
Most tutorial projects i made use the modded PythonLoader version i made. It adds a few features to the original PythonLoader, and should be compatible with any plugins made for the official version.
Features
- 2 additional decorators,
@EventHandlerand@CommandHandler - both can do the same as
@hook.eventand@hook.command, but are enhanced for usage with classes. - You can decorate bound (instance) methods, staticmethods and classmethods with them, provided the class inherits
PythonPluginorListener - both
PythonLoaderandListenerare available by default without any imports - In addition to normal usage you can also use
@EventHandlerwithout specifying an event type, and it will try to infer it from the function name. For an eventorg.bukkit.event.category.SomeNameEventthe function can be called eitherSomeNameoronSomeName, it will automatically work outcategory - For now, all instances with decorated handlers need to be instantiated before
onEnable(so normally in__init__), after thathookfreezes handler registration
Source
The source is available at the github page of the fork i created
Comments