aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrakenied <krakenied1@gmail.com>2025-05-13 18:54:10 +0200
committerKrakenied <46192742+Krakenied@users.noreply.github.com>2025-05-13 20:34:15 +0200
commit258d425ae0147e2b2a4e8d658d4aaba159005f8d (patch)
tree56592bf7521e8cd2c2c6a69a5135e25ac1a8f3cb
parent7f94f2ba4335d4c82501119755025a5e3ccbbe06 (diff)
Add count mode to trading task type
-rw-r--r--bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/TradingTaskType.java4
-rw-r--r--docs/task-types/trading-(task-type).md2
2 files changed, 4 insertions, 2 deletions
diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/TradingTaskType.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/TradingTaskType.java
index 170e8c4d..45ad0fe5 100644
--- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/TradingTaskType.java
+++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/TradingTaskType.java
@@ -171,6 +171,7 @@ public final class TradingTaskType extends BukkitTaskType {
case RESULT -> resultAmount;
case FIRST_INGREDIENT -> firstIngredientAmount;
case SECOND_INGREDIENT -> secondIngredientAmount;
+ case COUNT -> 1;
};
int progress = TaskUtils.incrementIntegerTaskProgress(taskProgress, itemAmount);
@@ -190,7 +191,8 @@ public final class TradingTaskType extends BukkitTaskType {
private enum Mode {
RESULT,
FIRST_INGREDIENT,
- SECOND_INGREDIENT;
+ SECOND_INGREDIENT,
+ COUNT;
private static final Map<String, TradingTaskType.Mode> STRING_MODE_MAP = new HashMap<>() {{
for (final TradingTaskType.Mode mode : TradingTaskType.Mode.values()) {
diff --git a/docs/task-types/trading-(task-type).md b/docs/task-types/trading-(task-type).md
index 522a86e2..267ec4ee 100644
--- a/docs/task-types/trading-(task-type).md
+++ b/docs/task-types/trading-(task-type).md
@@ -29,7 +29,7 @@ Trade with a Villager or Wandering Trader.
| `first-ingredient-exact-match` | Whether the first ingredient item should exactly match what is defined. | Boolean | No | true | \- |
| `second-ingredient` | The specific item to be used as the second ingredient in a trade. | 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. |
| `second-ingredient-exact-match` | Whether the second ingredient item should exactly match what is defined. | Boolean | No | true | \- |
-| `mode` | The specific mode of trading. | String | No | result | One of: `result`, `first_ingredient`, `second_ingredient`. |
+| `mode` | The specific mode of trading. | String | No | result | One of: `result`, `first_ingredient`, `second_ingredient`, `count`. |
| `worlds` | Worlds which should count towards the progress. | List of world names | No | \- | \- |
## Examples