Skip to content

Commit 617c272

Browse files
committed
Minecraft 25w18a protocol support
1 parent 89069a3 commit 617c272

File tree

2 files changed

+67
-2
lines changed

2 files changed

+67
-2
lines changed

protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class ProtocolConstants
5050
public static final int MINECRAFT_1_21_2 = 768;
5151
public static final int MINECRAFT_1_21_4 = 769;
5252
public static final int MINECRAFT_1_21_5 = 770;
53+
public static final int MINECRAFT_1_21_6 = 1073742072;
5354
public static final List<String> SUPPORTED_VERSIONS;
5455
public static final List<Integer> SUPPORTED_VERSION_IDS;
5556

@@ -120,7 +121,7 @@ public class ProtocolConstants
120121
if ( SNAPSHOT_SUPPORT )
121122
{
122123
// supportedVersions.add( "1.21.x" );
123-
// supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_21_5 );
124+
supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_21_6 );
124125
}
125126

126127
SUPPORTED_VERSIONS = supportedVersions.build();

protocol/src/main/java/net/md_5/bungee/protocol/packet/Commands.java

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ private static class ArgumentRegistry
313313
private static final ArgumentSerializer[] IDS_1_20_3;
314314
private static final ArgumentSerializer[] IDS_1_20_5;
315315
private static final ArgumentSerializer[] IDS_1_21_5;
316+
private static final ArgumentSerializer[] IDS_1_21_6;
316317
private static final Map<Class<?>, ProperArgumentSerializer<?>> PROPER_PROVIDERS = new HashMap<>();
317318
//
318319
private static final ArgumentSerializer<Void> VOID = new ArgumentSerializer<Void>()
@@ -918,6 +919,66 @@ protected void write(ByteBuf buf, String t)
918919
get( "minecraft:loot_predicate", VOID ),
919920
get( "minecraft:loot_modifier", VOID )
920921
};
922+
923+
IDS_1_21_6 = new ArgumentSerializer[]
924+
{
925+
get( "brigadier:bool", VOID ),
926+
get( "brigadier:float", FLOAT_RANGE ),
927+
get( "brigadier:double", DOUBLE_RANGE ),
928+
get( "brigadier:integer", INTEGER_RANGE ),
929+
get( "brigadier:long", LONG_RANGE ),
930+
get( "brigadier:string", STRING ),
931+
get( "minecraft:entity", BYTE ),
932+
get( "minecraft:game_profile", VOID ),
933+
get( "minecraft:block_pos", VOID ),
934+
get( "minecraft:column_pos", VOID ),
935+
get( "minecraft:vec3", VOID ),
936+
get( "minecraft:vec2", VOID ),
937+
get( "minecraft:block_state", VOID ),
938+
get( "minecraft:block_predicate", VOID ),
939+
get( "minecraft:item_stack", VOID ),
940+
get( "minecraft:item_predicate", VOID ),
941+
get( "minecraft:color", VOID ),
942+
get( "minecraft:hex_color", VOID ),
943+
get( "minecraft:component", VOID ),
944+
get( "minecraft:style", VOID ),
945+
get( "minecraft:message", VOID ),
946+
get( "minecraft:nbt_compound_tag", VOID ),
947+
get( "minecraft:nbt_tag", VOID ),
948+
get( "minecraft:nbt_path", VOID ),
949+
get( "minecraft:objective", VOID ),
950+
get( "minecraft:objective_criteria", VOID ),
951+
get( "minecraft:operation", VOID ),
952+
get( "minecraft:particle", VOID ),
953+
get( "minecraft:angle", VOID ),
954+
get( "minecraft:rotation", VOID ),
955+
get( "minecraft:scoreboard_slot", VOID ),
956+
get( "minecraft:score_holder", BYTE ),
957+
get( "minecraft:swizzle", VOID ),
958+
get( "minecraft:team", VOID ),
959+
get( "minecraft:item_slot", VOID ),
960+
get( "minecraft:item_slots", VOID ),
961+
get( "minecraft:resource_location", VOID ),
962+
get( "minecraft:function", VOID ),
963+
get( "minecraft:entity_anchor", VOID ),
964+
get( "minecraft:int_range", VOID ),
965+
get( "minecraft:float_range", VOID ),
966+
get( "minecraft:dimension", VOID ),
967+
get( "minecraft:gamemode", VOID ),
968+
get( "minecraft:time", INTEGER ),
969+
get( "minecraft:resource_or_tag", RAW_STRING ),
970+
get( "minecraft:resource_or_tag_key", RAW_STRING ),
971+
get( "minecraft:resource", RAW_STRING ),
972+
get( "minecraft:resource_key", RAW_STRING ),
973+
get( "minecraft:resource_selector", RAW_STRING ),
974+
get( "minecraft:template_mirror", VOID ),
975+
get( "minecraft:template_rotation", VOID ),
976+
get( "minecraft:uuid", VOID ),
977+
get( "minecraft:heightmap", VOID ),
978+
get( "minecraft:loot_table", VOID ),
979+
get( "minecraft:loot_predicate", VOID ),
980+
get( "minecraft:loot_modifier", VOID )
981+
};
921982
}
922983

923984
private static void register(String name, ArgumentSerializer serializer)
@@ -939,7 +1000,10 @@ private static ArgumentType<?> read(ByteBuf buf, int protocolVersion)
9391000
{
9401001
key = readVarInt( buf );
9411002

942-
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_21_5 )
1003+
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_21_6 )
1004+
{
1005+
reader = IDS_1_21_6[(Integer) key];
1006+
} else if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_21_5 )
9431007
{
9441008
reader = IDS_1_21_5[(Integer) key];
9451009
} else if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 )

0 commit comments

Comments
 (0)