Gets some smith preset items from tags instead of name matching
Some checks failed
EpicKnarvik97/Blacksmith/pipeline/head There was a failure building this commit

This commit is contained in:
Kristian Knarvik 2024-01-13 00:55:41 +01:00
parent dfae68050e
commit c532160fb5

View File

@ -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<Material> getTools() {
List<Material> 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 <p>All sword materials</p>
*/
private List<Material> getSwords() {
return getMaterialsEndingWith("_SWORD");
private Set<Material> getSwords() {
return Tag.ITEMS_SWORDS.getValues();
}
private List<Material> getArmor() {