diff --git a/pom.xml b/pom.xml index 910fad9b..7ff566c2 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ io.lumine MythicLib - 1.0.2 + 1.0.6 provided 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 65ae7825..0622af4c 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,9 +4,9 @@ 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.lib.api.util.ComponentUtil; 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; import net.Indyuce.mmoitems.api.Type; @@ -174,8 +174,8 @@ public class ItemStackBuilder { nbtItem.addTag(tags); nbtItem.setDisplayNameComponent(Component.text() - .append(MiniMessage.get().parse(meta.getDisplayName()) - .decoration(TextDecoration.ITALIC, false)) + .append(ComponentUtil.legacyMiniMessage(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 e450e386..e423884f 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,7 +1,6 @@ package net.Indyuce.mmoitems.api.item.build; import com.google.common.collect.Lists; -import org.bukkit.ChatColor; import java.util.ArrayList; import java.util.Arrays; @@ -48,7 +47,7 @@ public class LoreBuilder { str = str.replace("{" + holder + "}", placeholders.getOrDefault(holder, "PHE")); } - return ChatColor.translateAlternateColorCodes('&', str); + return str; } /** @@ -126,8 +125,7 @@ public class LoreBuilder { */ final List cleaned = new ArrayList<>(); for (String s : lore) - cleaned.addAll(Arrays.asList(ChatColor.translateAlternateColorCodes('&', - s.replace("{bar}", "").replace("{sbar}", "")).split("\\\\n"))); + cleaned.addAll(Arrays.asList(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 6aaf9801..7b0fcccc 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 @@ -4,9 +4,9 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import io.lumine.mythic.lib.MythicLib; import io.lumine.mythic.lib.api.item.NBTItem; +import io.lumine.mythic.lib.api.util.ComponentUtil; 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; @@ -28,7 +28,7 @@ public class DynamicLore { String s = replace(e.getAsString()); if(!s.equals("!INVALID!")) lore.add(Component.text() - .append(MiniMessage.get().parse(s)) + .append(ComponentUtil.legacyMiniMessage(s)) .decoration(TextDecoration.ITALIC, false) .build()); } diff --git a/src/main/java/net/Indyuce/mmoitems/stat/DisplayName.java b/src/main/java/net/Indyuce/mmoitems/stat/DisplayName.java index a44d9ec4..d1c19e0a 100644 --- a/src/main/java/net/Indyuce/mmoitems/stat/DisplayName.java +++ b/src/main/java/net/Indyuce/mmoitems/stat/DisplayName.java @@ -25,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(ChatColor.translateAlternateColorCodes('&', format)); + item.getMeta().setDisplayName(format); } @Override