2.0 ‐ API - Rosstail/Nodewar GitHub Wiki
From Nodewar 2.1.0, you can use the API to customize your experience.
If you want to get some examples, please check on this repository: NwCustomizer (example of objective and permissionplugin)
Using Maven, you need to add these lines into your pom.xml. The can be changed based on future releases and builds. If you are using something else than maven (i.e Gradle) or need to check the versions, use this website
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
And
<dependency>
<groupId>com.github.Rosstail</groupId>
<artifactId>Nodewar</artifactId>
<version>2.1.0</version>
<scope>provided</scope>
</dependency>
After installing this dependency, you may add Nodewar
as a dependency for your plugin in the plugin.yml
file.
# plugin.yml
... Etc
depend: # or softdepend if your plugin does not expressely needs Nodewar
- Nodewar
loadbefore:
- Nodewar # If you want to add custom objectives and/or permission plugin compatibility
To get the Nodewar API instance, use the NwAPI nwAPI = NwAPI.getNwAPI();
The current available functions are:
boolean addCustomObjective(String name, Class<? extends NwObjective> nwObjectiveClass, Class<? extends ObjectiveModel> objectiveModelClass, Class<? extends Battle> battleClass)
-> Used in onLoad()
of your plugin, it ables your custom objective (with associated data and mechanics) to be usable by Nodewar.
boolean addCustomPermissionManager(String name, Class<? extends NwIPermissionManagerHandler> customPermissionHandlerClass)
The same thing as the objective one. You create your own permision manager handler then call this function to add it to Nodewar. Do it on onLoad()
You also need your plugin loads before Nodewar through.