Currency items can now use custom-model-data

This commit is contained in:
Aria 2019-10-15 13:18:06 +02:00
parent c5d26d60cc
commit 79007f38af
2 changed files with 8 additions and 0 deletions

View File

@ -78,6 +78,10 @@ public class ConfigItem {
return name;
}
public int getModelData() {
return modeldata;
}
public String getId() {
return id;
}

View File

@ -7,6 +7,7 @@ import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import net.Indyuce.mmocore.MMOCore;
import net.Indyuce.mmocore.version.nms.ItemTag;
public class CurrencyItem extends ConfigItem {
@ -34,6 +35,9 @@ public class CurrencyItem extends ConfigItem {
getLore().forEach(line -> lore.add(format(line)));
meta.setLore(lore);
if(MMOCore.plugin.version.isStrictlyHigher(1, 13))
meta.setCustomModelData(getModelData());
item.setItemMeta(meta);
return NBTItem.get(item).add(new ItemTag("RpgWorth", worth)).toItem();
}