Skip to content

Commit

Permalink
Update docs for new task types and options
Browse files Browse the repository at this point in the history
  • Loading branch information
Krakenied committed Aug 27, 2024
1 parent ecadd88 commit 39bb8dd
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 37 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
11 changes: 6 additions & 5 deletions docs/task-types/command-(task-type).md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ server (e.g. commands made with plugins like DeluxeMenu).

## Options

| Key | Description | Type | Required | Default | Notes |
|---------------|------------------------------------------------------|---------------------|----------|---------|-------|
| `command` | The command to execute. | String | Yes | \- | \- |
| `ignore-case` | Whether the casing of the command should be ignored. | Boolean | No | false | \- |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |
| Key | Description | Type | Required | Default | Notes |
|------------------------|------------------------------------------------------|----------------------------|----------|---------|-----------------------------------------------|
| `command` / `commands` | The command(s) to execute. | String, or list of strings | Yes | \- | \- |
| `ignore-case` | Whether the casing of the command should be ignored. | Boolean | No | false | \- |
| `command-match-mode` | The match mode to be used to compare the strings | String | No | EQUALS | One of: `EQUALS`, `STARTS_WITH`, `ENDS_WITH`. |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |

## Examples

Expand Down
35 changes: 35 additions & 0 deletions docs/task-types/composting-(task-type).md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: composting
parent: Built-in task types
grand_parent: Task types
---

# composting (task type)

Not released yet (dev builds)
{: .label .label-green }

Compost a specific item.

## Options

| Key | Description | Type | Required | Default | Notes |
|---------------|--------------------------------------------------------|------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `amount` | The number of items to compost. | Integer | Yes | \- | \- |
| `item` | The specific item to compost. | 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

Compost 10 carrots:

``` yaml
compostcarrots:
type: "composting"
amount: 8 # amount of items to compost
item: CARROT # (OPTIONAL) item to compost
worlds: # (OPTIONAL) restrict to certain worlds
- "world"
```
12 changes: 7 additions & 5 deletions docs/task-types/customfishing_fishing-(task-type).md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ Catch a set amount of CustomFishing loots.

## Options

| Key | Description | Type | Required | Default | Notes |
|----------|--------------------------------------|---------|----------|---------|--------------------------------------------------------------------|
| `amount` | The number of loots to catch. | Integer | Yes | \- | \- |
| `loot` | The specific loot id to catch. | String | No | \- | If this value is not specified, then any loot will count. |
| `group` | The specific group of loot to catch. | String | No | \- | If this value is not specified, then any group of loot will count. |
| Key | Description | Type | Required | Default | Notes |
|--------------------|--------------------------------------------------|---------|----------|---------|--------------------------------------------------------------------|
| `amount` | The number of loots to catch. | Integer | Yes | \- | \- |
| `loot` / `loots` | The specific loot id(s) to catch. | String | No | \- | If this value is not specified, then any loot will count. |
| `loot-match-mode` | The match mode to be used to compare the strings | String | No | EQUALS | One of: `EQUALS`, `STARTS_WITH`, `ENDS_WITH`. |
| `group` / `groups` | The specific group of loot to catch. | String | No | \- | If this value is not specified, then any group of loot will count. |
| `group-match-mode` | The match mode to be used to compare the strings | String | No | EQUALS | One of: `EQUALS`, `STARTS_WITH`, `ENDS_WITH`. |

## Examples

Expand Down
11 changes: 6 additions & 5 deletions docs/task-types/ecobosses_killing-(task-type).md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ Kill a certain number of EcoBosses bosses.

## Options

| Key | Description | Type | Required | Default | Notes |
|--------------|-------------------------------------------------|----------------------------|----------|---------|-------|
| `amount` | The number of bosses to kill. | Integer | Yes | \- | \- |
| `id` / `ids` | The EcoBosses boss ID(s). | String, or list of strings | Yes | \- | \- |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |
| Key | Description | Type | Required | Default | Notes |
|-----------------|--------------------------------------------------|----------------------------|----------|---------|-----------------------------------------------|
| `amount` | The number of bosses to kill. | Integer | Yes | \- | \- |
| `id` / `ids` | The EcoBosses boss ID(s). | String, or list of strings | Yes | \- | \- |
| `id-match-mode` | The match mode to be used to compare the strings | String | No | EQUALS | One of: `EQUALS`, `STARTS_WITH`, `ENDS_WITH`. |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |

## Examples

Expand Down
11 changes: 6 additions & 5 deletions docs/task-types/ecomobs_killing-(task-type).md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ Kill a certain number of EcoMobs mob.

## Options

| Key | Description | Type | Required | Default | Notes |
|--------------|-------------------------------------------------|----------------------------|----------|---------|-------|
| `amount` | The number of bosses to kill. | Integer | Yes | \- | \- |
| `id` / `ids` | The EcoMobs boss ID(s). | String, or list of strings | Yes | \- | \- |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |
| Key | Description | Type | Required | Default | Notes |
|-----------------|--------------------------------------------------|----------------------------|----------|---------|-----------------------------------------------|
| `amount` | The number of bosses to kill. | Integer | Yes | \- | \- |
| `id` / `ids` | The EcoMobs boss ID(s). | String, or list of strings | Yes | \- | \- |
| `id-match-mode` | The match mode to be used to compare the strings | String | No | EQUALS | One of: `EQUALS`, `STARTS_WITH`, `ENDS_WITH`. |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |

## Examples

Expand Down
2 changes: 2 additions & 0 deletions docs/task-types/interact-(task-type).md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ interact_example_task:
item: DIAMOND_PICKAXE # (OPTIONAL) the item player have to interact with the sand with
exact-match: false # (OPTIONAL) ignore diamond pickaxe nbt
amount: 100 # amount of interactions needed
worlds: # (OPTIONAL) restrict to certain worlds
- "world"
```
Loading

0 comments on commit 39bb8dd

Please sign in to comment.