Skip to content

Commit

Permalink
finish topper docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HSGamer committed Oct 30, 2024
1 parent 668390f commit 338f77d
Show file tree
Hide file tree
Showing 8 changed files with 219 additions and 0 deletions.
11 changes: 11 additions & 0 deletions content/spigot/commands/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
+++
title = "Commands & Permissions"
weight = 2
+++

| Command | Permission | Description |
| ------- | ---------- | ----------- |
| `gettop <holder>` | `topper.top` | Get the top 10 players of a leaderboard provided by the specified `<holder>` |
| `gettop <holder> <number>` | `topper.top` | Get the top `<number>` players of a leaderboard provided by the specified `<holder>` |
| `gettop <holder> <from_index> <to_index>` | `topper.top` | Get the players from the specified index range of a leaderboard provided by the specified `<holder>` |
| `reloadtop` | `topper.reload` | Reload the plugin |
27 changes: 27 additions & 0 deletions content/spigot/config/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
+++
title = "Config"
weight = 3
+++

```yaml
# The type of storage the plugin will use to store the value
# Available: YAML, JSON, SQLITE, MYSQL
storage-type: yaml

# The settings for the Top Holders
holders: {}

# Should the plugin load all offline players when the server starts
load-all-offline-players: false
task:
save:
# How many entries should be saved per tick
entry-per-tick: 10
# How many ticks should the plugin wait before saving the leaderboard
delay: 0
update:
# How many entries should be updated per tick
entry-per-tick: 10
# How many ticks should the plugin wait before updating the leaderboard
delay: 0
```
7 changes: 7 additions & 0 deletions content/spigot/hook/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++
title = "Hook"
type = "chapter"
weight = 6
+++

Details about the hooks provided by the plugin.
25 changes: 25 additions & 0 deletions content/spigot/hook/placeholderapi/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
+++
title = "PlaceholderAPI"
+++

> [!NOTE]
> Install [PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.6245/)
The plugin provides a PlaceholderAPI placeholder to allow you to query data from the Top Holder.

## Usage

```
%topper_<query>%
```

Check the [Query]({{% ref "spigot/query" %}}) section for more information about how to set the `<query>`.

## Example

```
%topper_money;top_name;1%
%topper_money;top_value;1%
%topper_money;top_value;1;#,###%
%topper_money;top_rank%
```
7 changes: 7 additions & 0 deletions content/spigot/provider/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++
title = "Value Provider"
type = "chapter"
weight = 4
+++

A unit that provides values to the Top Holder. Continue reading to learn more about the built-in value providers.
59 changes: 59 additions & 0 deletions content/spigot/provider/placeholder/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
+++
title = "Placeholder"
weight = 2
+++

> [!NOTE]
> Requires [PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.6245/)
This is a provider that allows you to use PlaceholderAPI placeholders as values in the Top Holder.

## Format

```yaml
holders:
<holder-name>:
# The type of the provider
type: placeholder
# The placeholder used to get the value
placeholder: <placeholder>
# Whether the placeholder should be parsed for online players only. Default is false (all players)
online: <true/false>
# Whether the placeholder should be parsed asynchronously. Default is false
async: <true/false>
# Whether to show errors when parsing the placeholder. Default is false
show-errors: <true/false>
```
## Example
```yaml
holders:
# Holder that shows the amount of money a player has
# Use the Vault expansion: /papi ecloud download Vault
money:
type: placeholder
placeholder: "%vault_eco_balance%"
# Holder that shows the number of diamonds a player has mined
# Use the Statistic expansion: /papi ecloud download Statistic
diamonds:
type: placeholder
placeholder: "%statistic_mine_block:DIAMOND_ORE%"
online: true # Only get the value for online players
```
## Frequently Asked Questions
### I set the placeholder but it is not showing the value in the Top Holder
- Make sure that the placeholder you are using is valid and that the plugin that provides the placeholder is installed and working correctly.
- Try running the command `/papi parse me <placeholder>` to see if the placeholder is working as expected.
- Check if the placeholder is for online players only. If so, set the `online` option to `true` in the configuration.
- Try setting the `show-errors` option to `true` to see if there are any errors when parsing the placeholder.
- If the placeholder is still not working, ask for help in the plugin's support channel or forum (remember to enable `show-errors` and provide the logs to them for better support).

