1 /*
2  * This file has been automatically generated by Soupply and released under the MIT license.
3  * Generated from data/java393.xml
4  */
5 module soupply.java393.types;
6 
7 static import std.conv;
8 import xpacket;
9 
10 import xserial.serial : EndianType, serializeLength, deserializeLength;
11 
12 import xbuffer.memory : xalloc, xfree;
13 
14 import soupply.util;
15 import soupply.java393.metadata;
16 
17 struct Slot
18 {
19 
20     enum string[] __fields = ["id", "count", "nbt"];
21 
22     short id;
23     @Condition("id>0") ubyte count;
24     @Condition("id>0") @NoLength ubyte[] nbt;
25 
26     mixin Make!(Endian.bigEndian, varuint);
27 
28     string toString()
29     {
30         return "Slot(id: " ~ std.conv.to!string(this.id) ~ ", count: " ~ std.conv.to!string(this.count) ~ ", nbt: " ~ std.conv.to!string(this.nbt) ~ ")";
31     }
32 
33 }
34 
35 struct Particle
36 {
37 
38     enum string[] __fields = ["id", "dataVaruint", "dataFloat", "dataSlot"];
39 
40     @Var uint id;
41     @Condition("id==3||id==20") @Var uint dataVaruint;
42     @Condition("id==11") float dataFloat;
43     @Condition("id==27") soupply.java393.types.Slot dataSlot;
44 
45     mixin Make!(Endian.bigEndian, varuint);
46 
47     string toString()
48     {
49         return "Particle(id: " ~ std.conv.to!string(this.id) ~ ", dataVaruint: " ~ std.conv.to!string(this.dataVaruint) ~ ", dataFloat: " ~ std.conv.to!string(this.dataFloat) ~ ", dataSlot: " ~ std.conv.to!string(this.dataSlot) ~ ")";
50     }
51 
52 }
53 
54 struct Property
55 {
56 
57     enum string[] __fields = ["name", "value", "signed", "signature"];
58 
59     string name;
60     string value;
61     bool signed;
62     @Condition("signed==true") string signature;
63 
64     mixin Make!(Endian.bigEndian, varuint);
65 
66     string toString()
67     {
68         return "Property(name: " ~ std.conv.to!string(this.name) ~ ", value: " ~ std.conv.to!string(this.value) ~ ", signed: " ~ std.conv.to!string(this.signed) ~ ", signature: " ~ std.conv.to!string(this.signature) ~ ")";
69     }
70 
71 }
72 
73 struct ListAddPlayer
74 {
75 
76     // gamemode
77     enum uint SURVIVAL = 0;
78     enum uint CREATIVE = 1;
79     enum uint ADVENTURE = 2;
80     enum uint SPECTATOR = 3;
81 
82     enum string[] __fields = ["uuid", "name", "properties", "gamemode", "latency", "hasDisplayName", "displayName"];
83 
84     UUID uuid;
85     string name;
86     soupply.java393.types.Property[] properties;
87     @Var uint gamemode;
88     @Var uint latency;
89     bool hasDisplayName;
90     @Condition("hasDisplayName==true") string displayName;
91 
92     mixin Make!(Endian.bigEndian, varuint);
93 
94     string toString()
95     {
96         return "ListAddPlayer(uuid: " ~ std.conv.to!string(this.uuid) ~ ", name: " ~ std.conv.to!string(this.name) ~ ", properties: " ~ std.conv.to!string(this.properties) ~ ", gamemode: " ~ std.conv.to!string(this.gamemode) ~ ", latency: " ~ std.conv.to!string(this.latency) ~ ", hasDisplayName: " ~ std.conv.to!string(this.hasDisplayName) ~ ", displayName: " ~ std.conv.to!string(this.displayName) ~ ")";
97     }
98 
99 }
100 
101 struct ListUpdateGamemode
102 {
103 
104     // gamemode
105     enum uint SURVIVAL = 0;
106     enum uint CREATIVE = 1;
107     enum uint ADVENTURE = 2;
108     enum uint SPECTATOR = 3;
109 
110     enum string[] __fields = ["uuid", "gamemode"];
111 
112     UUID uuid;
113     @Var uint gamemode;
114 
115     mixin Make!(Endian.bigEndian, varuint);
116 
117     string toString()
118     {
119         return "ListUpdateGamemode(uuid: " ~ std.conv.to!string(this.uuid) ~ ", gamemode: " ~ std.conv.to!string(this.gamemode) ~ ")";
120     }
121 
122 }
123 
124 struct ListUpdateLatency
125 {
126 
127     enum string[] __fields = ["uuid", "latency"];
128 
129     UUID uuid;
130     @Var uint latency;
131 
132     mixin Make!(Endian.bigEndian, varuint);
133 
134     string toString()
135     {
136         return "ListUpdateLatency(uuid: " ~ std.conv.to!string(this.uuid) ~ ", latency: " ~ std.conv.to!string(this.latency) ~ ")";
137     }
138 
139 }
140 
141 struct ListUpdateDisplayName
142 {
143 
144     enum string[] __fields = ["uuid", "hasDisplayName", "displayName"];
145 
146     UUID uuid;
147     bool hasDisplayName;
148     @Condition("hasDisplayName==true") string displayName;
149 
150     mixin Make!(Endian.bigEndian, varuint);
151 
152     string toString()
153     {
154         return "ListUpdateDisplayName(uuid: " ~ std.conv.to!string(this.uuid) ~ ", hasDisplayName: " ~ std.conv.to!string(this.hasDisplayName) ~ ", displayName: " ~ std.conv.to!string(this.displayName) ~ ")";
155     }
156 
157 }
158 
159 struct Modifier
160 {
161 
162     // operation
163     enum ubyte ADD_SUBSTRACT_AMOUNT = 0;
164     enum ubyte ADD_SUBSTRACT_AMOUNT_PERCENTAGE = 1;
165     enum ubyte MULTIPLY_AMOUNT_PERCENTAGE = 2;
166 
167     enum string[] __fields = ["uuid", "amount", "operation"];
168 
169     UUID uuid;
170     double amount;
171     ubyte operation;
172 
173     mixin Make!(Endian.bigEndian, varuint);
174 
175     string toString()
176     {
177         return "Modifier(uuid: " ~ std.conv.to!string(this.uuid) ~ ", amount: " ~ std.conv.to!string(this.amount) ~ ", operation: " ~ std.conv.to!string(this.operation) ~ ")";
178     }
179 
180 }
181 
182 struct Attribute
183 {
184 
185     enum string[] __fields = ["key", "value", "modifiers"];
186 
187     string key;
188     double value;
189     soupply.java393.types.Modifier[] modifiers;
190 
191     mixin Make!(Endian.bigEndian, varuint);
192 
193     string toString()
194     {
195         return "Attribute(key: " ~ std.conv.to!string(this.key) ~ ", value: " ~ std.conv.to!string(this.value) ~ ", modifiers: " ~ std.conv.to!string(this.modifiers) ~ ")";
196     }
197 
198 }
199 
200 struct Entry
201 {
202 
203     enum string[] __fields = ["item", "craftingSlot", "playerSlot"];
204 
205     soupply.java393.types.Slot item;
206     ubyte craftingSlot;
207     ubyte playerSlot;
208 
209     mixin Make!(Endian.bigEndian, varuint);
210 
211     string toString()
212     {
213         return "Entry(item: " ~ std.conv.to!string(this.item) ~ ", craftingSlot: " ~ std.conv.to!string(this.craftingSlot) ~ ", playerSlot: " ~ std.conv.to!string(this.playerSlot) ~ ")";
214     }
215 
216 }
217 
218 struct OptionalChat
219 {
220 
221     enum string[] __fields = ["hasChat", "chat"];
222 
223     bool hasChat;
224     @Condition("hasChat==true") string chat;
225 
226     mixin Make!(Endian.bigEndian, varuint);
227 
228     string toString()
229     {
230         return "OptionalChat(hasChat: " ~ std.conv.to!string(this.hasChat) ~ ", chat: " ~ std.conv.to!string(this.chat) ~ ")";
231     }
232 
233 }
234 
235 struct OptionalPosition
236 {
237 
238     enum string[] __fields = ["hasPosition", "position"];
239 
240     bool hasPosition;
241     @Condition("hasPosition==true") ulong position;
242 
243     mixin Make!(Endian.bigEndian, varuint);
244 
245     string toString()
246     {
247         return "OptionalPosition(hasPosition: " ~ std.conv.to!string(this.hasPosition) ~ ", position: " ~ std.conv.to!string(this.position) ~ ")";
248     }
249 
250 }
251 
252 struct OptionalUuid
253 {
254 
255     enum string[] __fields = ["hasUuid", "uuid"];
256 
257     bool hasUuid;
258     @Condition("hasUuid==true") UUID uuid;
259 
260     mixin Make!(Endian.bigEndian, varuint);
261 
262     string toString()
263     {
264         return "OptionalUuid(hasUuid: " ~ std.conv.to!string(this.hasUuid) ~ ", uuid: " ~ std.conv.to!string(this.uuid) ~ ")";
265     }
266 
267 }
268 
269 struct Tag
270 {
271 
272     enum string[] __fields = ["name", "entries"];
273 
274     string name;
275     @Var uint[] entries;
276 
277     mixin Make!(Endian.bigEndian, varuint);
278 
279     string toString()
280     {
281         return "Tag(name: " ~ std.conv.to!string(this.name) ~ ", entries: " ~ std.conv.to!string(this.entries) ~ ")";
282     }
283 
284 }
285 
286 struct Statistic
287 {
288 
289     enum string[] __fields = ["category", "statistic", "value"];
290 
291     @Var uint category;
292     @Var uint statistic;
293     @Var uint value;
294 
295     mixin Make!(Endian.bigEndian, varuint);
296 
297     string toString()
298     {
299         return "Statistic(category: " ~ std.conv.to!string(this.category) ~ ", statistic: " ~ std.conv.to!string(this.statistic) ~ ", value: " ~ std.conv.to!string(this.value) ~ ")";
300     }
301 
302 }
303 
304 struct BlockChange
305 {
306 
307     enum string[] __fields = ["xz", "y", "block"];
308 
309     ubyte xz;
310     ubyte y;
311     @Var uint block;
312 
313     mixin Make!(Endian.bigEndian, varuint);
314 
315     string toString()
316     {
317         return "BlockChange(xz: " ~ std.conv.to!string(this.xz) ~ ", y: " ~ std.conv.to!string(this.y) ~ ", block: " ~ std.conv.to!string(this.block) ~ ")";
318     }
319 
320 }
321 
322 struct Match
323 {
324 
325     enum string[] __fields = ["match", "hasTooltip", "tooltip"];
326 
327     string match;
328     bool hasTooltip;
329     @Condition("hasTooltip==true") string tooltip;
330 
331     mixin Make!(Endian.bigEndian, varuint);
332 
333     string toString()
334     {
335         return "Match(match: " ~ std.conv.to!string(this.match) ~ ", hasTooltip: " ~ std.conv.to!string(this.hasTooltip) ~ ", tooltip: " ~ std.conv.to!string(this.tooltip) ~ ")";
336     }
337 
338 }
339 
340 struct Node
341 {
342 
343     enum string[] __fields = ["flags", "children", "redirectNode", "name", "parser", "properties"];
344 
345     ubyte flags;
346     @Var uint[] children;
347     @Condition("(flags&8)!=0") @Var uint redirectNode;
348     @Condition("(flags&1)!=0||(flags&2)!=0") string name;
349     @Condition("(flags&2)!=0") string parser;
350     @Condition("(flags&2)!=0") @NoLength ubyte[] properties;
351 
352     mixin Make!(Endian.bigEndian, varuint);
353 
354     string toString()
355     {
356         return "Node(flags: " ~ std.conv.to!string(this.flags) ~ ", children: " ~ std.conv.to!string(this.children) ~ ", redirectNode: " ~ std.conv.to!string(this.redirectNode) ~ ", name: " ~ std.conv.to!string(this.name) ~ ", parser: " ~ std.conv.to!string(this.parser) ~ ", properties: " ~ std.conv.to!string(this.properties) ~ ")";
357     }
358 
359 }
360 
361 struct Icon
362 {
363 
364     // type
365     enum uint WHITE_ARROW = 0;
366     enum uint GREEN_ARROW = 1;
367     enum uint RED_ARROW = 2;
368     enum uint BLUE_ARROW = 3;
369     enum uint WHITE_CROSS = 4;
370     enum uint RED_POINTER = 5;
371     enum uint WHITE_CIRCLE = 6;
372     enum uint SMALL_WHITE_CIRCLE = 7;
373     enum uint MANSION = 8;
374     enum uint TEMPLE = 9;
375     enum uint WHITE_BANNER = 10;
376     enum uint ORANGE_BANNER = 11;
377     enum uint MAGENTA_BANNER = 12;
378     enum uint LIGHT_BLUE_BANNER = 13;
379     enum uint YELLOW_BANNER = 14;
380     enum uint LIME_BANNER = 15;
381     enum uint PINK_BANNER = 16;
382     enum uint GRAY_BANNER = 17;
383     enum uint LIGHT_GRAY_BANNER = 18;
384     enum uint CYAN_BANNER = 19;
385     enum uint PURPLE_BANNER = 20;
386     enum uint BLUE_BANNER = 21;
387     enum uint BROWN_BANNER = 22;
388     enum uint GREEN_BANNER = 23;
389     enum uint RED_BANNER = 24;
390     enum uint BLACK_BANNER = 25;
391     enum uint TREASURE_MARKER = 26;
392 
393     enum string[] __fields = ["type", "x", "z", "direction", "hasDisplayName", "displayName"];
394 
395     @Var uint type;
396     ubyte x;
397     ubyte z;
398     ubyte direction;
399     bool hasDisplayName;
400     @Condition("hasDisplayName==true") string displayName;
401 
402     mixin Make!(Endian.bigEndian, varuint);
403 
404     string toString()
405     {
406         return "Icon(type: " ~ std.conv.to!string(this.type) ~ ", x: " ~ std.conv.to!string(this.x) ~ ", z: " ~ std.conv.to!string(this.z) ~ ", direction: " ~ std.conv.to!string(this.direction) ~ ", hasDisplayName: " ~ std.conv.to!string(this.hasDisplayName) ~ ", displayName: " ~ std.conv.to!string(this.displayName) ~ ")";
407     }
408 
409 }
410 
411 struct Recipe
412 {
413 
414     enum string[] __fields = ["recipeId"];
415 
416     @Var uint recipeId;
417 
418     mixin Make!(Endian.bigEndian, varuint);
419 
420     string toString()
421     {
422         return "Recipe(recipeId: " ~ std.conv.to!string(this.recipeId) ~ ")";
423     }
424 
425 }