From 30b8507b9f6991ce5e8ef7cf3c4d042c75ca9354 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Fri, 6 Jan 2023 14:52:30 +0100 Subject: [PATCH] Improves the tab-completion values for reforgeAbleItems --- .../util/TabCompleteValuesHelper.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/knarcraft/blacksmith/util/TabCompleteValuesHelper.java b/src/main/java/net/knarcraft/blacksmith/util/TabCompleteValuesHelper.java index 766b80a..bff30c4 100644 --- a/src/main/java/net/knarcraft/blacksmith/util/TabCompleteValuesHelper.java +++ b/src/main/java/net/knarcraft/blacksmith/util/TabCompleteValuesHelper.java @@ -1,6 +1,8 @@ package net.knarcraft.blacksmith.util; import net.knarcraft.blacksmith.config.SettingValueType; +import net.knarcraft.blacksmith.config.SmithPreset; +import net.knarcraft.blacksmith.config.SmithPresetFilter; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.EnchantmentTarget; @@ -89,12 +91,17 @@ public final class TabCompleteValuesHelper { */ private static List getReforgeAbleMaterials() { List stringLists = new ArrayList<>(); - stringLists.add("preset:sword-smith"); - stringLists.add("preset:weapon-smith"); - stringLists.add("preset:armor-smith"); - stringLists.add("preset:tool-smith"); - stringLists.add("preset:ranged-smith"); - stringLists.add("bow,crossbow,elytra"); + for (SmithPreset preset : SmithPreset.values()) { + stringLists.add("preset:" + preset.name()); + for (SmithPresetFilter filter : preset.getSupportedFilters()) { + stringLists.add("preset:" + preset.name() + ":" + filter.name()); + } + } + stringLists.add("preset:WEAPON_SMITH:RANGED,SHIELD"); + stringLists.add("preset:WEAPON_SMITH,preset:ARMOR_SMITH"); + stringLists.add("preset:WEAPON_SMITH,preset:TOOL_SMITH"); + stringLists.add("preset:ARMOR_SMITH,preset:TOOL_SMITH"); + stringLists.add("BOW,CROSSBOW,ELYTRA"); return stringLists; }