diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java index 61e2b42d..f06aa95a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -337,6 +337,9 @@ public enum Protocol linkedProtocols.put( ProtocolConstants.MINECRAFT_1_12, Arrays.asList( ProtocolConstants.MINECRAFT_1_12_1 ) ); + linkedProtocols.put( ProtocolConstants.MINECRAFT_1_12_1, Arrays.asList( + ProtocolConstants.MINECRAFT_1_12_2 + ) ); } @Getter diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java index f61454cf..ac9adf33 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -16,6 +16,7 @@ public class ProtocolConstants public static final int MINECRAFT_1_11_1 = 316; public static final int MINECRAFT_1_12 = 335; public static final int MINECRAFT_1_12_1 = 338; + public static final int MINECRAFT_1_12_2 = 340; public static final List SUPPORTED_VERSIONS = Arrays.asList( "1.8.x", "1.9.x", @@ -32,7 +33,8 @@ public class ProtocolConstants ProtocolConstants.MINECRAFT_1_11, ProtocolConstants.MINECRAFT_1_11_1, ProtocolConstants.MINECRAFT_1_12, - ProtocolConstants.MINECRAFT_1_12_1 + ProtocolConstants.MINECRAFT_1_12_1, + ProtocolConstants.MINECRAFT_1_12_2 ); public enum Direction diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java index 0960b7d8..9df9ef56 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java @@ -16,18 +16,24 @@ import net.md_5.bungee.protocol.ProtocolConstants; public class KeepAlive extends DefinedPacket { - private int randomId; + private long randomId; @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { - randomId = readVarInt( buf ); + randomId = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_12_2 ) ? buf.readLong() : readVarInt( buf ); } @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { - writeVarInt( randomId, buf ); + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_12_2 ) + { + buf.writeLong( randomId ); + } else + { + writeVarInt( (int) randomId, buf ); + } } @Override diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index 47a30f71..881a079a 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -91,7 +91,7 @@ public final class UserConnection implements ProxiedPlayer /*========================================================================*/ @Getter @Setter - private int sentPingId; + private long sentPingId; @Getter @Setter private long sentPingTime; diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java index 3e0ec0d5..847a3eca 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -45,6 +45,7 @@ public abstract class EntityMap case ProtocolConstants.MINECRAFT_1_12: return EntityMap_1_12.INSTANCE; case ProtocolConstants.MINECRAFT_1_12_1: + case ProtocolConstants.MINECRAFT_1_12_2: return EntityMap_1_12_1.INSTANCE; } throw new RuntimeException( "Version " + version + " has no entity map" );