Skip to content

Commit fe977e8

Browse files
1.21.9
2 parents 75fd21a + caa8835 commit fe977e8

File tree

59 files changed

+1312
-136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1312
-136
lines changed

protocol/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
jacoco
66
}
77

8-
version = "1.21.7-SNAPSHOT"
8+
version = "1.21.9-SNAPSHOT"
99
description = "MCProtocolLib is a simple library for communicating with Minecraft clients and servers."
1010

1111
dependencies {

protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public void packetReceived(Session session, Packet packet) {
155155
session.send(new ServerboundKeepAlivePacket(keepAlivePacket.getPingId()));
156156
} else if (packet instanceof ClientboundFinishConfigurationPacket) {
157157
session.switchInboundState(() -> protocol.setInboundState(ProtocolState.GAME));
158-
session.send(new ServerboundFinishConfigurationPacket());
158+
session.send(ServerboundFinishConfigurationPacket.INSTANCE);
159159
session.switchOutboundState(() -> protocol.setOutboundState(ProtocolState.GAME));
160160
} else if (packet instanceof ClientboundSelectKnownPacks) {
161161
if (session.getFlag(MinecraftConstants.SEND_BLANK_KNOWN_PACKS_RESPONSE, true)) {

protocol/src/main/java/org/geysermc/mcprotocollib/protocol/codec/MinecraftCodec.java

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundKeepAlivePacket;
2020
import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundPongPacket;
2121
import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.ServerboundResourcePackPacket;
22+
import org.geysermc.mcprotocollib.protocol.packet.configuration.clientbound.ClientboundCodeOfConductPacket;
2223
import org.geysermc.mcprotocollib.protocol.packet.configuration.clientbound.ClientboundFinishConfigurationPacket;
2324
import org.geysermc.mcprotocollib.protocol.packet.configuration.clientbound.ClientboundRegistryDataPacket;
2425
import org.geysermc.mcprotocollib.protocol.packet.configuration.clientbound.ClientboundResetChatPacket;
2526
import org.geysermc.mcprotocollib.protocol.packet.configuration.clientbound.ClientboundSelectKnownPacks;
2627
import org.geysermc.mcprotocollib.protocol.packet.configuration.clientbound.ClientboundShowDialogConfigurationPacket;
2728
import org.geysermc.mcprotocollib.protocol.packet.configuration.clientbound.ClientboundUpdateEnabledFeaturesPacket;
29+
import org.geysermc.mcprotocollib.protocol.packet.configuration.serverbound.ServerboundAcceptCodeOfConductPacket;
2830
import org.geysermc.mcprotocollib.protocol.packet.configuration.serverbound.ServerboundFinishConfigurationPacket;
2931
import org.geysermc.mcprotocollib.protocol.packet.configuration.serverbound.ServerboundSelectKnownPacks;
3032
import org.geysermc.mcprotocollib.protocol.packet.cookie.clientbound.ClientboundCookieRequestPacket;
@@ -37,10 +39,11 @@
3739
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundCommandsPacket;
3840
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundCooldownPacket;
3941
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundCustomChatCompletionsPacket;
40-
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundDebugSamplePacket;
42+
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.debug.ClientboundDebugSamplePacket;
4143
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundDeleteChatPacket;
4244
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundDelimiterPacket;
4345
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundDisguisedChatPacket;
46+
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundGameTestHighlightPosPacket;
4447
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundLoginPacket;
4548
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundPlayerChatPacket;
4649
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundPlayerInfoRemovePacket;
@@ -63,6 +66,10 @@
6366
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundTickingStepPacket;
6467
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundUpdateAdvancementsPacket;
6568
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundUpdateRecipesPacket;
69+
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.debug.ClientboundDebugBlockValuePacket;
70+
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.debug.ClientboundDebugChunkValuePacket;
71+
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.debug.ClientboundDebugEntityValuePacket;
72+
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.debug.ClientboundDebugEventPacket;
6673
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.ClientboundAddEntityPacket;
6774
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.ClientboundAnimatePacket;
6875
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.ClientboundDamageEventPacket;
@@ -160,7 +167,7 @@
160167
import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.ServerboundClientTickEndPacket;
161168
import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.ServerboundCommandSuggestionPacket;
162169
import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.ServerboundConfigurationAcknowledgedPacket;
163-
import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.ServerboundDebugSampleSubscriptionPacket;
170+
import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.ServerboundDebugSubscriptionRequestPacket;
164171
import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.ServerboundLockDifficultyPacket;
165172
import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.ServerboundPlayerLoadedPacket;
166173
import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.inventory.ServerboundContainerButtonClickPacket;
@@ -224,8 +231,8 @@
224231

225232
public class MinecraftCodec {
226233
public static final PacketCodec CODEC = PacketCodec.builder()
227-
.protocolVersion(772)
228-
.minecraftVersion("1.21.7")
234+
.protocolVersion(773)
235+
.minecraftVersion("1.21.9")
229236
.state(ProtocolState.HANDSHAKE, MinecraftPacketRegistry.builder()
230237
.registerServerboundPacket(ClientIntentionPacket.class, ClientIntentionPacket::new)
231238
)
@@ -266,15 +273,17 @@ public class MinecraftCodec {
266273
.registerClientboundPacket(ClientboundServerLinksPacket.class, ClientboundServerLinksPacket::new)
267274
.registerClientboundPacket(ClientboundClearDialogPacket.class, ClientboundClearDialogPacket::new)
268275
.registerClientboundPacket(ClientboundShowDialogConfigurationPacket.class, ClientboundShowDialogConfigurationPacket::new)
276+
.registerClientboundPacket(ClientboundCodeOfConductPacket.class, ClientboundCodeOfConductPacket::new)
269277
.registerServerboundPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new)
270278
.registerServerboundPacket(ServerboundCookieResponsePacket.class, ServerboundCookieResponsePacket::new)
271279
.registerServerboundPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new)
272-
.registerServerboundPacket(ServerboundFinishConfigurationPacket.class, ServerboundFinishConfigurationPacket::new)
280+
.registerServerboundPacket(ServerboundFinishConfigurationPacket.class, (buf) -> ServerboundFinishConfigurationPacket.INSTANCE)
273281
.registerServerboundPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new)
274282
.registerServerboundPacket(ServerboundPongPacket.class, ServerboundPongPacket::new)
275283
.registerServerboundPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new)
276284
.registerServerboundPacket(ServerboundSelectKnownPacks.class, ServerboundSelectKnownPacks::new)
277285
.registerServerboundPacket(ServerboundCustomClickActionPacket.class, ServerboundCustomClickActionPacket::new)
286+
.registerServerboundPacket(ServerboundAcceptCodeOfConductPacket.class, (buf) -> ServerboundAcceptCodeOfConductPacket.INSTANCE)
278287
).state(ProtocolState.GAME, MinecraftPacketRegistry.builder()
279288
.registerClientboundPacket(ClientboundDelimiterPacket.class, ClientboundDelimiterPacket::new)
280289
.registerClientboundPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new)
@@ -302,6 +311,10 @@ public class MinecraftCodec {
302311
.registerClientboundPacket(ClientboundCustomChatCompletionsPacket.class, ClientboundCustomChatCompletionsPacket::new)
303312
.registerClientboundPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new)
304313
.registerClientboundPacket(ClientboundDamageEventPacket.class, ClientboundDamageEventPacket::new)
314+
.registerClientboundPacket(ClientboundDebugBlockValuePacket.class, ClientboundDebugBlockValuePacket::new)
315+
.registerClientboundPacket(ClientboundDebugChunkValuePacket.class, ClientboundDebugChunkValuePacket::new)
316+
.registerClientboundPacket(ClientboundDebugEntityValuePacket.class, ClientboundDebugEntityValuePacket::new)
317+
.registerClientboundPacket(ClientboundDebugEventPacket.class, ClientboundDebugEventPacket::new)
305318
.registerClientboundPacket(ClientboundDebugSamplePacket.class, ClientboundDebugSamplePacket::new)
306319
.registerClientboundPacket(ClientboundDeleteChatPacket.class, ClientboundDeleteChatPacket::new)
307320
.registerClientboundPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new)
@@ -311,6 +324,7 @@ public class MinecraftCodec {
311324
.registerClientboundPacket(ClientboundExplodePacket.class, ClientboundExplodePacket::new)
312325
.registerClientboundPacket(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new)
313326
.registerClientboundPacket(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new)
327+
.registerClientboundPacket(ClientboundGameTestHighlightPosPacket.class, ClientboundGameTestHighlightPosPacket::new)
314328
.registerClientboundPacket(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new)
315329
.registerClientboundPacket(ClientboundHurtAnimationPacket.class, ClientboundHurtAnimationPacket::new)
316330
.registerClientboundPacket(ClientboundInitializeBorderPacket.class, ClientboundInitializeBorderPacket::new)
@@ -432,7 +446,7 @@ public class MinecraftCodec {
432446
.registerServerboundPacket(ServerboundContainerSlotStateChangedPacket.class, ServerboundContainerSlotStateChangedPacket::new)
433447
.registerServerboundPacket(ServerboundCookieResponsePacket.class, ServerboundCookieResponsePacket::new)
434448
.registerServerboundPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new)
435-
.registerServerboundPacket(ServerboundDebugSampleSubscriptionPacket.class, ServerboundDebugSampleSubscriptionPacket::new)
449+
.registerServerboundPacket(ServerboundDebugSubscriptionRequestPacket.class, ServerboundDebugSubscriptionRequestPacket::new)
436450
.registerServerboundPacket(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new)
437451
.registerServerboundPacket(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new)
438452
.registerServerboundPacket(ServerboundInteractPacket.class, ServerboundInteractPacket::new)

0 commit comments

Comments
 (0)