Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Update to Minecraft 1.12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
md-5 committed Sep 18, 2017
1 parent 3db9fb1 commit 0eaabdf
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ public static class DirectionData
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> SUPPORTED_VERSIONS = Arrays.asList(
"1.8.x",
"1.9.x",
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,24 @@
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
Expand Down
2 changes: 1 addition & 1 deletion proxy/src/main/java/net/md_5/bungee/UserConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public final class UserConnection implements ProxiedPlayer
/*========================================================================*/
@Getter
@Setter
private int sentPingId;
private long sentPingId;
@Getter
@Setter
private long sentPingTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static EntityMap getEntityMap(int version)
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" );
Expand Down

0 comments on commit 0eaabdf

Please sign in to comment.