-
Bug
-
Resolution: Fixed
-
23w45a, 23w46a, 1.20.3 Pre-Release 1, 1.20.3 Pre-Release 2
-
Plausible
-
Networking, Particles
-
Important
-
1139857
-
Expansion B
The current implementation of the explosion packet has a disparity between the data that is read from and the data that is written to the network.
More specifically, the part concerning the small and large explosion particles:
net.minecraft.network.protocol.game.ClientboundExplodePacket
public ClientboundExplodePacket(FriendlyByteBuf buf) { /* snip */ this.smallExplosionParticles = ClientboundExplodePacket.readParticle(buf, buf.readById(BuiltInRegistries.PARTICLE_TYPE)); this.largeExplosionParticles = ClientboundExplodePacket.readParticle(buf, buf.readById(BuiltInRegistries.PARTICLE_TYPE)); /* snip */ } private static <T extends ParticleOptions> T readParticle(FriendlyByteBuf buf, ParticleType<T> particleType) { return particleType.getDeserializer().fromNetwork(particleType, buf); } @Override public void write(FriendlyByteBuf buf) { /* snip */ buf.writeId(BuiltInRegistries.PARTICLE_TYPE, this.smallExplosionParticles.getType()); buf.writeId(BuiltInRegistries.PARTICLE_TYPE, this.largeExplosionParticles.getType()); /* snip */ }
The write logic serializes only the id of the two particles, while the read logic expects the id and whatever extra data is required for the particle (such as colors for the dust particle, block state id for the block particle etc.).
Although there's currently no way to trigger an explosion packet with customized particle types in the Vanilla implementation (only gust and generic types are used as of now), it will break if the behavior is implemented in the future.