From 77acdc1a1743b82d7480fe40c744b0c697e996fa Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Tue, 2 Apr 2019 15:40:19 -0300 Subject: [PATCH] Fix invisible renamed banners --- .../providers/blockentities/BannerHandler.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/BannerHandler.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/BannerHandler.java index 7e071d31a..9a8c3e7b7 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/BannerHandler.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/BannerHandler.java @@ -1,12 +1,10 @@ package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.blockentities; -import com.github.steveice10.opennbt.tag.builtin.CompoundTag; -import com.github.steveice10.opennbt.tag.builtin.IntTag; -import com.github.steveice10.opennbt.tag.builtin.ListTag; -import com.github.steveice10.opennbt.tag.builtin.Tag; +import com.github.steveice10.opennbt.tag.builtin.*; import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.minecraft.Position; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.ChatRewriter; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.BlockEntityProvider; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockStorage; @@ -55,6 +53,11 @@ public class BannerHandler implements BlockEntityProvider.BlockEntityHandler { } } + Tag name = tag.get("CustomName"); + if (name instanceof StringTag) { + ((StringTag) name).setValue(ChatRewriter.legacyTextToJson(((StringTag) name).getValue())); + } + return blockId; }