From 6cc5b2cfac0e67da9f17e2aeee6ce5b40c8d0dd8 Mon Sep 17 00:00:00 2001 From: Indyuce Date: Sat, 26 Sep 2020 23:38:16 +0200 Subject: [PATCH] :Fixed unidentified items amounts --- .../mmoitems/api/item/util/identify/UnidentifiedItem.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/Indyuce/mmoitems/api/item/util/identify/UnidentifiedItem.java b/src/main/java/net/Indyuce/mmoitems/api/item/util/identify/UnidentifiedItem.java index ed1fd83c..034a9681 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/item/util/identify/UnidentifiedItem.java +++ b/src/main/java/net/Indyuce/mmoitems/api/item/util/identify/UnidentifiedItem.java @@ -43,12 +43,14 @@ public class UnidentifiedItem extends ConfigItem { * allows to build an unidentified item based on the given NBTItem. */ public class ItemBuilder { + private final int amount; private final NBTItem item; private String name = new String(getName()); private List lore = new ArrayList<>(getLore()); public ItemBuilder(NBTItem item) { + this.amount = item.getItem().getAmount(); this.item = item; } @@ -102,8 +104,10 @@ public class UnidentifiedItem extends ConfigItem { /* * apply changes to item */ + item.getItem().setAmount(1); ItemStack unidentified = MMOLib.plugin.getVersion().getWrapper().copyTexture(item) .addTag(new ItemTag("MMOITEMS_UNIDENTIFIED_ITEM", serialize(item.getItem()))).toItem(); + unidentified.setAmount(amount); ItemMeta meta = unidentified.getItemMeta(); meta.addItemFlags(ItemFlag.values()); meta.setUnbreakable(true);