Botcraft 26.3
Loading...
Searching...
No Matches
ClientboundExplodePacket.hpp
Go to the documentation of this file.
1#pragma once
2
4#if PROTOCOL_VERSION > 764 /* > 1.20.2 */
7#endif
8#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
10#endif
11#if PROTOCOL_VERSION > 772 /* > 1.21.8 */
13#endif
14
15#include <array>
16#include <optional>
17#include <vector>
18
19namespace ProtocolCraft
20{
21 class ClientboundExplodePacket : public BasePacket<ClientboundExplodePacket>
22 {
23 public:
24 static constexpr std::string_view packet_name = "Explode";
25
26#if PROTOCOL_VERSION < 761 /* < 1.19.3 */
27 SERIALIZED_FIELD(X, float);
28 SERIALIZED_FIELD(Y, float);
29 SERIALIZED_FIELD(Z, float);
30#elif PROTOCOL_VERSION < 768 /* < 1.21.2 */
31 SERIALIZED_FIELD(X, double);
32 SERIALIZED_FIELD(Y, double);
33 SERIALIZED_FIELD(Z, double);
34#else
35 SERIALIZED_FIELD(Center, std::array<double, 3>);
36#endif
37#if PROTOCOL_VERSION > 772 /* > 1.21.8 */
38 SERIALIZED_FIELD(Radius, float);
39 SERIALIZED_FIELD(BlockCount, int);
40#endif
41#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
42 SERIALIZED_FIELD(Power, float);
43#endif
44#if PROTOCOL_VERSION < 755 /* < 1.17 */
45 SERIALIZED_FIELD(ToBlow, Internal::Vector<std::array<char, 3>, int>);
46#elif PROTOCOL_VERSION < 768 /* < 1.21.2 */
47 SERIALIZED_FIELD(ToBlow, std::vector<std::array<char, 3>>);
48#endif
49#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
50 SERIALIZED_FIELD(KnockbackX, float);
51 SERIALIZED_FIELD(KnockbackY, float);
52 SERIALIZED_FIELD(KnockbackZ, float);
53#else
54 SERIALIZED_FIELD(PlayerKnockback, std::optional<std::array<double, 3>>);
55#endif
56#if PROTOCOL_VERSION > 764 /* > 1.20.2 */ && PROTOCOL_VERSION < 768 /* < 1.21.2 */
57 SERIALIZED_FIELD(BlockInteraction, VarInt);
58 SERIALIZED_FIELD(SmallExplosionParticles, Particle);
59 SERIALIZED_FIELD(LargeExplosionParticles, Particle);
60#endif
61#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
62 SERIALIZED_FIELD(ExplosionParticle, Particle);
63#endif
64#if PROTOCOL_VERSION > 764 /* > 1.20.2 */ && PROTOCOL_VERSION < 766 /* < 1.20.5 */
65 SERIALIZED_FIELD(ExplosionSound, SoundEvent);
66#elif PROTOCOL_VERSION > 764 /* > 1.20.2 */
68#endif
69#if PROTOCOL_VERSION > 772 /* > 1.21.8 */
70 SERIALIZED_FIELD(BlockParticles, std::vector<std::pair<ExplosionParticleInfo, VarInt>>);
71#endif
72#if PROTOCOL_VERSION > 776 /* > 26.2 */
73 SERIALIZED_FIELD(PlaySound, bool);
74#endif
75
77 };
78} //ProtocolCraft
#define SERIALIZED_FIELD(Name,...)
SERIALIZED_FIELD(BlockParticles, std::vector< std::pair< ExplosionParticleInfo, VarInt > >)
SERIALIZED_FIELD(PlayerKnockback, std::optional< std::array< double, 3 > >)
SERIALIZED_FIELD(ExplosionSound, Holder< SoundEvent >)
SERIALIZED_FIELD(Center, std::array< double, 3 >)
SERIALIZED_FIELD(ExplosionParticle, Particle)
static constexpr std::string_view packet_name