Skip to content

Commit

Permalink
Minecraft 25w04a protocol support
Browse files Browse the repository at this point in the history
  • Loading branch information
md-5 committed Jan 27, 2025
1 parent 60a3bf0 commit 6b22690
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 30 deletions.
85 changes: 57 additions & 28 deletions protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_19_4, 0x23 ),
map( ProtocolConstants.MINECRAFT_1_20_2, 0x24 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x26 ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x27 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x27 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x26 )
);
TO_CLIENT.registerPacket(
Login.class,
Expand All @@ -117,7 +118,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_19_4, 0x28 ),
map( ProtocolConstants.MINECRAFT_1_20_2, 0x29 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x2B ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x2C )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x2C ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x2B )
);
TO_CLIENT.registerPacket( Chat.class,
Chat::new,
Expand Down Expand Up @@ -149,7 +151,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_20_2, 0x43 ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x45 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x47 ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x4C )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x4C ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x4B )
);
TO_CLIENT.registerPacket(
BossBar.class,
Expand All @@ -160,7 +163,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_17, 0x0D ),
map( ProtocolConstants.MINECRAFT_1_19, 0x0A ),
map( ProtocolConstants.MINECRAFT_1_19_4, 0x0B ),
map( ProtocolConstants.MINECRAFT_1_20_2, 0x0A )
map( ProtocolConstants.MINECRAFT_1_20_2, 0x0A ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x09 )
);
TO_CLIENT.registerPacket(
PlayerListItem.class, // PlayerInfo
Expand Down Expand Up @@ -191,7 +195,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_19, 0x0E ),
map( ProtocolConstants.MINECRAFT_1_19_3, 0x0D ),
map( ProtocolConstants.MINECRAFT_1_19_4, 0x0F ),
map( ProtocolConstants.MINECRAFT_1_20_2, 0x10 )
map( ProtocolConstants.MINECRAFT_1_20_2, 0x10 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x0F )
);
TO_CLIENT.registerPacket(
ScoreboardObjective.class,
Expand All @@ -210,7 +215,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_20_2, 0x5A ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5C ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x5E ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x64 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x64 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x63 )
);
TO_CLIENT.registerPacket(
ScoreboardScore.class,
Expand All @@ -229,14 +235,16 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_20_2, 0x5D ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5F ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x61 ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x68 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x68 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x67 )
);
TO_CLIENT.registerPacket(
ScoreboardScoreReset.class,
ScoreboardScoreReset::new,
map( ProtocolConstants.MINECRAFT_1_20_3, 0x42 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x44 ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x49 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x49 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x48 )
);
TO_CLIENT.registerPacket(
ScoreboardDisplay.class,
Expand All @@ -255,7 +263,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_20_2, 0x53 ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x55 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x57 ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x5C )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x5C ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x5B )
);
TO_CLIENT.registerPacket(
Team.class,
Expand All @@ -274,7 +283,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_20_2, 0x5C ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5E ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x60 ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x67 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x67 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x66 )
);
TO_CLIENT.registerPacket(
PluginMessage.class,
Expand All @@ -292,7 +302,9 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_19_3, 0x15 ),
map( ProtocolConstants.MINECRAFT_1_19_4, 0x17 ),
map( ProtocolConstants.MINECRAFT_1_20_2, 0x18 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x19 )
map( ProtocolConstants.MINECRAFT_1_20_5, 0x19 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x2B ),

This comment has been minimized.

Copy link
@NEZNAMY

NEZNAMY Jan 29, 2025

Is this a mistake?

This comment has been minimized.

Copy link
@md-5

md-5 Jan 29, 2025

Author Member

Yes, thanks 9dd5fb6

