9
0
mirror of https://github.com/Auxilor/EcoArmor.git synced 2025-12-28 03:19:25 +00:00

Fixed %tier% showing in crafting

This commit is contained in:
Auxilor
2021-04-18 21:16:48 +01:00
parent 586e4add9f
commit 1fd8d9339f

View File

@@ -358,7 +358,25 @@ public class ArmorSet {
@NotNull final Config slotConfig,
@NotNull final ItemStack out) {
if (slotConfig.getBool("craftable")) {
ShapedCraftingRecipe.Builder builder = ShapedCraftingRecipe.builder(PLUGIN, this.getName() + "_" + slot.name().toLowerCase()).setOutput(out);
ItemStack formattedOut = out.clone();
ItemMeta meta = formattedOut.getItemMeta();
assert meta != null;
assert meta.getLore() != null;
List<String> lore = new ArrayList<>();
for (String s : meta.getLore()) {
s = s.replace("%tier%", Tiers.DEFAULT.getDisplayName());
lore.add(s);
}
if (meta.hasLore()) {
lore.addAll(meta.getLore());
}
meta.setLore(lore);
formattedOut.setItemMeta(meta);
ShapedCraftingRecipe.Builder builder = ShapedCraftingRecipe.builder(PLUGIN, this.getName() + "_" + slot.name().toLowerCase()).setOutput(formattedOut);
List<String> recipeStrings = slotConfig.getStrings("recipe");