mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Properly unescape displayname & lore
This commit is contained in:
parent
aee429add3
commit
3e73ec5646
@ -149,7 +149,7 @@ public final class NBTUtils {
|
|||||||
if (nbt.containsKey("display")) {
|
if (nbt.containsKey("display")) {
|
||||||
final NBTCompound display = nbt.getCompound("display");
|
final NBTCompound display = nbt.getCompound("display");
|
||||||
if (display.containsKey("Name")) {
|
if (display.containsKey("Name")) {
|
||||||
final String rawName = display.getString("Name");
|
final String rawName = StringUtils.unescapeJavaString(display.getString("Name"));
|
||||||
final Component displayName = GsonComponentSerializer.gson().deserialize(rawName);
|
final Component displayName = GsonComponentSerializer.gson().deserialize(rawName);
|
||||||
metaBuilder.displayName(displayName);
|
metaBuilder.displayName(displayName);
|
||||||
}
|
}
|
||||||
@ -157,7 +157,8 @@ public final class NBTUtils {
|
|||||||
NBTList<NBTString> loreList = display.getList("Lore");
|
NBTList<NBTString> loreList = display.getList("Lore");
|
||||||
List<Component> lore = new ArrayList<>();
|
List<Component> lore = new ArrayList<>();
|
||||||
for (NBTString s : loreList) {
|
for (NBTString s : loreList) {
|
||||||
lore.add(GsonComponentSerializer.gson().deserialize(s.getValue()));
|
final String rawLore = StringUtils.unescapeJavaString(s.getValue());
|
||||||
|
lore.add(GsonComponentSerializer.gson().deserialize(rawLore));
|
||||||
}
|
}
|
||||||
metaBuilder.lore(lore);
|
metaBuilder.lore(lore);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user