ProtocolLib/src/main/java/com/comphenix/protocol/events
Lukas Alt aebefded86
Packet filtering for bundled packets in 1.19.4 (#2258)
Since Minecraft 1.19.4, the protocol supports bundling consecutive packets to ensure the client processes them in one tick. However, Packet Events are not called for the individual packets in such a bundle in the current dev build of ProtocolLib. For example, no packet events are currently sent for the ENTITY_METADATA packet when an entity is first spawned as the packet is bundled with the ENTITY_SPAWN packet. However, if the entity metadata is changed later on, the event will be called.
This PR proposes to fix this by unpacking the bundled packets and invoking the packet filtering for each packet.

I also want to briefly explain how the bundling works. A bundle starts with a PACKET_DELIMITER (0x00, net.minecraft.network.protocol.BundleDelimiterPacket) packet followed by all packets that should be bundled and finished with another PACKET_DELIMITER (0x00). Within the Netty pipeline, this sequence is transformed into one synthesized packet found in net.minecraft.network.protocol.game.ClientboundBundlePacket, which is essentially just a list of packets. At the stage at which ProtocolLib injects into the clientbound netty pipeline, this packet has not been unpacked yet. Thus, we need to handle the ClientboundBundlePacket, which unfortunately is not registered in ProtocolLib. The fact that two different classes map to the same packet currently requires a dirty remapping in the packet structure modifier.
2023-03-25 21:08:31 -05:00
..
AbstractStructure.java Packet filtering for bundled packets in 1.19.4 (#2258) 2023-03-25 21:08:31 -05:00
ConnectionSide.java Migrate to Gradle with a single module 2018-09-22 17:48:06 -04:00
InternalStructure.java WIP: 1.19.4 update 2023-03-23 13:43:22 -05:00
ListenerOptions.java only run inbound listeners on the main thread if requested (#1851) 2022-08-16 23:51:54 -04:00
ListenerPriority.java Migrate to Gradle with a single module 2018-09-22 17:48:06 -04:00
ListeningWhitelist.java Anonymous Class Replacement 2022-07-24 11:02:56 -04:00
MonitorAdapter.java cleanup MonitorAdapter (#1831) 2022-08-24 00:53:55 +00:00
NetworkMarker.java Anonymous Class Replacement 2022-07-24 11:02:56 -04:00
PacketAdapter.java only run inbound listeners on the main thread if requested (#1851) 2022-08-16 23:51:54 -04:00
PacketContainer.java Fix & improve PacketContainer serialization & cloning (#1794) 2022-07-31 11:54:26 -04:00
PacketEvent.java Packet filtering for bundled packets in 1.19.4 (#2258) 2023-03-25 21:08:31 -05:00
PacketListener.java only run inbound listeners on the main thread if requested (#1851) 2022-08-16 23:51:54 -04:00
PacketMetadata.java Normalize line endings to LF 2022-12-07 13:52:09 -05:00
PacketOutputAdapter.java Migrate to Gradle with a single module 2018-09-22 17:48:06 -04:00
PacketOutputHandler.java Migrate to Gradle with a single module 2018-09-22 17:48:06 -04:00
PacketPostAdapter.java Anonymous Class Replacement 2022-07-24 11:02:56 -04:00
PacketPostListener.java Migrate to Gradle with a single module 2018-09-22 17:48:06 -04:00
ScheduledPacket.java Anonymous Class Replacement 2022-07-24 11:02:56 -04:00
SerializedOfflinePlayer.java Update to 1.19.1 (#1699) 2022-07-27 17:09:25 -04:00