diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/MixinInventoryPackets.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/MixinInventoryPackets.java index 28a555f8..f5fb7a24 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/MixinInventoryPackets.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/MixinInventoryPackets.java @@ -68,7 +68,7 @@ public abstract class MixinInventoryPackets { wrapper.write(Type.STRING, uuid); // sync task id wrapper.write(Type.UNSIGNED_BYTE, windowId); wrapper.write(Type.UNSIGNED_BYTE, slots); - wrapper.write(Type.COMPONENT, TextComponentTranslator.via1_14toViaLatest(title)); + wrapper.write(Type.TAG, TextComponentTranslator.via1_14toViaLatest(title)); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/translator/TextComponentTranslator.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/translator/TextComponentTranslator.java index a8ce1a39..ffc95646 100644 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/translator/TextComponentTranslator.java +++ b/src/main/java/de/florianmichael/viafabricplus/protocolhack/translator/TextComponentTranslator.java @@ -25,6 +25,7 @@ import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.packet.State; import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.libs.gson.JsonElement; +import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag; import com.viaversion.viaversion.protocols.protocol1_14to1_13_2.ClientboundPackets1_14; import de.florianmichael.viafabricplus.ViaFabricPlus; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; @@ -40,7 +41,7 @@ public class TextComponentTranslator { * @param component The ViaVersion 1.14 text component * @return The native text component */ - public static JsonElement via1_14toViaLatest(final JsonElement component) { + public static Tag via1_14toViaLatest(final JsonElement component) { try { var wrapper = PacketWrapper.create(ClientboundPackets1_14.OPEN_WINDOW, DUMMY_USER_CONNECTION); wrapper.write(Type.VAR_INT, 1); // window id @@ -52,7 +53,7 @@ public class TextComponentTranslator { wrapper.read(Type.VAR_INT); // window id wrapper.read(Type.VAR_INT); // type id - return wrapper.read(Type.COMPONENT); // title + return wrapper.read(Type.TAG); // title } catch (Throwable t) { ViaFabricPlus.global().getLogger().error("Error converting ViaVersion 1.14 text component to native text component", t); return null;