Skip to content

Commit

Permalink
A little docs cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Krakenied committed Aug 28, 2024
1 parent e70150b commit 4f254f5
Show file tree
Hide file tree
Showing 33 changed files with 272 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,9 @@ public boolean matches(@NotNull String str, @NotNull String suffix, boolean igno
public abstract boolean matches(@NotNull String str1, @NotNull String str2, boolean ignoreCase);
}

/**
* @param legacyColor whether {@link Chat#legacyColor(String)} method ought to be used on {@code string} before the comparison
*/
public static boolean matchString(@NotNull BukkitTaskType type, @NotNull PendingTask pendingTask, @Nullable String string, @NotNull UUID player, @NotNull String stringKey, @NotNull String listKey, boolean legacyColor, @NotNull String matchModeKey, boolean ignoreCase) {
Task task = pendingTask.task;

Expand Down Expand Up @@ -529,6 +532,9 @@ public static boolean matchString(@NotNull BukkitTaskType type, @NotNull Pending
return false;
}

/**
* @param legacyColor whether {@link Chat#legacyColor(String)} method ought to be used on {@code strings} before the comparison
*/
public static boolean matchAnyString(@NotNull BukkitTaskType type, @NotNull PendingTask pendingTask, @NotNull String @Nullable [] strings, @NotNull UUID player, final @NotNull String stringKey, final @NotNull String listKey, boolean legacyColor, @NotNull String matchModeKey, boolean ignoreCase) {
Task task = pendingTask.task;

Expand Down
4 changes: 4 additions & 0 deletions bukkit/src/main/resources/resources/bukkit/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ options:
quest-mode:
mode: "NORMAL" # More modes are a work in progress

# Most common locales:
# de-DE: 1.234,56
# en-US: 1,234.56
# fr-ch: 1'234,56
number-formats:
# decimal format used for processing float, double and BigDecimal placeholders
floating:
Expand Down
31 changes: 31 additions & 0 deletions docs/configuration/basic-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ options:
# See https://hub.spigotmc.org/javadocs/spigot/org/bukkit/boss/BarStyle.html
style:
'0.0': SOLID # for 0.0 and higher progress values (progress is always between 0.0 and 1.0)
# Max amount of active task progress boss bars at once
limit: -1
# Whether new boss bar should be added and make another (the least progress one - if exists) disappear
replace-on-limit: true
```
## Actionbar
Expand Down Expand Up @@ -690,3 +694,30 @@ options:
connection-timeout: 5000
table-prefix: "quests_"
```
## Number formats
*`number-formats`*
Configure how Quests will display different types of numbers used in placeholders. Most common locales are:
- `de-DE`: `1.234,56`
- `en-US`: `1,234.56`
- `fr-ch`: `1'234,56`
Java docs for internals used to handle number formats:
- [DecimalFormat](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/text/DecimalFormat.html)
- [DecimalFormatSymbols](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/text/DecimalFormatSymbols.html)
- [Locale](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Locale.html)
``` yaml
number-formats:
# decimal format used for processing float, double and BigDecimal placeholders
floating:
format: '#,##0.00'
locale: 'en-US'
# decimal format used for processing int, long and BigInteger placeholders
integral:
format: '#,##0'
locale: 'en-US'
```
4 changes: 2 additions & 2 deletions docs/task-types/blockitemdropping-(task-type).md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ This is triggered by [`BlockDropItemEvent`](https://hub.spigotmc.org/javadocs/bu
| Key | Description | Type | Required | Default | Notes |
|---------------|--------------------------------------------------------|--------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `amount` | The number of items. | Integer | Yes | \- | \- |
| `item` | The specific item to be dropped. | Material, or ItemStack | Yes | \- | Accepts standard [item definition](../configuration/defining-items). Please see [this list](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html) (1.13+) or [this list](https://helpch.at/docs/1.12.2/org/bukkit/Material.html) (1.8-1.12) for material names. |
| `block` | The specific blocks to break. | Material, or list of materials | No | \- | Not specifying this field will allow all blocks to count towards the task. Please see [this list](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html) (1.13+) or [this list](https://helpch.at/docs/1.12.2/org/bukkit/Material.html) (1.8-1.12) for block names. |
| `item` | The specific item to be dropped. | Material, or ItemStack | Yes | \- | Accepts standard [item definition](../configuration/defining-items). Please see [this list](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html) (1.13+) or [this list](https://helpch.at/docs/1.12.2/org/bukkit/Material.html) (1.8-1.12) for material names. |
| `data` | The data code for the item. | Integer | No | 0 | This field is not used in Minecraft versions 1.13+, nor is it compatible with ItemStack definitions. |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |
| `exact-match` | Whether the item should exactly match what is defined. | Boolean | No | true | \- |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |

## Examples

Expand Down
2 changes: 1 addition & 1 deletion docs/task-types/brewing-(task-type).md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Brew a set amount of potions, optionally of a specific ingredient.
|---------------|--------------------------------------------------------------|------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `amount` | The number of potions to brew. | Integer | Yes | \- | \- |
| `ingredient` | The specific ingredient to brew. | Material, or ItemStack | No | Any | Accepts standard [item definition](../configuration/defining-items). Please see [this list](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html) (1.13+) or [this list](https://helpch.at/docs/1.12.2/org/bukkit/Material.html) (1.8-1.12) for material names. |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |
| `exact-match` | Whether the ingredient should exactly match what is defined. | Boolean | No | true | \- |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |

## Examples

Expand Down
12 changes: 7 additions & 5 deletions docs/task-types/bucketempty-(task-type).md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ Empty a bucket.

## Options

| Key | Description | Type | Required | Default | Notes |
|----------|-------------------------------------------------|------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `amount` | The number of buckets to empty. | Integer | Yes | \- | \- |
| `item` | The specific bucket to empty. | Material, or ItemStack | Yes | \- | Accepts standard [item definition](../configuration/defining-items). Please see [this list](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html) (1.13+) or [this list](https://helpch.at/docs/1.12.2/org/bukkit/Material.html) (1.8-1.12) for material names. |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |
| Key | Description | Type | Required | Default | Notes |
|---------------|--------------------------------------------------------|------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `amount` | The number of buckets to empty. | Integer | Yes | \- | \- |
| `item` | The specific bucket to capture. | Material, or ItemStack | No | \- | Accepts standard [item definition](../configuration/defining-items). Please see [this list](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html) (1.13+) or [this list](https://helpch.at/docs/1.12.2/org/bukkit/Material.html) (1.8-1.12) for material names. |
| `data` | The data code for the item. | Integer | No | 0 | This field is not used in Minecraft versions 1.13+, nor is it compatible with ItemStack definitions. |
| `exact-match` | Whether the item should exactly match what is defined. | Boolean | No | true | \- |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |

## Examples

Expand Down
12 changes: 7 additions & 5 deletions docs/task-types/bucketfill-(task-type).md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ Fill a bucket up.

## Options

| Key | Description | Type | Required | Default | Notes |
|----------|-------------------------------------------------|------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `amount` | The number of buckets to fill. | Integer | Yes | \- | \- |
| `item` | The specific bucket to fill. | Material, or ItemStack | Yes | \- | Accepts standard [item definition](../configuration/defining-items). Please see [this list](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html) (1.13+) or [this list](https://helpch.at/docs/1.12.2/org/bukkit/Material.html) (1.8-1.12) for material names. |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |
| Key | Description | Type | Required | Default | Notes |
|---------------|--------------------------------------------------------|------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `amount` | The number of buckets to fill. | Integer | Yes | \- | \- |
| `item` | The specific bucket to capture. | Material, or ItemStack | No | \- | Accepts standard [item definition](../configuration/defining-items). Please see [this list](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html) (1.13+) or [this list](https://helpch.at/docs/1.12.2/org/bukkit/Material.html) (1.8-1.12) for material names. |
| `data` | The data code for the item. | Integer | No | 0 | This field is not used in Minecraft versions 1.13+, nor is it compatible with ItemStack definitions. |
| `exact-match` | Whether the item should exactly match what is defined. | Boolean | No | true | \- |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |

## Examples

Expand Down
Loading

0 comments on commit 4f254f5

Please sign in to comment.