This repository serves as a public API for those wanting to create addons or hooks to Pwing Races without having to purchase the plugin. On its own, this API will not do anything for you, so attempting to compile and run this as a plugin won't get you very far.
The API for PwingRaces is quite expansive, and there is a lot to cover. Because of this, most of the information can be found in the PwingRaces API Wiki. However, a basic rundown is given below.
The bulk of the PwingRaces API is broken down into 8 different managers listed below.
-
RaceManager
- RaceAbilityManager
- RaceAttributeManager
- RaceLevelManager
- RacePermissionManager
- RaceSkilltreeManager
- RaceTriggerManager
-
RaceModuleManager
If you want to access these managers, the class you will want to use is the PwingRacesAPI
class.
Take a look inside the repository to view what each method does.
@EventHandler
public void onJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
RaceManager raceManager = PwingRacesAPI.getRaceManager();
RacePlayer racePlayer = raceManager.getRacePlayer(player);
Optional<Race> race = racePlayer.getRace();
if (!race.isPresent()) {
player.sendMessage("You do not currently have a race selected.");
} else {
player.sendMessage("Your active race is currently: " + racePlayer.getRace().get().getName());
}
}
View the Creating Abilities page on the wiki.
View the Manipulating Triggers page on the wiki.
View the Creating Custom Attributes page on the wiki.
Add the repository:
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
Add the dependency:
<dependency>
<groupId>com.github.Pwing-Minecraft</groupId>
<artifactId>PwingRaces-API</artifactId>
<version>-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
Add the repository:
repositories {
maven {
url 'https://jitpack.io'
}
}
Add the dependency:
dependencies {
compileOnly 'com.github.Pwing-Minecraft:PwingRaces-API:Tag'
}