3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-04 23:30:24 +01:00

Fix README, also change a bit of the fixJson so that it can handle quotes on signs.

Dieser Commit ist enthalten in:
Myles 2016-03-06 14:40:23 +00:00
Ursprung 6efb5c1b64
Commit 3c5a6a3b7b
3 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -3,7 +3,7 @@
This plugin modifies netty to allow connection of 1.9 clients to 1.8,
###**Don't use late bind*
###*Don't use late bind*
This took hours of work, so if you enjoy this consider looking into contacting me and supporting my projects.

Datei anzeigen

@ -73,7 +73,7 @@ public class IncomingTransformer {
output.writeLong(location);
for (int i = 0; i < 4; i++) {
String line = PacketUtil.readString(input);
line = "{\"text\":\"" + line + "\"}";
line = OutgoingTransformer.fixJson(line);
PacketUtil.writeString(line, output);
}
return;

Datei anzeigen

@ -725,12 +725,13 @@ public class OutgoingTransformer {
if (line == null || line.equalsIgnoreCase("null")) {
line = "{\"text\":\"\"}";
} else {
if (!line.startsWith("\"") && !line.startsWith("{")) {
if ((!line.startsWith("\"") || !line.endsWith("\"")) && (!line.startsWith("{")|| !line.endsWith("}"))) {
JSONObject obj = new JSONObject();
obj.put("text", line);
line = obj.toJSONString();
}
if (line.startsWith("\"")) {
if (line.startsWith("\"") && line.endsWith("\"")) {
line = "{\"text\":" + line + "}";
}
}