mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-02-22 14:41:48 +01:00
Bug fixed :)))
This commit is contained in:
parent
8da95a78ff
commit
1bef5fa21e
@ -18,11 +18,8 @@ import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CraftingRecipeDisplay extends ConfigItem {
|
||||
public CraftingRecipeDisplay() {
|
||||
@ -116,17 +113,13 @@ public class CraftingRecipeDisplay extends ConfigItem {
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addItemFlags(ItemFlag.values());
|
||||
meta.setDisplayName(MythicLib.plugin.parseColors(name.replace("#name#", (amount > 1 ? (ChatColor.WHITE + "" + amount + " x ") : "") + MMOUtils.getDisplayName(item))));
|
||||
meta.setLore(lore.stream()
|
||||
.map(s -> MythicLib.plugin.parseColors(s))
|
||||
.collect(Collectors.toList()));
|
||||
item.setItemMeta(meta);
|
||||
|
||||
NBTItem nbtItem = NBTItem.get(item);
|
||||
|
||||
nbtItem.setDisplayNameComponent(LegacyComponent.parse(name.replace("#name#", (amount > 1 ? (ChatColor.WHITE + "" + amount + " x ") : "") + MMOUtils.getDisplayName(item))));
|
||||
|
||||
List<Component> componentLore = new ArrayList<>();
|
||||
lore.forEach(line -> componentLore.add(LegacyComponent.parse(line)));
|
||||
nbtItem.setLoreComponents(componentLore);
|
||||
|
||||
return nbtItem.addTag(new ItemTag("recipeId", craftingRecipe.getId())).toItem();
|
||||
return NBTItem.get(item).addTag(new ItemTag("recipeId", craftingRecipe.getId())).toItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user