mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-30 13:08:19 +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")) {
|
||||
final NBTCompound display = nbt.getCompound("display");
|
||||
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);
|
||||
metaBuilder.displayName(displayName);
|
||||
}
|
||||
@ -157,7 +157,8 @@ public final class NBTUtils {
|
||||
NBTList<NBTString> loreList = display.getList("Lore");
|
||||
List<Component> lore = new ArrayList<>();
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user