mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-22 02:25:34 +01:00
Added documentation for ComponentProvider
parent
d686fe54f8
commit
e050ea37f4
@ -13,13 +13,13 @@ See [APIv5](https://github.com/plan-player-analytics/Plan/wiki/APIv5#plan-api-ve
|
||||
- DataExtension API
|
||||
- [Getting Started](https://github.com/plan-player-analytics/Plan/wiki/DataExtension-API---Getting-started)
|
||||
- 🔔 [How to register a DataExtension](https://github.com/plan-player-analytics/Plan/wiki/APIv5---DataExtension-API#-how-to-register-a-dataextension)
|
||||
- ℹ️ [PluginInfo Annotation](https://github.com/Rsl1122/Plan-PlayerAnalytics/wiki/APIv5---DataExtension-API#%E2%84%B9%EF%B8%8F-plugininfo-annotation)
|
||||
- 📏 [Provider Annotations](https://github.com/Rsl1122/Plan-PlayerAnalytics/wiki/APIv5---DataExtension-API#-provider-annotations)
|
||||
- ℹ️ [PluginInfo Annotation](https://github.com/plan-player-analytics/Plan/wiki/APIv5---DataExtension-API#%E2%84%B9%EF%B8%8F-plugininfo-annotation)
|
||||
- 📏 [Provider Annotations](https://github.com/plan-player-analytics/Plan/wiki/APIv5---DataExtension-API#-provider-annotations)
|
||||
- 🔨 [Special Provider Annotations](https://github.com/plan-player-analytics/Plan/wiki/APIv5---DataExtension-API#-special-provider-annotations)
|
||||
- 👥 [`@GroupProvider`](https://github.com/plan-player-analytics/Plan/wiki/APIv5---DataExtension-API#groupprovider)
|
||||
- 🧰 [`@DataBuilderProvider`](https://github.com/plan-player-analytics/Plan/wiki/APIv5---DataExtension-API#databuilderprovider-annotation), dynamic definition of data at runtime instead of provider annotations
|
||||
- 📐 [Extra annotations](https://github.com/Rsl1122/Plan-PlayerAnalytics/wiki/APIv5---DataExtension-API#-extra-annotations)
|
||||
- ❕ [Preventing runtime errors](https://github.com/Rsl1122/Plan-PlayerAnalytics/wiki/APIv5---DataExtension-API#-preventing-runtime-errors)
|
||||
- 📐 [Extra annotations](https://github.com/plan-player-analytics/Plan/wiki/APIv5---DataExtension-API#-extra-annotations)
|
||||
- ❕ [Preventing runtime errors](https://github.com/plan-player-analytics/Plan/wiki/APIv5---DataExtension-API#-preventing-runtime-errors)
|
||||
- Implementation violations
|
||||
- API in Action
|
||||
|
||||
@ -359,6 +359,37 @@ public String townMayor(Group town) {...}
|
||||
|
||||
</details>
|
||||
|
||||
### `@ComponentProvider`
|
||||
|
||||
**Speciality:** String values that have chat colors in them (legacy / bungee / minimessage)
|
||||
|
||||
<details>
|
||||
<summary>Usage & Parameters</summary>
|
||||
|
||||
```java
|
||||
@ComponentProvider(
|
||||
text = "Display name", // ALWAYS REQUIRED
|
||||
description = "What name is the player using",
|
||||
priority = 5,
|
||||
iconName = "question",
|
||||
iconFamily = Family.SOLID,
|
||||
iconColor = Color.NONE
|
||||
)
|
||||
public Component displayName(UUID playerUUID) {
|
||||
return ComponentService.getInstance().fromAutoDetermine(... /* Put the string in here */);
|
||||
}
|
||||
```
|
||||
|
||||
- `text` - Text that appears next to the value, for example "Has Island: No"
|
||||
- `description` - Text that appears when hovering over the value
|
||||
- `priority` - Ordering number, highest value is placed top most
|
||||
- `iconName` - Icon names can be found from https://fontawesome.com/icons?d=gallery&m=free
|
||||
- `iconFamily` - Icon family should match details on the site above
|
||||
- `iconColor` - Color of the icon that appears next to the value
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
## 🔨 Special Provider annotations
|
||||
|
||||
These annotations can be used to add information structures. They might have different limitations than other providers.
|
||||
|
Loading…
Reference in New Issue
Block a user