From e7fb5cf257ec64763fed106ca3fea4583e98d709 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Tue, 9 Mar 2021 19:27:09 +0000 Subject: [PATCH] Fixed recipe part registration --- .../com/willfp/ecoarmor/sets/ArmorSet.java | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 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 a45320f..cd8a03a 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 @@ -296,12 +296,27 @@ public class ArmorSet { ArmorUtils.setAdvanced(itemStack, advanced); ArmorUtils.setTier(itemStack, Tiers.DEFAULT); - RecipeParts.registerRecipePart(PLUGIN.getNamespacedKeyFactory().create("set_" + name.toLowerCase() + "_" + pieceName), new ComplexRecipePart(test -> { - if (ArmorSlot.getSlot(test) != ArmorSlot.getSlot(itemStack)) { - return false; - } - return Objects.equals(this, ArmorUtils.getSetOnItem(test)); - }, itemStack)); + if (advanced) { + RecipeParts.registerRecipePart(PLUGIN.getNamespacedKeyFactory().create("set_" + name.toLowerCase() + "_" + pieceName + "_advanced"), new ComplexRecipePart(test -> { + if (ArmorSlot.getSlot(test) != ArmorSlot.getSlot(itemStack)) { + return false; + } + if (!ArmorUtils.isAdvanced(itemStack)) { + return false; + } + return Objects.equals(this, ArmorUtils.getSetOnItem(test)); + }, itemStack)); + } else { + RecipeParts.registerRecipePart(PLUGIN.getNamespacedKeyFactory().create("set_" + name.toLowerCase() + "_" + pieceName), new ComplexRecipePart(test -> { + if (ArmorSlot.getSlot(test) != ArmorSlot.getSlot(itemStack)) { + return false; + } + if (ArmorUtils.isAdvanced(itemStack)) { + return false; + } + return Objects.equals(this, ArmorUtils.getSetOnItem(test)); + }, itemStack)); + } return itemStack; }