jbwm / Modularize

Enhanced plugin development. Split your plugin into flexible modules.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modularize

Enhanced plugin development. Split your plugin into flexible modules.

Using API in your plugin

Maven

<!-- Repository -->
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
<!-- Dependency-->
<dependencies>
    <dependency>
        <groupId>com.github.jbwm</groupId>
        <artifactId>Modularize</artifactId>
        <version>1.3.0</version>
    </dependency>
</dependencies>

Usage

Register module manager on plugin startup image

@Module annotation register class as Module.

@Listen annotation automatically register class as Listener.

@Command annotation register command. It has few optional and required parameters. image

Nothing else is required, you don't have to register command or listener manually in main class. You don't need also to fill plugin.yml

Don't forget that TabExecutor or Listener interfaces are still required.

CommandExecutor is currently not supported, instead use TabExecutor which force usage of tab completer.

Initializable

Use interface initializable on class, if you want to do something during initialization. (Load inventories, load data from config and so on.) image

Reloadable

Use interface reloadable on class, if you want to do something when module is reloaded. image

Modularization and config

if class is annotated with @Module AND @Listen or @Command, it becomes a module.

Annotated class is added to config.yml to path 'modules.<module_name>'. You don't have to add it manually, it will be added manually with value true.

image

Built in module management

Reloading specific module

image

Reloading all modules at once.

image

Note: Reloading also affect default config.yml -> If you disabled specific module in config.yml change will be affected, and module enabled/disabled.

Code samples

Code samples are available in example directory in project

About

Enhanced plugin development. Split your plugin into flexible modules.

License:MIT License


Languages

Language:Java 100.0%