mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-12-28 05:37:44 +01:00
!Updated lib
This commit is contained in:
parent
f3cd81db91
commit
e12d116c1c
@ -1,10 +1,9 @@
|
||||
package net.Indyuce.mmocore.api.player.profess.resource;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
import net.asangarin.hexcolors.ColorParse;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.api.util.AltChar;
|
||||
|
||||
@ -23,9 +22,9 @@ public class ManaDisplayOptions {
|
||||
Validate.notNull(name, "Could not load mana name");
|
||||
|
||||
Validate.notNull(config.getConfigurationSection("color"), "Could not find mana color config");
|
||||
full = ColorParse.getColor(config.getString("color.full", "NO_INPUT"));
|
||||
half = ColorParse.getColor(config.getString("color.half", "NO_INPUT"));
|
||||
empty = ColorParse.getColor(config.getString("color.empty", "NO_INPUT"));
|
||||
full = ChatColor.valueOf(config.getString("color.full", "NO_INPUT"));
|
||||
half = ChatColor.valueOf(config.getString("color.half", "NO_INPUT"));
|
||||
empty = ChatColor.valueOf(config.getString("color.empty", "NO_INPUT"));
|
||||
|
||||
String format = config.getString("char", "");
|
||||
Validate.notEmpty(format, "Could not load mana bar character");
|
||||
|
@ -13,6 +13,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.Damageable;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
@ -101,13 +102,12 @@ public class ConfigItem {
|
||||
return build(1);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public ItemStack build(int amount) {
|
||||
ItemStack item = getItem(amount);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
|
||||
if (MMOLib.plugin.getVersion().getWrapper().isDamageable(item))
|
||||
MMOLib.plugin.getVersion().getWrapper().applyDurability(item, meta, damage);
|
||||
if (meta instanceof Damageable)
|
||||
((Damageable) meta).setDamage(damage);
|
||||
|
||||
if (MMOLib.plugin.getVersion().isStrictlyHigher(1, 13))
|
||||
meta.setCustomModelData(modeldata);
|
||||
|
Loading…
Reference in New Issue
Block a user