mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 08:39:58 +03:00
30 lines
1.2 KiB
Diff
30 lines
1.2 KiB
Diff
--- ../src-base/minecraft/net/minecraft/network/handshake/client/C00Handshake.java
|
|
+++ ../src-work/minecraft/net/minecraft/network/handshake/client/C00Handshake.java
|
|
@@ -11,8 +11,8 @@
|
|
public class C00Handshake implements Packet<INetHandlerHandshakeServer>
|
|
{
|
|
private int protocolVersion;
|
|
- private String ip;
|
|
- private int port;
|
|
+ public String ip;
|
|
+ public int port;
|
|
private EnumConnectionState requestedState;
|
|
private boolean hasFMLMarker = false;
|
|
|
|
@@ -38,11 +38,13 @@
|
|
public void readPacketData(PacketBuffer buf) throws IOException
|
|
{
|
|
this.protocolVersion = buf.readVarIntFromBuffer();
|
|
- this.ip = buf.readStringFromBuffer(255);
|
|
+ this.ip = buf.readStringFromBuffer(Short.MAX_VALUE); // Spigot
|
|
this.port = buf.readUnsignedShort();
|
|
this.requestedState = EnumConnectionState.getById(buf.readVarIntFromBuffer());
|
|
this.hasFMLMarker = this.ip.contains("\0FML\0");
|
|
- this.ip = this.ip.split("\0")[0];
|
|
+ if (this.hasFMLMarker) {
|
|
+ this.ip = this.ip.replace("\0FML\0", "");
|
|
+ }else if (this.ip.split("\0").length>2) this.hasFMLMarker = true; //CatServer - Bungee support
|
|
}
|
|
|
|
public void writePacketData(PacketBuffer buf) throws IOException
|