Closed OrigamiDream closed 9 years ago
Just use double quotes istead of single.
{"text": "Test Network", "color": "aqua", "bold": true}
{"text": "Footer", "color": "white", "bold": true}
In Java should be:
IChatBaseComponent Header = ChatSerializer.a("{\"text\": \"Test Network\", \"color\": \"aqua\", \"bold\": \"true\"}");
IChatBaseComponent Footer= ChatSerializer.a("{\"text\": \"Footer\", \"color\": \"white\", \"bold\": true}");
Also try JSON validator with problems with JSON.
You are running an old version of SporrtBukkit, I suggest updating to the most recent build.
I coded some source. the 1.8 tablist IChatBaseComponent Header = ChatSerializer.a("{'text': 'Test Network', 'color': 'aqua', 'bold': 'true'}"); IChatBaseComponent Footer = ChatSerializer.a("{'text': 'Footer', 'color': 'white', 'bold': true}"); // This codes are not error. PlayerConnection C = ((CraftPlayer) player).getHandle().playerConnection; C.sendPacket(new ProtocolInjector.PacketTabHeader(Header, Footer)); <- Error
so I tried another codes. C.sendPacket(new ProtocolInjector.PacketTabHeader(Header.toString(), Footer.toString())); <- Error C.sendPacket(new ProtocolInjector.PacketTabHeader(Header + "", Footer + "")); <- Error C.sendPacket(new ProtocolInjector.PacketTabHeader(SpigotComponentReverter.toLegacy(Header), SpigotComponentReverter.toLegacy(Footer))); <- Error C.sendPacket(new ProtocolInjector.PacketTabHeader("Test Network", "Footer")); <- Error C.sendPacket(new ProtocolInjector.PacketTabHeader("{'text': 'Test Network', 'color': 'aqua', 'bold': 'true'}", "{'text': 'Footer', 'color': 'white', 'bold': true}")); <- Error When I join the server, I kick for reason: ''Internal Exception: io.netty.handler.codec.DecoderException: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 12"
I 'm using SportBukkit 1.7.10 Last Build. (because my server should suppport 1.7.~ 1.8.
Can you help me??