Updated APIv5 DataExtension API (markdown)

Risto Lahtela 2021-05-03 22:00:30 +03:00
parent 96705474a7
commit 8feb6df2e3
1 changed files with 10 additions and 16 deletions

@ -61,15 +61,12 @@ You might need to catch the error when calling your method that does the registe
Every `DataExtension` implementation **requires** `@PluginInfo` annotation.
> **Notation:**
> `*` means required parameter
<details>
<summary>Usage & Parameters</summary>
```java
@PluginInfo(
name* = "Your Plugin",
name = "Your Plugin", // ALWAYS REQUIRED
iconName = "cube"
iconFamily = Family.SOLID,
color = Color.NONE
@ -88,9 +85,6 @@ public class YourExtension implements DataExtension {}
Provider annotations are method annotations that tell Plan what kind of data methods in your `DataExtension` class provide.
> **Notation:**
> `*` means required parameter
The name of the methods are used for storing information the methods provide.
Methods can have 4 different parameters (**But only one**):
@ -156,7 +150,7 @@ caller.updateServerData();
```java
@BooleanProvider(
text* = "Has Island",
text = "Has Island", // ALWAYS REQUIRED
description = "Whether or not the player has an island in the island world",
priority = 5,
iconName = "question",
@ -206,7 +200,7 @@ public String islandName(UUID playerUUID) {...}
```java
@BooleanProvider(
...
conditionName* = "hasLinkedAccount",
conditionName = "hasLinkedAccount", // REQUIRED to use hidden
hidden = true
)
public boolean hasLinkedAccount(UUID playerUUID) {...}
@ -226,7 +220,7 @@ public boolean hasLinkedAccount(UUID playerUUID) {...}
```java
@NumberProvider(
text* = "Number of Islands",
text = "Number of Islands", // ALWAYS REQUIRED
description = "How many islands does the player own",
priority = 4,
iconName = "question",
@ -273,7 +267,7 @@ public long banDate(UUID playerUUID) {...}
```java
@DoubleProvider(
text* = "Balance",
text = "Balance", // ALWAYS REQUIRED
description = "Amount of money the player has",
priority = 3,
iconName = "question",
@ -301,7 +295,7 @@ public double balance(UUID playerUUID) {...}
```java
@PercentageProvider(
text* = "Quest completion",
text = "Quest completion", // ALWAYS REQUIRED
description = "Quest completion percentage",
priority = 5,
iconName = "question",
@ -329,7 +323,7 @@ public double questCompletion(UUID playerUUID) {...}
```java
@StringProvider(
text* = "Town Name",
text = "Town Name", // ALWAYS REQUIRED
description = "What town the player has residency in.",
priority = 5,
iconName = "question",
@ -391,7 +385,7 @@ Plan will construct following from given group data:
```java
@GroupProvider(
text = "Jobs",
text = "Jobs", // ALWAYS REQUIRED
groupColor = Color.NONE
iconName = "question",
iconFamily = Family.SOLID,
@ -491,12 +485,12 @@ These annotations can be used to further control how the values are displayed.
```java
@TabInfo(
tab* = "Economy",
tab = "Economy", // REQUIRED
iconName = "circle",
iconFamily = Family.SOLID,
elementOrder = {ElementOrder.VALUES, ElementOrder.TABLE, ElementOrder.GRAPH}
)
@TabInfo(tab* = "Second Tab")
@TabInfo(tab = "Second Tab") // REQUIRED
@TabOrder({"Economy", "Second Tab"})
@PluginInfo(...)
public class YourExtension implements DataExtension {