From 258d425ae0147e2b2a4e8d658d4aaba159005f8d Mon Sep 17 00:00:00 2001 From: Krakenied Date: Tue, 13 May 2025 18:54:10 +0200 Subject: Add count mode to trading task type --- .../leonardobishop/quests/bukkit/tasktype/type/TradingTaskType.java | 4 +++- docs/task-types/trading-(task-type).md | 2 +- 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_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 -- cgit v1.2.3-70-g09d2