Repository navigation
Getting Started
This API is currently NOT stored within any open maven repository, which means you'll have to clone the GitHub project and install it in your local maven repo manually...
This API is built with the 1.16.5 SpigotAPI, featuring any NMS related content, which means, you'll have to setup NMS if you plan on using it in YOUR build of the project (You can also change the SpigotAPI dependency inside the pom.xml after you clone the project if you don't intend on using NMS)
If you do want to use NMS but don't have it installed yet, you can download the last successful build of BuildTools here
After you have downloaded BuildTools, you can run the following to install a NMS ready SpigotAPI build to your local maven repo:
java -jar BuildTools.jar --rev 1.19.3 # <- CHANGE VERSION NUMBER TO YOUR VERSIONThis API has a built in user manager which stores a list of all registered users as a class instance.
You can specify your own user by creating a class that extends the default User class: RUser
These users will be used to create custom content whenever needed and also store the player
All API Methods will use the User as a parameter whenever a player is needed, to ensure you can always have access to a user instance whenever an action is performed on a player.
You can always access the user manager by calling its getter inside the main class: RPlugin.getInstance().getUserManager()
After successfully installing the project to your local m2, we can actually start working with it!
The first things you need to know, are the 'conventions' used within the project
Every class which has the prefix 'R' is designed to be extended or implement from
public class MyAwesomePlugin extends RPlugin {
...
}
public class MyAwesomeCommand extends RCommand {
...
}
public class MyAwesomeItemStack extends RItemStack {
...
}
public class MyAwesomeUser extends RUser {
...
}The API also uses annotations to simplify and reduce code whenever possible
So you'll find many occasions, where an info annotation is being used to parse meta information to a class instance
These 'conventions' are used everywhere in this project and wont change in the future
This API does not change the way you would go about creating a normal plugin, it just 'enhances' the way you would do it normally
To start off, you need to create a main class for your plugin, in our example, lets call it 'MyPlugin'
Every plugin you develop with this API, needs to have a main class, which extends from the RPlugin class like shown below
@PluginInfo(userClass = HubUser.class) // <- NOT NEEDED - If you dont supply this class with a PluginInfo annotation, the default RUser.class will be used
public class MyPlugin extends RPlugin {
@Override
public void onPluginEnable() {
...
}
@Override
public void onPluginDisable() {
...
}
}As you can see here, we use the PluginInfo annotation to parse in meta information to our plugin...
Here we specify the class that should be used for User Management (If you want to use your own User class, for example HubUser, BedwarsUser, SkywarsUser, etc)
You currently also still have to create your 'plugin.yml' but this is planned to be changed in the future...
name: MyPlugin
version: 1.0
main: PACKAGE.TO.YOUR.MAIN.CLASS.MyPlugin
api-version: 1.16Thats it!
Now you only have to maven package and deploy your build to a 1.16.5 server and your done!