From 9dfb1a29385a516ac69f6418231e766992333433 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 19 Feb 2021 12:50:36 +0000 Subject: [PATCH] Changed ArmorSet initalization to not give broken properties on default --- .../main/java/com/willfp/ecoarmor/sets/ArmorSet.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoarmor/sets/ArmorSet.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoarmor/sets/ArmorSet.java index 50939b9..c03f1dd 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoarmor/sets/ArmorSet.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoarmor/sets/ArmorSet.java @@ -12,6 +12,7 @@ import com.willfp.ecoarmor.effects.Effect; import com.willfp.ecoarmor.effects.Effects; import com.willfp.ecoarmor.sets.meta.ArmorSlot; import com.willfp.ecoarmor.sets.util.ArmorUtils; +import com.willfp.ecoarmor.upgrades.Tiers; import lombok.AccessLevel; import lombok.Getter; import org.bukkit.Color; @@ -274,13 +275,14 @@ public class ArmorSet { enchants.forEach((enchantment, integer) -> meta.addEnchant(enchantment, integer, true)); PersistentDataContainer container = meta.getPersistentDataContainer(); container.set(PLUGIN.getNamespacedKeyFactory().create("set"), PersistentDataType.STRING, name); - container.set(PLUGIN.getNamespacedKeyFactory().create("tier"), PersistentDataType.STRING, "default"); container.set(PLUGIN.getNamespacedKeyFactory().create("effective-durability"), PersistentDataType.INTEGER, this.getConfig().getInt(pieceName + ".effective-durability")); - if (advanced) { - container.set(PLUGIN.getNamespacedKeyFactory().create("advanced"), PersistentDataType.INTEGER, 1); - } itemStack.setItemMeta(meta); + ArmorUtils.setAdvanced(itemStack, advanced); + ArmorUtils.setTier(itemStack, Tiers.DEFAULT); + + Display.display(itemStack); + RecipeParts.registerRecipePart(PLUGIN.getNamespacedKeyFactory().create(name.toLowerCase() + "_" + pieceName), new ComplexRecipePart(test -> { if (ArmorSlot.getSlot(test) != ArmorSlot.getSlot(itemStack)) { return false;