🌐
ZonePractice Pro
  • ✌️ZonePractice Pro
  • Overview
    • 💡Getting Started
  • Setup Guides
    • ⚔️Ladder Setup
    • 🧊Arena Setup
    • 🎮Event Setup
    • ✡️Hologram Setup
  • Informations
    • 📜Configuration Files
    • ⚙️Commands
    • 📚Permissions
  • Extra
    • 9️⃣Modern version Support Informations
    • 🧱Placeholder API
    • 🖥️For Developers
    • ❔Support
Powered by GitBook
On this page
  • Current API version
  • Importing the API
  • Adding ZonePracticePro as a dependency
  • Usage

Was this helpful?

  1. Extra

For Developers

Welcome! You've embarked on the exciting journey of working with the ZonePractice API. To get started, just import the API as you usually do:

Last updated 2 months ago

Was this helpful?

Current API version

Importing the API

Change API_VERSION to the version above.

Maven
<repositories>
	<repository>
		<id>jitpack.io</id>
		<url>https://jitpack.io</url>
	</repository>
</repositories>

<dependencies>
	<dependency>
		<groupId>com.github.ZoneDevelopement</groupId>
		<artifactId>ZonePracticePro-Api</artifactId>
		<version>API_VERSION</version>
		<scope>provided</scope>
	</dependency>
</dependencies>
Gradle
repositories {
    maven {
        url = 'https://jitpack.io'
    }
}

dependencies {
    compileOnly 'com.github.ZoneDevelopement:Zone_LicenseManager:API_VERSION'
}

Adding ZonePracticePro as a dependency

It is important to make sure that you add ZonePracticePro as a dependancy in you Addons. This will insure that your plugin will get loaded after ZonePracticePro, as otherwise you'll face into errors when accessing the API. Simply add the ZonePracticePro depend in your plugin.yml. Thats it!

name: MyFirstZPPAddon
version: 1.0
main: com.me.myfirstzppaddon.AddonPlugin
depend: [ZonePracticePro]

Usage

public final class MyFirstZPPAddon extends JavaPlugin implements Listener {

    private ZonePracticeApi api;

    @Override
    public void onEnable() {
        api = ZonePracticeApi.getInstance();

        Bukkit.getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent e) {
        Player player = e.getPlayer();
        
        player.sendMessage("Your division: " + api.getPlayerDivision(player, DivisionName.FULL));
        player.sendMessage("Your wins: " + api.getLadderWins(player, "FireballFight", WeightClass.UNRANKED));
    }

}
🖥️