map( ProtocolConstants.MINECRAFT_1_21_5, 0x18 )
);
TO_CLIENT.registerPacket(
Kick.class,
Expand All @@ -310,7 +322,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_19_3, 0x17 ),
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1A ),
map( ProtocolConstants.MINECRAFT_1_20_2, 0x1B ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x1D )
map( ProtocolConstants.MINECRAFT_1_20_5, 0x1D ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x1C )
);
TO_CLIENT.registerPacket(
Title.class,
Expand All @@ -330,7 +343,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_20_2, 0x61 ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x63 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x65 ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x6C )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x6C ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x6B )
);
TO_CLIENT.registerPacket(
ClearTitles.class,
Expand All @@ -339,7 +353,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_19, 0x0D ),
map( ProtocolConstants.MINECRAFT_1_19_3, 0x0C ),
map( ProtocolConstants.MINECRAFT_1_19_4, 0x0E ),
map( ProtocolConstants.MINECRAFT_1_20_2, 0x0F )
map( ProtocolConstants.MINECRAFT_1_20_2, 0x0F ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x0E )
);
TO_CLIENT.registerPacket(
Subtitle.class,
Expand All @@ -352,7 +367,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_20_2, 0x5F ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x61 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x63 ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x6A )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x6A ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x69 )
);
TO_CLIENT.registerPacket(
TitleTimes.class,
Expand All @@ -365,7 +381,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_20_2, 0x62 ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x64 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x66 ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x6D )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x6D ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x6C )
);
TO_CLIENT.registerPacket(
SystemChat.class,
Expand All @@ -377,7 +394,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_20_2, 0x67 ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x69 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x6C ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x73 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x73 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x72 )
);
TO_CLIENT.registerPacket(
PlayerListHeaderFooter.class,
Expand All @@ -400,7 +418,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_20_2, 0x68 ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x6A ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x6D ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x74 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x74 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x73 )
);
TO_CLIENT.registerPacket(
EntityStatus.class,
Expand All @@ -418,7 +437,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_19_3, 0x19 ),
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1C ),
map( ProtocolConstants.MINECRAFT_1_20_2, 0x1D ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x1F )
map( ProtocolConstants.MINECRAFT_1_20_5, 0x1F ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x1E )
);
TO_CLIENT.registerPacket(
Commands.class,
Expand All @@ -431,7 +451,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_19, 0x0F ),
map( ProtocolConstants.MINECRAFT_1_19_3, 0x0E ),
map( ProtocolConstants.MINECRAFT_1_19_4, 0x10 ),
map( ProtocolConstants.MINECRAFT_1_20_2, 0x11 )
map( ProtocolConstants.MINECRAFT_1_20_2, 0x11 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x10 )
);
TO_CLIENT.registerPacket(
GameState.class,
Expand All @@ -446,7 +467,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1F ),
map( ProtocolConstants.MINECRAFT_1_20_2, 0x20 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x22 ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x23 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x23 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x22 )
);
TO_CLIENT.registerPacket(
ViewDistance.class,
Expand All @@ -462,7 +484,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_20_2, 0x51 ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x53 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x55 ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x59 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x59 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x58 )
);
TO_CLIENT.registerPacket(
ServerData.class,
Expand All @@ -474,7 +497,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_20_2, 0x47 ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x49 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x4B ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x50 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x50 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x4F )
);
TO_CLIENT.registerPacket(
PlayerListItemRemove.class,
Expand All @@ -483,7 +507,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_19_4, 0x39 ),
map( ProtocolConstants.MINECRAFT_1_20_2, 0x3B ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x3D ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x3F )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x3F ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x3E )
);
TO_CLIENT.registerPacket(
PlayerListItemUpdate.class,
Expand All @@ -492,26 +517,30 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_19_4, 0x3A ),
map( ProtocolConstants.MINECRAFT_1_20_2, 0x3C ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x3E ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x40 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x40 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x3F )
);
TO_CLIENT.registerPacket(
StartConfiguration.class,
StartConfiguration::new,
map( ProtocolConstants.MINECRAFT_1_20_2, 0x65 ),
map( ProtocolConstants.MINECRAFT_1_20_3, 0x67 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x69 ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x70 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x70 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x6F )
);
TO_CLIENT.registerPacket(
CookieRequest.class,
CookieRequest::new,
map( ProtocolConstants.MINECRAFT_1_20_5, 0x16 )
map( ProtocolConstants.MINECRAFT_1_20_5, 0x16 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x15 )
);
TO_CLIENT.registerPacket(
StoreCookie.class,
StoreCookie::new,
map( ProtocolConstants.MINECRAFT_1_20_5, 0x6B ),
map( ProtocolConstants.MINECRAFT_1_21_2, 0x72 )
map( ProtocolConstants.MINECRAFT_1_21_2, 0x72 ),
map( ProtocolConstants.MINECRAFT_1_21_5, 0x71 )
);
TO_CLIENT.registerPacket(
Transfer.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class ProtocolConstants
public static final int MINECRAFT_1_21 = 767;
public static final int MINECRAFT_1_21_2 = 768;
public static final int MINECRAFT_1_21_4 = 769;
public static final int MINECRAFT_1_21_5 = 1073742055;
public static final List<String> SUPPORTED_VERSIONS;
public static final List<Integer> SUPPORTED_VERSION_IDS;

Expand Down Expand Up @@ -118,7 +119,7 @@ public class ProtocolConstants
if ( SNAPSHOT_SUPPORT )
{
// supportedVersions.add( "1.21.x" );
// supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_21_4 );
supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_21_5 );
}

SUPPORTED_VERSIONS = supportedVersions.build();
Expand Down
Loading

0 comments on commit 6b22690

Please sign in to comment.