### My placeholder gives a formatted value (e.g., 1,000.00 instead of 1000). Can I use it in the provider?

No, the placeholder provider only supports numerical values (only numbers and decimal points).
You must use a placeholder that returns a raw number without formatting, if possible.
If the plugin that provides the placeholder does not have an option to return a raw number, you can try using a different placeholder or ask the plugin developer to add support for raw numbers.
45 changes: 45 additions & 0 deletions content/spigot/provider/statistic/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
+++
title = "Statistic"
weight = 1
+++

This is a provider that provides statistic values of a player to the Top Holder.

## Format

```yaml
holders:
<holder-name>:
# The type of the provider
type: statistic
# The name of the statistic
statistic: <statistic>
# The name of the material. Used for some statistics that require an item.
material: <material>
# The name of the entity. Used for some statistics that require an entity.
entity: <entity>
```
* Available values for `<statistic>` can be found [here](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Statistic.html)
* Available values for `<material>` can be found [here](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html)
* Available values for `<entity>` can be found [here](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html)

## Example

```yaml
holders:
# Holder that shows the number of times a player has jumped
jump:
type: statistic
statistic: JUMP
# Holder that shows the number of times a player has killed a zombie
zombie:
type: statistic
statistic: KILL_ENTITY
entity: ZOMBIE
# Holder that shows the number of times a player has mined diamond ore
diamond:
type: statistic
statistic: MINE_BLOCK
material: DIAMOND_ORE
```
38 changes: 38 additions & 0 deletions content/spigot/query/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
+++
title = "Query"
weight = 5
+++

This page provides information about the query system, which is used to retrieve data from the Top Holder.

## Format

The format of a query is as follows:

```
<holder>;<type>;<args>
```

- `<holder>`: The Top Holder to query.
- `<type>`: The type of data to retrieve.
- `<args>`: Additional arguments for the query.

If the `<type>` does not require any arguments, the query can be simplified to:

```
<holder>;<type>
```

## Types

| Type | Argument | Description | Example | Explanation |
| --- | --- | --- | --- | --- |
| `top_name` | `<position>` | The name of the player at the specified position. | `money;top_name;1` | Retrieve the name of the player at the first position in the Top Holder named `money` |
| `top_key` | `<position>` | The UUID of the player at the specified position. | `money;top_key;1` | Retrieve the UUID of the player at the first position in the Top Holder named `money` |
| `top_value` | `<position>` | The value of the player at the specified position. | `money;top_value;1` | Retrieve the value of the player at the first position in the Top Holder named `money` |
| `top_value` | `<position>;<format>` | The formatted value of the player at the specified position. | `money;top_value;1;#,###` | Retrieve the formatted value of the player at the first position in the Top Holder named `money` |
| `top_value_raw` | `<position>` | The raw value of the player at the specified position. | `money;top_value_raw;1` | Retrieve the raw value of the player at the first position in the Top Holder named `money` |
| `top_rank` | | The rank of the player. | `money;top_rank` | Retrieve the rank of the player in the Top Holder named `money` |
| `value` | | The value of the player. | `money;value` | Retrieve the value of the player in the Top Holder named `money` |
| `value` | `<format>` | The formatted value of the player. | `money;value;#,###` | Retrieve the formatted value of the player in the Top Holder named `money` |
| `value_raw` | | The raw value of the player. | `money;value_raw` | Retrieve the raw value of the player in the Top Holder named `money` |

0 comments on commit 338f77d

Please sign in to comment.