diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 2113c55..9089e7f 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -28,10 +28,15 @@ * [🏳️ Localization](contributing/localization.md) +## Developer + +* [Using the LifeStealZ API](developer/using-the-lifestealz-api.md) +* [API methods](developer/api-methods.md) + *** * [GitHub](https://github.com/KartoffelChipss/LifeStealZ) * [Modrinth](https://modrinth.com/plugin/lifestealz) * [SpigotMC](https://www.spigotmc.org/resources/lifestealz.111469/) * [Support Discord](https://strassburger.org/discord) -* [JavaDoc](https://javadocs.lsz.strassburger.dev) +* [JavaDoc](https://javadocs.lifestealz.com) diff --git a/docs/developer/api-methods.md b/docs/developer/api-methods.md new file mode 100644 index 0000000..3b59dac --- /dev/null +++ b/docs/developer/api-methods.md @@ -0,0 +1,13 @@ +--- +description: This page is about what each API method does +icon: brackets-curly +--- + +# API methods + +You can get a detailed and always up to date list of all API methods [here](https://javadocs.lifestealz.com/org/strassburger/lifestealz/api/LifeStealZAPI.html). + +{% embed url="https://javadocs.lifestealz.com/" %} +LifeStealZ JavaDocs +{% endembed %} + diff --git a/docs/developer/using-the-lifestealz-api.md b/docs/developer/using-the-lifestealz-api.md new file mode 100644 index 0000000..36ab5bc --- /dev/null +++ b/docs/developer/using-the-lifestealz-api.md @@ -0,0 +1,107 @@ +--- +description: This page is about how to use the LifeStealZ API in your own plugin. +icon: code-simple +--- + +# Using the LifeStealZ API + +### Importing LifeStealZ + +Use the below code example matching your dependency manager. Replace the version with [the current one](https://github.com/KartoffelChipss/LifeStealZ/releases/latest). + +{% tabs %} +{% tab title="Maven" %} +{% code title="pom.xml" %} +```xml + + + github + https://maven.pkg.github.com/KartoffelChipss/LifeStealZ + + + + + org.strassburger + lifestealz + 0.0.0 + + +``` +{% endcode %} +{% endtab %} + +{% tab title="Gradle" %} +```gradle +repositories { + maven { + url = 'https://maven.pkg.github.com/KartoffelChipss/LifeStealZ' + } +} + +dependencies { + compileOnly 'org.strassburger:lifestealz:0.0.0' +} +``` +{% endtab %} +{% endtabs %} + +### Set LifeStealZ as (soft)depend + +In the next step, you will have to go to your `plugin.yml`file and add LifeStealZ as a dependency. + +{% tabs %} +{% tab title="Required dependency" %} +{% code title="plugin.yml" %} +```yaml +name: ExamplePlugin +version: 1.0 +author: author +main: your.main.path.Here + +depend: ["LifeStealZ"] +``` +{% endcode %} +{% endtab %} + +{% tab title="Optional dependency" %} +{% code title="plugin.yml" %} +```yaml +name: ExamplePlugin +version: 1.0 +author: author +main: your.main.path.Here + +softdepend: ["LifeStealZ"] +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Use the API methods + +To use the API methods, you'll need to get an implementation of the [LifeStealZAPI Interface](https://javadocs.lifestealz.com/org/strassburger/lifestealz/api/LifeStealZAPI.html): + +```java +package org.strassburger.testPluginMaven; + +import org.bukkit.plugin.java.JavaPlugin; +import org.strassburger.lifestealz.LifeStealZ; +import org.strassburger.lifestealz.api.LifeStealZAPI; + +public final class TestPluginMaven extends JavaPlugin { + + @Override + public void onEnable() { + LifeStealZAPI lifeStealZAPI = LifeStealZ.getAPI(); + + getLogger().info("TestPluginMaven enabled"); + } + + @Override + public void onDisable() { + getLogger().info("TestPluginMaven disabled"); + } +} +``` + +Read more about the API methods [here](api-methods.md).