Add optional 1.18 (21w40a) snapshot protocol support
Accessible via the net.md_5.bungee.protocol.snapshot JVM property.
This commit is contained in:
@@ -226,7 +226,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x4F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x50 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_16, 0x4F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_17, 0x59 )
|
||||
map( ProtocolConstants.MINECRAFT_1_17, 0x59 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_18, 0x5A )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
ClearTitles.class,
|
||||
@@ -236,12 +237,14 @@ public enum Protocol
|
||||
TO_CLIENT.registerPacket(
|
||||
Subtitle.class,
|
||||
Subtitle::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_17, 0x57 )
|
||||
map( ProtocolConstants.MINECRAFT_1_17, 0x57 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_17, 0x58 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
TitleTimes.class,
|
||||
TitleTimes::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_17, 0x5A )
|
||||
map( ProtocolConstants.MINECRAFT_1_17, 0x5A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_17, 0x5B )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
PlayerListHeaderFooter.class,
|
||||
@@ -255,7 +258,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x53 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x54 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_16, 0x53 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_17, 0x5E )
|
||||
map( ProtocolConstants.MINECRAFT_1_17, 0x5E ),
|
||||
map( ProtocolConstants.MINECRAFT_1_17, 0x5F )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
EntityStatus.class,
|
||||
|
@@ -36,6 +36,7 @@ public class ProtocolConstants
|
||||
public static final int MINECRAFT_1_16_4 = 754;
|
||||
public static final int MINECRAFT_1_17 = 755;
|
||||
public static final int MINECRAFT_1_17_1 = 756;
|
||||
public static final int MINECRAFT_1_18 = 1073741868;
|
||||
public static final List<String> SUPPORTED_VERSIONS;
|
||||
public static final List<Integer> SUPPORTED_VERSION_IDS;
|
||||
|
||||
@@ -87,8 +88,8 @@ public class ProtocolConstants
|
||||
|
||||
if ( SNAPSHOT_SUPPORT )
|
||||
{
|
||||
// supportedVersions.add( "1.17.x" );
|
||||
// supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_17 );
|
||||
supportedVersions.add( "1.18.x" );
|
||||
supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_18 );
|
||||
}
|
||||
|
||||
SUPPORTED_VERSIONS = supportedVersions.build();
|
||||
|
@@ -32,6 +32,7 @@ public class Login extends DefinedPacket
|
||||
private int maxPlayers;
|
||||
private String levelType;
|
||||
private int viewDistance;
|
||||
private int simulationDistance;
|
||||
private boolean reducedDebugInfo;
|
||||
private boolean normalRespawn;
|
||||
private boolean debug;
|
||||
@@ -100,6 +101,10 @@ public class Login extends DefinedPacket
|
||||
{
|
||||
viewDistance = readVarInt( buf );
|
||||
}
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_18 )
|
||||
{
|
||||
simulationDistance = readVarInt( buf );
|
||||
}
|
||||
if ( protocolVersion >= 29 )
|
||||
{
|
||||
reducedDebugInfo = buf.readBoolean();
|
||||
@@ -177,6 +182,10 @@ public class Login extends DefinedPacket
|
||||
{
|
||||
writeVarInt( viewDistance, buf );
|
||||
}
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_18 )
|
||||
{
|
||||
writeVarInt( simulationDistance, buf );
|
||||
}
|
||||
if ( protocolVersion >= 29 )
|
||||
{
|
||||
buf.writeBoolean( reducedDebugInfo );
|
||||
|
Reference in New Issue
Block a user