From c532160fb55a850e22ecfe4cfd836bbca3f6d922 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Sat, 13 Jan 2024 00:55:41 +0100 Subject: [PATCH] Gets some smith preset items from tags instead of name matching --- .../knarcraft/blacksmith/config/SmithPreset.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/knarcraft/blacksmith/config/SmithPreset.java b/src/main/java/net/knarcraft/blacksmith/config/SmithPreset.java index 3bf4e61..800f4bf 100644 --- a/src/main/java/net/knarcraft/blacksmith/config/SmithPreset.java +++ b/src/main/java/net/knarcraft/blacksmith/config/SmithPreset.java @@ -3,9 +3,11 @@ package net.knarcraft.blacksmith.config; import net.knarcraft.blacksmith.BlacksmithPlugin; import net.knarcraft.blacksmith.util.ItemHelper; import org.bukkit.Material; +import org.bukkit.Tag; import java.util.ArrayList; import java.util.List; +import java.util.Set; import java.util.logging.Level; /** @@ -181,10 +183,10 @@ public enum SmithPreset { */ private List getTools() { List tools = new ArrayList<>(); - tools.addAll(getMaterialsEndingWith("_HOE")); - tools.addAll(getMaterialsEndingWith("_SHOVEL")); - tools.addAll(getMaterialsEndingWith("_AXE")); - tools.addAll(getMaterialsEndingWith("_PICKAXE")); + tools.addAll(Tag.ITEMS_HOES.getValues()); + tools.addAll(Tag.ITEMS_SHOVELS.getValues()); + tools.addAll(Tag.ITEMS_AXES.getValues()); + tools.addAll(Tag.ITEMS_PICKAXES.getValues()); tools.add(Material.FLINT_AND_STEEL); tools.add(Material.FISHING_ROD); tools.add(Material.SHEARS); @@ -208,8 +210,8 @@ public enum SmithPreset { * * @return

All sword materials

*/ - private List getSwords() { - return getMaterialsEndingWith("_SWORD"); + private Set getSwords() { + return Tag.ITEMS_SWORDS.getValues(); } private List getArmor() {