diff --git a/pom.xml b/pom.xml index 40fe3428..910fad9b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 net.Indyuce MMOItems - 6.5.3 + 6.5.4 MMOItems A great item solution for your RPG server! diff --git a/src/main/java/net/Indyuce/mmoitems/api/item/build/ItemStackBuilder.java b/src/main/java/net/Indyuce/mmoitems/api/item/build/ItemStackBuilder.java index 13ef8372..65ae7825 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/item/build/ItemStackBuilder.java +++ b/src/main/java/net/Indyuce/mmoitems/api/item/build/ItemStackBuilder.java @@ -4,6 +4,8 @@ import com.google.gson.JsonArray; import io.lumine.mythic.lib.MythicLib; import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.item.NBTItem; +import io.lumine.mythic.utils.text.Component; +import io.lumine.mythic.utils.text.format.TextDecoration; import io.lumine.mythic.utils.text.minimessage.MiniMessage; import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.MMOItems; @@ -11,7 +13,11 @@ import net.Indyuce.mmoitems.api.Type; import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem; import net.Indyuce.mmoitems.api.item.util.DynamicLore; import net.Indyuce.mmoitems.api.util.StatFormat; -import net.Indyuce.mmoitems.stat.data.*; +import net.Indyuce.mmoitems.stat.data.DoubleData; +import net.Indyuce.mmoitems.stat.data.MaterialData; +import net.Indyuce.mmoitems.stat.data.StoredTagsData; +import net.Indyuce.mmoitems.stat.data.StringListData; +import net.Indyuce.mmoitems.stat.data.UpgradeData; import net.Indyuce.mmoitems.stat.data.type.UpgradeInfo; import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.ItemStat; @@ -24,7 +30,11 @@ import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; import java.util.logging.Level; public class ItemStackBuilder { @@ -159,11 +169,14 @@ public class ItemStackBuilder { meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, fakeModifier); item.setItemMeta(meta); - NBTItem nbtItem = MythicLib.plugin.getVersion().getWrapper().getNBTItem(item); + NBTItem nbtItem = NBTItem.get(item); nbtItem.addTag(tags); - nbtItem.setDisplayNameComponent(MiniMessage.get().parse(meta.getDisplayName())); + nbtItem.setDisplayNameComponent(Component.text() + .append(MiniMessage.get().parse(meta.getDisplayName()) + .decoration(TextDecoration.ITALIC, false)) + .build()); return nbtItem; } diff --git a/src/main/java/net/Indyuce/mmoitems/api/item/build/LoreBuilder.java b/src/main/java/net/Indyuce/mmoitems/api/item/build/LoreBuilder.java index 5b266f9e..e450e386 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/item/build/LoreBuilder.java +++ b/src/main/java/net/Indyuce/mmoitems/api/item/build/LoreBuilder.java @@ -1,9 +1,14 @@ package net.Indyuce.mmoitems.api.item.build; import com.google.common.collect.Lists; -import io.lumine.mythic.lib.MythicLib; +import org.bukkit.ChatColor; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class LoreBuilder { private final List lore = new ArrayList<>(); @@ -43,7 +48,7 @@ public class LoreBuilder { str = str.replace("{" + holder + "}", placeholders.getOrDefault(holder, "PHE")); } - return MythicLib.plugin.parseColors(str); + return ChatColor.translateAlternateColorCodes('&', str); } /** @@ -121,7 +126,8 @@ public class LoreBuilder { */ final List cleaned = new ArrayList<>(); for (String s : lore) - cleaned.addAll(Arrays.asList(MythicLib.plugin.parseColors(s.replace("{bar}", "").replace("{sbar}", "")).split("\\\\n"))); + cleaned.addAll(Arrays.asList(ChatColor.translateAlternateColorCodes('&', + s.replace("{bar}", "").replace("{sbar}", "")).split("\\\\n"))); return cleaned; } diff --git a/src/main/java/net/Indyuce/mmoitems/api/item/util/DynamicLore.java b/src/main/java/net/Indyuce/mmoitems/api/item/util/DynamicLore.java index 74886bd6..6aaf9801 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/item/util/DynamicLore.java +++ b/src/main/java/net/Indyuce/mmoitems/api/item/util/DynamicLore.java @@ -5,6 +5,7 @@ import com.google.gson.JsonElement; import io.lumine.mythic.lib.MythicLib; import io.lumine.mythic.lib.api.item.NBTItem; import io.lumine.mythic.utils.text.Component; +import io.lumine.mythic.utils.text.format.TextDecoration; import io.lumine.mythic.utils.text.minimessage.MiniMessage; import net.Indyuce.mmoitems.MMOItems; import org.bukkit.inventory.ItemStack; @@ -26,7 +27,10 @@ public class DynamicLore { for (JsonElement e : array) { String s = replace(e.getAsString()); if(!s.equals("!INVALID!")) - lore.add(MiniMessage.get().parse(s)); + lore.add(Component.text() + .append(MiniMessage.get().parse(s)) + .decoration(TextDecoration.ITALIC, false) + .build()); } item.setLoreComponents(lore); } diff --git a/src/main/java/net/Indyuce/mmoitems/stat/DisplayName.java b/src/main/java/net/Indyuce/mmoitems/stat/DisplayName.java index b223de13..a44d9ec4 100644 --- a/src/main/java/net/Indyuce/mmoitems/stat/DisplayName.java +++ b/src/main/java/net/Indyuce/mmoitems/stat/DisplayName.java @@ -1,6 +1,5 @@ package net.Indyuce.mmoitems.stat; -import io.lumine.mythic.lib.MythicLib; import io.lumine.mythic.lib.version.VersionMaterial; import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.MMOItems; @@ -26,7 +25,7 @@ public class DisplayName extends StringStat { format = format.replace("", tier != null ? ChatColor.stripColor(tier.getName()) : ""); format = format.replace("", tier != null ? ChatColor.getLastColors(tier.getName()) : "&f"); - item.getMeta().setDisplayName(MythicLib.plugin.parseColors(format)); + item.getMeta().setDisplayName(ChatColor.translateAlternateColorCodes('&', format)); } @Override