Update snapshot support to 1.18-pre1

This commit is contained in:
md_5 2021-11-12 19:37:57 +11:00
parent c3fffbc919
commit c0c9b28582
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
2 changed files with 10 additions and 1 deletions

View File

@ -36,7 +36,7 @@ public class ProtocolConstants
public static final int MINECRAFT_1_16_4 = 754; public static final int MINECRAFT_1_16_4 = 754;
public static final int MINECRAFT_1_17 = 755; public static final int MINECRAFT_1_17 = 755;
public static final int MINECRAFT_1_17_1 = 756; public static final int MINECRAFT_1_17_1 = 756;
public static final int MINECRAFT_1_18 = 1073741868; public static final int MINECRAFT_1_18 = 1073741873;
public static final List<String> SUPPORTED_VERSIONS; public static final List<String> SUPPORTED_VERSIONS;
public static final List<Integer> SUPPORTED_VERSION_IDS; public static final List<Integer> SUPPORTED_VERSION_IDS;

View File

@ -24,6 +24,7 @@ public class ClientSettings extends DefinedPacket
private byte skinParts; private byte skinParts;
private int mainHand; private int mainHand;
private boolean disableTextFiltering; private boolean disableTextFiltering;
private boolean allowServerListing;
@Override @Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
@ -41,6 +42,10 @@ public class ClientSettings extends DefinedPacket
{ {
disableTextFiltering = buf.readBoolean(); disableTextFiltering = buf.readBoolean();
} }
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_18 )
{
allowServerListing = buf.readBoolean();
}
} }
@Override @Override
@ -65,6 +70,10 @@ public class ClientSettings extends DefinedPacket
{ {
buf.writeBoolean( disableTextFiltering ); buf.writeBoolean( disableTextFiltering );
} }
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_18 )
{
buf.writeBoolean( allowServerListing );
}
} }
@Override @Override