Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 08:10:09 +01:00
Merge pull request #13 from StamBoom/master
Fix MalformedJsonException on Kick / Disconnect
Dieser Commit ist enthalten in:
Commit
2b980a3cfc
@ -25,6 +25,9 @@ import java.lang.reflect.InvocationTargetException;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static us.myles.ViaVersion.PacketUtil.readString;
|
||||||
|
import static us.myles.ViaVersion.PacketUtil.writeString;
|
||||||
|
|
||||||
public class OutgoingTransformer {
|
public class OutgoingTransformer {
|
||||||
private static Gson gson = new Gson();
|
private static Gson gson = new Gson();
|
||||||
private final Channel channel;
|
private final Channel channel;
|
||||||
@ -78,6 +81,13 @@ public class OutgoingTransformer {
|
|||||||
output.writeInt(target);
|
output.writeInt(target);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (packet == PacketType.PLAY_DISCONNECT){
|
||||||
|
String reason = readString(input);
|
||||||
|
if (reason.startsWith("\""))
|
||||||
|
reason = "{\"text\":" + reason + "}";
|
||||||
|
writeString(reason,output);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (packet == PacketType.PLAY_ENTITY_TELEPORT) {
|
if (packet == PacketType.PLAY_ENTITY_TELEPORT) {
|
||||||
// Port this so that it relative moves :P
|
// Port this so that it relative moves :P
|
||||||
int id = PacketUtil.readVarInt(input);
|
int id = PacketUtil.readVarInt(input);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren