Botcraft 26.2
Loading...
Searching...
No Matches
Particle.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <string_view>
5
7
8namespace ProtocolCraft
9{
10#if PROTOCOL_VERSION > 392 /* > 1.12.2 */
11 enum class ParticleType
12 {
13 None = -1,
14#if PROTOCOL_VERSION < 766 /* < 1.20.5 */
15 AmbientEntityEffect,
16#endif
18#if PROTOCOL_VERSION < 757 /* < 1.18 */
19 Barrier,
20#endif
21#if PROTOCOL_VERSION > 754 /* > 1.16.5 */ && PROTOCOL_VERSION < 757 /* < 1.18 */
22 Light,
23#endif
24 Block,
25#if PROTOCOL_VERSION > 756 /* > 1.17.1 */
27#endif
28 Bubble,
29#if PROTOCOL_VERSION > 775 /* > 26.1.2 */
33 Geyser,
37#endif
38 Cloud,
39#if PROTOCOL_VERSION > 772 /* > 1.21.8 */
41#endif
42 Crit,
46#if PROTOCOL_VERSION > 476 /* > 1.13.2 */
49#endif
51#if PROTOCOL_VERSION > 476 /* > 1.13.2 */
53#endif
54 Dust,
55#if PROTOCOL_VERSION > 754 /* > 1.16.5 */
57#endif
58 Effect,
61 Enchant,
62 EndRod,
66#if PROTOCOL_VERSION > 764 /* > 1.20.2 */
67 Gust,
68#if PROTOCOL_VERSION < 766 /* < 1.20.5 */
69 GustEmitter,
70#endif
71#endif
72#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
76#endif
77#if PROTOCOL_VERSION > 758 /* > 1.18.2 */
79#endif
82 Fishing,
83 Flame,
84#if PROTOCOL_VERSION > 761 /* > 1.19.3 */ && PROTOCOL_VERSION < 763 /* < 1.20 */
85 DrippingCherryLeaves,
86 FallingCherryLeaves,
87 LandingCherryLeaves,
88#endif
89#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
91#endif
92#if PROTOCOL_VERSION > 762 /* > 1.19.4 */
94#endif
95#if PROTOCOL_VERSION > 768 /* > 1.21.3 */
97#endif
98#if PROTOCOL_VERSION > 769 /* > 1.21.4 */
100#endif
101#if PROTOCOL_VERSION > 758 /* > 1.18.2 */
102 SculkSoul,
105#endif
106#if PROTOCOL_VERSION > 734 /* > 1.15.2 */
108 Soul,
109#endif
110#if PROTOCOL_VERSION > 476 /* > 1.13.2 */
111 Flash,
112#endif
114#if PROTOCOL_VERSION > 476 /* > 1.13.2 */
115 Composter,
116#endif
117 Heart,
119 Item,
120#if PROTOCOL_VERSION > 754 /* > 1.16.5 */
121 Vibration,
122#endif
123#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
124 Trail,
125#endif
126#if PROTOCOL_VERSION > 774 /* > 1.21.11 */
129#endif
130 ItemSlime,
131#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
133#endif
136 Lava,
137 Mycelium,
138 Note,
139 Poof,
140 Portal,
141 Rain,
142 Smoke,
143#if PROTOCOL_VERSION > 764 /* > 1.20.2 */
145#endif
146#if PROTOCOL_VERSION > 476 /* > 1.13.2 */
147 Sneeze,
148#endif
149 Spit,
150 SquidInk,
154 Splash,
155 Witch,
156 BubblePop,
159 Nautilus,
160 Dolphin,
161#if PROTOCOL_VERSION > 476 /* > 1.13.2 */
164#endif
165#if PROTOCOL_VERSION > 572 /* > 1.14.4 */
170#endif
171#if PROTOCOL_VERSION > 754 /* > 1.16.5 */
173#endif
174#if PROTOCOL_VERSION > 734 /* > 1.15.2 */
175 Ash,
178#endif
179#if PROTOCOL_VERSION > 754 /* > 1.16.5 */
181#endif
182#if PROTOCOL_VERSION > 734 /* > 1.15.2 */
187 WhiteAsh,
188#endif
189#if PROTOCOL_VERSION > 754 /* > 1.16.5 */
191 Snowflake,
197 Glow,
198 WaxOn,
199 WaxOff,
201 Scrape,
202#endif
203#if PROTOCOL_VERSION > 758 /* > 1.18.2 */
204 Shriek,
205#endif
206#if PROTOCOL_VERSION > 762 /* > 1.19.4 */
207 EggCrack,
208#endif
209#if PROTOCOL_VERSION > 764 /* > 1.20.2 */
210 DustPlume,
211#if PROTOCOL_VERSION < 766 /* < 1.20.5 */
212 GustDust,
213#endif
215#endif
216#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
221 RaidOmen,
222 TrialOmen,
223#endif
224#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
226#endif
227#if PROTOCOL_VERSION > 769 /* > 1.21.4 */
228 Firefly,
229#endif
230#if PROTOCOL_VERSION > 775 /* > 26.1.2 */
232#endif
234 };
235#else
236 enum class ParticleType
237 {
238 None = -1,
239 Explode,
240 LargeExplode,
241 HugeExplosion,
242 FireworksSpark,
243 Bubble,
244 Splash,
245 Wake,
246 Suspended,
247 Depthsuspend,
248 Crit,
249 MagicCrit,
250 Smoke,
252 Spell,
253 InstantSpell,
254 MobSpell,
255 MobSpellAmbient,
256 WitchMagic,
257 DripWater,
258 DripLava,
261 Townaura,
262 Note,
263 Portal,
264 EnchantmentTable,
265 Flame,
266 Lava,
267 Footstep,
268 Cloud,
269 Reddust,
270 Snowballpoof,
271 Snowshovel,
272 Slime,
273 Heart,
274 Barrier,
275 Iconcrack,
276 Blockcrack,
277 Blockdust,
278 Droplet,
279 Take,
280 MobAppearance,
282 EndRod,
286 Totem,
287 Spit,
289 };
290#endif
291
292 class ParticleOption;
293
294 class Particle : public NetworkType
295 {
296 public:
297 Particle();
298 virtual ~Particle();
299 std::string_view GetName() const;
300
302 SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(Option, std::shared_ptr<ParticleOption>);
303
305 GETTER(Option);
306
308
310
311#if PROTOCOL_VERSION < 766 /* < 1.20.5 */
312 public:
313 void ReadOption(ReadIterator& iter, size_t& length);
314 void WriteOption(WriteContainer& container) const;
315#endif
316 };
317}
SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(Option, std::shared_ptr< ParticleOption >)
Particle & SetParticleType(const ProtocolCraft::ParticleType particle_type_)
Definition Particle.cpp:381
SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(ParticleType, Internal::DiffType< ProtocolCraft::ParticleType, VarInt >)
std::string_view GetName() const
Definition Particle.cpp:97
std::vector< unsigned char > WriteContainer
std::vector< unsigned char >::const_iterator ReadIterator
Just a simple type wrapper that will store with T1 and serialize as T2 (can be used for Enum/VarInt f...
Definition Templates.hpp:72