Added shine option
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
package com.willfp.talismans.display;
|
||||
|
||||
import com.willfp.eco.util.ProxyUtils;
|
||||
import com.willfp.eco.util.config.Configs;
|
||||
import com.willfp.talismans.proxy.proxies.SkullProxy;
|
||||
import com.willfp.talismans.talismans.Talisman;
|
||||
import com.willfp.talismans.talismans.util.TalismanChecks;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
@@ -47,6 +50,11 @@ public class TalismanDisplay {
|
||||
|
||||
itemLore.removeIf(s -> s.startsWith(PREFIX));
|
||||
|
||||
if (meta.hasEnchant(Enchantment.DURABILITY)) {
|
||||
meta.removeEnchant(Enchantment.DURABILITY);
|
||||
meta.removeItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
}
|
||||
|
||||
meta.setLore(itemLore);
|
||||
item.setItemMeta(meta);
|
||||
|
||||
@@ -89,6 +97,11 @@ public class TalismanDisplay {
|
||||
return item;
|
||||
}
|
||||
|
||||
if (Configs.CONFIG.getBool("strengths." + talisman.getStrength().name().toLowerCase() + ".shine")) {
|
||||
meta.addEnchant(Enchantment.DURABILITY, 0, true);
|
||||
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
}
|
||||
|
||||
ProxyUtils.getProxy(SkullProxy.class).setTalismanTexture(meta, talisman.getSkullBase64());
|
||||
|
||||
meta.setDisplayName(talisman.getFormattedName());
|
||||
|
||||
@@ -10,10 +10,13 @@ description:
|
||||
strengths:
|
||||
talisman:
|
||||
color: "&e"
|
||||
shine: false
|
||||
ring:
|
||||
color: "&c"
|
||||
shine: false
|
||||
relic:
|
||||
color: "&d"
|
||||
shine: true
|
||||
|
||||
drops:
|
||||
### ADVANCED OPTIONS
|
||||
|
||||
Reference in New Issue
Block a user