-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
RPF is extremely easy to initialise, on any project. The first step is to ensure RPF and any modules you're using are being shaded into your project. Follow one of the build tool guides if you're unaware on how to do this.
Once your build tool is sorted out, the first step is to get an instance of FrameworkBuilder.
Framework.builder()
Do not create the builder via any other means, this is the only way you should create a FrameworkBuilder. Once you've got a builder instance, there's several fields you'll need to fill. The required ones are the main class, the package, and the command prefix. Optional ones currently include startup registerables, shutdown registerables, and files. Once the configuration is done, you can build and begin the bootstrap process by chaining build() and init().
Here's an example:
public final class Example {
private Example() {
Framework.builder()
.main(Example.class, this)
.pckg("me.piggypiglet.example")
.commandPrefix("!")
.build()
.init();
}
public static void main(String[] args) {
new Example();
}
}
It's that simple, from there, RPF will find and register anything that's registerable, enable addons, generate files, etc.
NOTE: To have multiple files, simply chain the file method.