Minecraft 1.15 support
This commit is contained in:
@@ -65,19 +65,22 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_8, 0x00 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_9, 0x1F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x21 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x20 )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x20 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x21 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Login.class,
|
||||
map( ProtocolConstants.MINECRAFT_1_8, 0x01 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_9, 0x23 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x25 )
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x25 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x26 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Chat.class,
|
||||
map( ProtocolConstants.MINECRAFT_1_8, 0x02 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_9, 0x0F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x0E )
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x0E ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x0F )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Respawn.class,
|
||||
@@ -86,11 +89,13 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_12, 0x34 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x38 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x3A )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x3A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x3B )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
BossBar.class,
|
||||
map( ProtocolConstants.MINECRAFT_1_9, 0x0C )
|
||||
map( ProtocolConstants.MINECRAFT_1_9, 0x0C ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x0D )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
PlayerListItem.class, // PlayerInfo
|
||||
@@ -98,13 +103,15 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_9, 0x2D ),
|
||||
map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x30 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x33 )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x33 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x34 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
TabCompleteResponse.class,
|
||||
map( ProtocolConstants.MINECRAFT_1_8, 0x3A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_9, 0x0E ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x10 )
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x10 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x11 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
ScoreboardObjective.class,
|
||||
@@ -113,7 +120,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_12, 0x41 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x45 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x49 )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x49 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x4A )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
ScoreboardScore.class,
|
||||
@@ -122,7 +130,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_12, 0x44 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x48 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x4C )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x4C ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x4D )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
ScoreboardDisplay.class,
|
||||
@@ -131,7 +140,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_12, 0x3A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x3E ),
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x42 )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x42 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x43 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Team.class,
|
||||
@@ -140,21 +150,24 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_12, 0x43 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x47 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x4B )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x4B ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x4C )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
PluginMessage.class,
|
||||
map( ProtocolConstants.MINECRAFT_1_8, 0x3F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_9, 0x18 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x19 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x18 )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x18 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x19 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Kick.class,
|
||||
map( ProtocolConstants.MINECRAFT_1_8, 0x40 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_9, 0x1A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x1B ),
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x1A )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x1A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x1B )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Title.class,
|
||||
@@ -162,7 +175,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_12, 0x47 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x4B ),
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x4F )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x4F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x50 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
PlayerListHeaderFooter.class,
|
||||
@@ -172,22 +186,26 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_12, 0x49 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_12_1, 0x4A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x4E ),
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x53 )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x53 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x54 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
EntityStatus.class,
|
||||
map( ProtocolConstants.MINECRAFT_1_8, 0x1A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_9, 0x1B ),
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x1C ),
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x1B )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x1B ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x1C )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Commands.class,
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x11 )
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x11 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x12 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
ViewDistance.class,
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x41 )
|
||||
map( ProtocolConstants.MINECRAFT_1_14, 0x41 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_15, 0x42 )
|
||||
);
|
||||
|
||||
TO_SERVER.registerPacket(
|
||||
|
@@ -25,6 +25,7 @@ public class ProtocolConstants
|
||||
public static final int MINECRAFT_1_14_2 = 485;
|
||||
public static final int MINECRAFT_1_14_3 = 490;
|
||||
public static final int MINECRAFT_1_14_4 = 498;
|
||||
public static final int MINECRAFT_1_15 = 573;
|
||||
public static final List<String> SUPPORTED_VERSIONS = Arrays.asList(
|
||||
"1.8.x",
|
||||
"1.9.x",
|
||||
@@ -32,7 +33,8 @@ public class ProtocolConstants
|
||||
"1.11.x",
|
||||
"1.12.x",
|
||||
"1.13.x",
|
||||
"1.14.x"
|
||||
"1.14.x",
|
||||
"1.15.x"
|
||||
);
|
||||
public static final List<Integer> SUPPORTED_VERSION_IDS = Arrays.asList(
|
||||
ProtocolConstants.MINECRAFT_1_8,
|
||||
@@ -53,7 +55,8 @@ public class ProtocolConstants
|
||||
ProtocolConstants.MINECRAFT_1_14_1,
|
||||
ProtocolConstants.MINECRAFT_1_14_2,
|
||||
ProtocolConstants.MINECRAFT_1_14_3,
|
||||
ProtocolConstants.MINECRAFT_1_14_4
|
||||
ProtocolConstants.MINECRAFT_1_14_4,
|
||||
ProtocolConstants.MINECRAFT_1_15
|
||||
);
|
||||
|
||||
public enum Direction
|
||||
|
@@ -19,11 +19,13 @@ public class Login extends DefinedPacket
|
||||
private int entityId;
|
||||
private short gameMode;
|
||||
private int dimension;
|
||||
private long seed;
|
||||
private short difficulty;
|
||||
private short maxPlayers;
|
||||
private String levelType;
|
||||
private int viewDistance;
|
||||
private boolean reducedDebugInfo;
|
||||
private boolean normalRespawn;
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
@@ -37,6 +39,10 @@ public class Login extends DefinedPacket
|
||||
{
|
||||
dimension = buf.readByte();
|
||||
}
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_15 )
|
||||
{
|
||||
seed = buf.readLong();
|
||||
}
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_14 )
|
||||
{
|
||||
difficulty = buf.readUnsignedByte();
|
||||
@@ -51,6 +57,10 @@ public class Login extends DefinedPacket
|
||||
{
|
||||
reducedDebugInfo = buf.readBoolean();
|
||||
}
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_15 )
|
||||
{
|
||||
normalRespawn = buf.readBoolean();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,6 +75,10 @@ public class Login extends DefinedPacket
|
||||
{
|
||||
buf.writeByte( dimension );
|
||||
}
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_15 )
|
||||
{
|
||||
buf.writeLong( seed );
|
||||
}
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_14 )
|
||||
{
|
||||
buf.writeByte( difficulty );
|
||||
@@ -79,6 +93,10 @@ public class Login extends DefinedPacket
|
||||
{
|
||||
buf.writeBoolean( reducedDebugInfo );
|
||||
}
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_15 )
|
||||
{
|
||||
buf.writeBoolean( normalRespawn );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -17,6 +17,7 @@ public class Respawn extends DefinedPacket
|
||||
{
|
||||
|
||||
private int dimension;
|
||||
private long seed;
|
||||
private short difficulty;
|
||||
private short gameMode;
|
||||
private String levelType;
|
||||
@@ -25,6 +26,10 @@ public class Respawn extends DefinedPacket
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
dimension = buf.readInt();
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_15 )
|
||||
{
|
||||
seed = buf.readLong();
|
||||
}
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_14 )
|
||||
{
|
||||
difficulty = buf.readUnsignedByte();
|
||||
@@ -37,6 +42,10 @@ public class Respawn extends DefinedPacket
|
||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
buf.writeInt( dimension );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_15 )
|
||||
{
|
||||
buf.writeLong( seed );
|
||||
}
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_14 )
|
||||
{
|
||||
buf.writeByte( difficulty );
|
||||
|
Reference in New Issue
Block a user