-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GITBOOK-20: Added LifeStealZ API docs
- Loading branch information
1 parent
937c469
commit 91bc042
Showing
3 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
<repositories> | ||
<repository> | ||
<id>github</id> | ||
<url>https://maven.pkg.github.com/KartoffelChipss/LifeStealZ</url> | ||
</repository> | ||
</repositories> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.strassburger</groupId> | ||
<artifactId>lifestealz</artifactId> | ||
<version>0.0.0</version> | ||
</dependency> | ||
</dependencies> | ||
``` | ||
{% 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). |