1 /*
2  * This file was automatically generated by sel-utils and
3  * released under the MIT License.
4  * 
5  * License: https://github.com/sel-project/sel-utils/blob/master/LICENSE
6  * Repository: https://github.com/sel-project/sel-utils
7  * Generated from https://github.com/sel-project/sel-utils/blob/master/xml/metadata/pocket105.xml
8  */
9 module sul.metadata.pocket105;
10 
11 import std.typecons : Tuple, tuple;
12 
13 import sul.utils.buffer : Buffer;
14 import sul.utils.var;
15 
16 static import sul.protocol.pocket105.types;
17 
18 alias Changed(T) = Tuple!(T, "value", bool, "changed");
19 
20 class Metadata {
21 
22 	private bool _cached = false;
23 	private ubyte[] _cache;
24 
25 	private void delegate(Buffer) pure nothrow @safe[] _changed;
26 
27 	private long _entityFlags = cast(long)0;
28 	private Changed!(int) _variant;
29 	private Changed!(byte) _color;
30 	private Changed!(string) _nametag;
31 	private Changed!(long) _owner = tuple(cast(long)-1, false);
32 	private short _air = cast(short)0;
33 	private Changed!(int) _potionColor;
34 	private Changed!(byte) _potionAmbient;
35 	private Changed!(byte) _slimeSize = tuple(cast(byte)1, false);
36 	private Changed!(byte) _playerFlags;
37 	private Changed!(int) _playerIndex;
38 	private Changed!(Tuple!(int, "x", int, "y", int, "z")) _bedPosition;
39 	private long _leadHolder = cast(long)-1;
40 	private Changed!(float) _scale = tuple(cast(float)1, false);
41 	private Changed!(string) _interactiveTag;
42 	private Changed!(string) _interactiveTagUrl;
43 	private Changed!(short) _maxAir;
44 	private Changed!(int) _markVariant;
45 	private Changed!(float) _boundingBoxWidth;
46 	private Changed!(float) _boundingBoxHeight;
47 	private Changed!(int) _fuseLength;
48 	private Changed!(float) _areaEffectCloudRadius;
49 	private Changed!(int) _areaEffectCloudWaiting;
50 	private Changed!(int) _areaEffectCloudParticle;
51 	private Changed!(long) _tradingPlayer;
52 
53 	public pure nothrow @safe this() {
54 		this.reset();
55 	}
56 
57 	public pure nothrow @safe void reset() {
58 		this._changed = [
59 			&this.encodeEntityFlags,
60 			&this.encodeAir,
61 			&this.encodeLeadHolder,
62 		];
63 	}
64 
65 	public pure nothrow @property @safe @nogc long entityFlags() {
66 		return _entityFlags;
67 	}
68 
69 	public pure nothrow @property @safe long entityFlags(long value) {
70 		this._cached = false;
71 		this._entityFlags = value;
72 		return value;
73 	}
74 
75 	public pure nothrow @safe encodeEntityFlags(Buffer buffer) {
76 		with(buffer) {
77 			writeBytes(varuint.encode(0));
78 			writeBytes(varuint.encode(7));
79 			writeBytes(varlong.encode(this._entityFlags));
80 		}
81 	}
82 
83 	public pure nothrow @property @safe bool onFire() {
84 		return (_entityFlags >>> 0) & 1;
85 	}
86 
87 	public pure nothrow @property @safe bool onFire(bool value) {
88 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 0));
89 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 0));
90 		return value;
91 	}
92 
93 	public pure nothrow @property @safe bool sneaking() {
94 		return (_entityFlags >>> 1) & 1;
95 	}
96 
97 	public pure nothrow @property @safe bool sneaking(bool value) {
98 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 1));
99 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 1));
100 		return value;
101 	}
102 
103 	public pure nothrow @property @safe bool riding() {
104 		return (_entityFlags >>> 2) & 1;
105 	}
106 
107 	public pure nothrow @property @safe bool riding(bool value) {
108 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 2));
109 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 2));
110 		return value;
111 	}
112 
113 	public pure nothrow @property @safe bool sprinting() {
114 		return (_entityFlags >>> 3) & 1;
115 	}
116 
117 	public pure nothrow @property @safe bool sprinting(bool value) {
118 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 3));
119 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 3));
120 		return value;
121 	}
122 
123 	public pure nothrow @property @safe bool usingItem() {
124 		return (_entityFlags >>> 4) & 1;
125 	}
126 
127 	public pure nothrow @property @safe bool usingItem(bool value) {
128 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 4));
129 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 4));
130 		return value;
131 	}
132 
133 	public pure nothrow @property @safe bool invisible() {
134 		return (_entityFlags >>> 5) & 1;
135 	}
136 
137 	public pure nothrow @property @safe bool invisible(bool value) {
138 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 5));
139 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 5));
140 		return value;
141 	}
142 
143 	public pure nothrow @property @safe bool tempted() {
144 		return (_entityFlags >>> 6) & 1;
145 	}
146 
147 	public pure nothrow @property @safe bool tempted(bool value) {
148 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 6));
149 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 6));
150 		return value;
151 	}
152 
153 	public pure nothrow @property @safe bool inLove() {
154 		return (_entityFlags >>> 7) & 1;
155 	}
156 
157 	public pure nothrow @property @safe bool inLove(bool value) {
158 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 7));
159 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 7));
160 		return value;
161 	}
162 
163 	public pure nothrow @property @safe bool saddled() {
164 		return (_entityFlags >>> 8) & 1;
165 	}
166 
167 	public pure nothrow @property @safe bool saddled(bool value) {
168 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 8));
169 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 8));
170 		return value;
171 	}
172 
173 	public pure nothrow @property @safe bool powered() {
174 		return (_entityFlags >>> 9) & 1;
175 	}
176 
177 	public pure nothrow @property @safe bool powered(bool value) {
178 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 9));
179 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 9));
180 		return value;
181 	}
182 
183 	public pure nothrow @property @safe bool ignited() {
184 		return (_entityFlags >>> 10) & 1;
185 	}
186 
187 	public pure nothrow @property @safe bool ignited(bool value) {
188 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 10));
189 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 10));
190 		return value;
191 	}
192 
193 	public pure nothrow @property @safe bool baby() {
194 		return (_entityFlags >>> 11) & 1;
195 	}
196 
197 	public pure nothrow @property @safe bool baby(bool value) {
198 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 11));
199 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 11));
200 		return value;
201 	}
202 
203 	public pure nothrow @property @safe bool converting() {
204 		return (_entityFlags >>> 12) & 1;
205 	}
206 
207 	public pure nothrow @property @safe bool converting(bool value) {
208 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 12));
209 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 12));
210 		return value;
211 	}
212 
213 	public pure nothrow @property @safe bool critical() {
214 		return (_entityFlags >>> 13) & 1;
215 	}
216 
217 	public pure nothrow @property @safe bool critical(bool value) {
218 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 13));
219 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 13));
220 		return value;
221 	}
222 
223 	public pure nothrow @property @safe bool showNametag() {
224 		return (_entityFlags >>> 14) & 1;
225 	}
226 
227 	public pure nothrow @property @safe bool showNametag(bool value) {
228 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 14));
229 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 14));
230 		return value;
231 	}
232 
233 	public pure nothrow @property @safe bool alwaysShowNametag() {
234 		return (_entityFlags >>> 15) & 1;
235 	}
236 
237 	public pure nothrow @property @safe bool alwaysShowNametag(bool value) {
238 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 15));
239 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 15));
240 		return value;
241 	}
242 
243 	public pure nothrow @property @safe bool noAi() {
244 		return (_entityFlags >>> 16) & 1;
245 	}
246 
247 	public pure nothrow @property @safe bool noAi(bool value) {
248 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 16));
249 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 16));
250 		return value;
251 	}
252 
253 	public pure nothrow @property @safe bool silent() {
254 		return (_entityFlags >>> 17) & 1;
255 	}
256 
257 	public pure nothrow @property @safe bool silent(bool value) {
258 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 17));
259 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 17));
260 		return value;
261 	}
262 
263 	public pure nothrow @property @safe bool climbing() {
264 		return (_entityFlags >>> 18) & 1;
265 	}
266 
267 	public pure nothrow @property @safe bool climbing(bool value) {
268 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 18));
269 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 18));
270 		return value;
271 	}
272 
273 	public pure nothrow @property @safe bool resting() {
274 		return (_entityFlags >>> 19) & 1;
275 	}
276 
277 	public pure nothrow @property @safe bool resting(bool value) {
278 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 19));
279 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 19));
280 		return value;
281 	}
282 
283 	public pure nothrow @property @safe bool sitting() {
284 		return (_entityFlags >>> 20) & 1;
285 	}
286 
287 	public pure nothrow @property @safe bool sitting(bool value) {
288 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 20));
289 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 20));
290 		return value;
291 	}
292 
293 	public pure nothrow @property @safe bool angry() {
294 		return (_entityFlags >>> 21) & 1;
295 	}
296 
297 	public pure nothrow @property @safe bool angry(bool value) {
298 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 21));
299 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 21));
300 		return value;
301 	}
302 
303 	public pure nothrow @property @safe bool interested() {
304 		return (_entityFlags >>> 22) & 1;
305 	}
306 
307 	public pure nothrow @property @safe bool interested(bool value) {
308 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 22));
309 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 22));
310 		return value;
311 	}
312 
313 	public pure nothrow @property @safe bool charged() {
314 		return (_entityFlags >>> 23) & 1;
315 	}
316 
317 	public pure nothrow @property @safe bool charged(bool value) {
318 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 23));
319 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 23));
320 		return value;
321 	}
322 
323 	public pure nothrow @property @safe bool tamed() {
324 		return (_entityFlags >>> 24) & 1;
325 	}
326 
327 	public pure nothrow @property @safe bool tamed(bool value) {
328 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 24));
329 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 24));
330 		return value;
331 	}
332 
333 	public pure nothrow @property @safe bool leashed() {
334 		return (_entityFlags >>> 25) & 1;
335 	}
336 
337 	public pure nothrow @property @safe bool leashed(bool value) {
338 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 25));
339 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 25));
340 		return value;
341 	}
342 
343 	public pure nothrow @property @safe bool sheared() {
344 		return (_entityFlags >>> 26) & 1;
345 	}
346 
347 	public pure nothrow @property @safe bool sheared(bool value) {
348 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 26));
349 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 26));
350 		return value;
351 	}
352 
353 	public pure nothrow @property @safe bool gliding() {
354 		return (_entityFlags >>> 27) & 1;
355 	}
356 
357 	public pure nothrow @property @safe bool gliding(bool value) {
358 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 27));
359 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 27));
360 		return value;
361 	}
362 
363 	public pure nothrow @property @safe bool elder() {
364 		return (_entityFlags >>> 28) & 1;
365 	}
366 
367 	public pure nothrow @property @safe bool elder(bool value) {
368 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 28));
369 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 28));
370 		return value;
371 	}
372 
373 	public pure nothrow @property @safe bool moving() {
374 		return (_entityFlags >>> 29) & 1;
375 	}
376 
377 	public pure nothrow @property @safe bool moving(bool value) {
378 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 29));
379 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 29));
380 		return value;
381 	}
382 
383 	public pure nothrow @property @safe bool breathing() {
384 		return (_entityFlags >>> 30) & 1;
385 	}
386 
387 	public pure nothrow @property @safe bool breathing(bool value) {
388 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 30));
389 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 30));
390 		return value;
391 	}
392 
393 	public pure nothrow @property @safe bool chested() {
394 		return (_entityFlags >>> 31) & 1;
395 	}
396 
397 	public pure nothrow @property @safe bool chested(bool value) {
398 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 31));
399 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 31));
400 		return value;
401 	}
402 
403 	public pure nothrow @property @safe bool stackable() {
404 		return (_entityFlags >>> 32) & 1;
405 	}
406 
407 	public pure nothrow @property @safe bool stackable(bool value) {
408 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 32));
409 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 32));
410 		return value;
411 	}
412 
413 	public pure nothrow @property @safe bool idling() {
414 		return (_entityFlags >>> 36) & 1;
415 	}
416 
417 	public pure nothrow @property @safe bool idling(bool value) {
418 		if(value) entityFlags = cast(long)(_entityFlags | (cast(long)true << 36));
419 		else entityFlags = cast(long)(_entityFlags & ~(cast(long)true << 36));
420 		return value;
421 	}
422 
423 	public pure nothrow @property @safe @nogc int variant() {
424 		return _variant.value;
425 	}
426 
427 	public pure nothrow @property @safe int variant(int value) {
428 		this._cached = false;
429 		this._variant.value = value;
430 		if(!this._variant.changed) {
431 			this._variant.changed = true;
432 			this._changed ~= &this.encodeVariant;
433 		}
434 		return value;
435 	}
436 
437 	public pure nothrow @safe encodeVariant(Buffer buffer) {
438 		with(buffer) {
439 			writeBytes(varuint.encode(2));
440 			writeBytes(varuint.encode(2));
441 			writeBytes(varint.encode(this._variant.value));
442 		}
443 	}
444 
445 	public pure nothrow @property @safe @nogc byte color() {
446 		return _color.value;
447 	}
448 
449 	public pure nothrow @property @safe byte color(byte value) {
450 		this._cached = false;
451 		this._color.value = value;
452 		if(!this._color.changed) {
453 			this._color.changed = true;
454 			this._changed ~= &this.encodeColor;
455 		}
456 		return value;
457 	}
458 
459 	public pure nothrow @safe encodeColor(Buffer buffer) {
460 		with(buffer) {
461 			writeBytes(varuint.encode(3));
462 			writeBytes(varuint.encode(0));
463 			writeBigEndianByte(this._color.value);
464 		}
465 	}
466 
467 	public pure nothrow @property @safe @nogc string nametag() {
468 		return _nametag.value;
469 	}
470 
471 	public pure nothrow @property @safe string nametag(string value) {
472 		this._cached = false;
473 		this._nametag.value = value;
474 		if(!this._nametag.changed) {
475 			this._nametag.changed = true;
476 			this._changed ~= &this.encodeNametag;
477 		}
478 		return value;
479 	}
480 
481 	public pure nothrow @safe encodeNametag(Buffer buffer) {
482 		with(buffer) {
483 			writeBytes(varuint.encode(4));
484 			writeBytes(varuint.encode(4));
485 			writeBytes(varuint.encode(cast(uint)this._nametag.value.length)); writeString(this._nametag.value);
486 		}
487 	}
488 
489 	public pure nothrow @property @safe @nogc long owner() {
490 		return _owner.value;
491 	}
492 
493 	public pure nothrow @property @safe long owner(long value) {
494 		this._cached = false;
495 		this._owner.value = value;
496 		if(!this._owner.changed) {
497 			this._owner.changed = true;
498 			this._changed ~= &this.encodeOwner;
499 		}
500 		return value;
501 	}
502 
503 	public pure nothrow @safe encodeOwner(Buffer buffer) {
504 		with(buffer) {
505 			writeBytes(varuint.encode(5));
506 			writeBytes(varuint.encode(7));
507 			writeBytes(varlong.encode(this._owner.value));
508 		}
509 	}
510 
511 	public pure nothrow @property @safe @nogc short air() {
512 		return _air;
513 	}
514 
515 	public pure nothrow @property @safe short air(short value) {
516 		this._cached = false;
517 		this._air = value;
518 		return value;
519 	}
520 
521 	public pure nothrow @safe encodeAir(Buffer buffer) {
522 		with(buffer) {
523 			writeBytes(varuint.encode(7));
524 			writeBytes(varuint.encode(1));
525 			writeLittleEndianShort(this._air);
526 		}
527 	}
528 
529 	public pure nothrow @property @safe @nogc int potionColor() {
530 		return _potionColor.value;
531 	}
532 
533 	public pure nothrow @property @safe int potionColor(int value) {
534 		this._cached = false;
535 		this._potionColor.value = value;
536 		if(!this._potionColor.changed) {
537 			this._potionColor.changed = true;
538 			this._changed ~= &this.encodePotionColor;
539 		}
540 		return value;
541 	}
542 
543 	public pure nothrow @safe encodePotionColor(Buffer buffer) {
544 		with(buffer) {
545 			writeBytes(varuint.encode(8));
546 			writeBytes(varuint.encode(2));
547 			writeBytes(varint.encode(this._potionColor.value));
548 		}
549 	}
550 
551 	public pure nothrow @property @safe @nogc byte potionAmbient() {
552 		return _potionAmbient.value;
553 	}
554 
555 	public pure nothrow @property @safe byte potionAmbient(byte value) {
556 		this._cached = false;
557 		this._potionAmbient.value = value;
558 		if(!this._potionAmbient.changed) {
559 			this._potionAmbient.changed = true;
560 			this._changed ~= &this.encodePotionAmbient;
561 		}
562 		return value;
563 	}
564 
565 	public pure nothrow @safe encodePotionAmbient(Buffer buffer) {
566 		with(buffer) {
567 			writeBytes(varuint.encode(9));
568 			writeBytes(varuint.encode(0));
569 			writeBigEndianByte(this._potionAmbient.value);
570 		}
571 	}
572 
573 	public pure nothrow @property @safe @nogc byte slimeSize() {
574 		return _slimeSize.value;
575 	}
576 
577 	public pure nothrow @property @safe byte slimeSize(byte value) {
578 		this._cached = false;
579 		this._slimeSize.value = value;
580 		if(!this._slimeSize.changed) {
581 			this._slimeSize.changed = true;
582 			this._changed ~= &this.encodeSlimeSize;
583 		}
584 		return value;
585 	}
586 
587 	public pure nothrow @safe encodeSlimeSize(Buffer buffer) {
588 		with(buffer) {
589 			writeBytes(varuint.encode(16));
590 			writeBytes(varuint.encode(0));
591 			writeBigEndianByte(this._slimeSize.value);
592 		}
593 	}
594 
595 	public pure nothrow @property @safe @nogc byte playerFlags() {
596 		return _playerFlags.value;
597 	}
598 
599 	public pure nothrow @property @safe byte playerFlags(byte value) {
600 		this._cached = false;
601 		this._playerFlags.value = value;
602 		if(!this._playerFlags.changed) {
603 			this._playerFlags.changed = true;
604 			this._changed ~= &this.encodePlayerFlags;
605 		}
606 		return value;
607 	}
608 
609 	public pure nothrow @safe encodePlayerFlags(Buffer buffer) {
610 		with(buffer) {
611 			writeBytes(varuint.encode(27));
612 			writeBytes(varuint.encode(0));
613 			writeBigEndianByte(this._playerFlags.value);
614 		}
615 	}
616 
617 	public pure nothrow @property @safe bool asleep() {
618 		return (_playerFlags.value >>> 1) & 1;
619 	}
620 
621 	public pure nothrow @property @safe bool asleep(bool value) {
622 		if(value) playerFlags = cast(byte)(_playerFlags.value | (cast(byte)true << 1));
623 		else playerFlags = cast(byte)(_playerFlags.value & ~(cast(byte)true << 1));
624 		return value;
625 	}
626 
627 	public pure nothrow @property @safe @nogc int playerIndex() {
628 		return _playerIndex.value;
629 	}
630 
631 	public pure nothrow @property @safe int playerIndex(int value) {
632 		this._cached = false;
633 		this._playerIndex.value = value;
634 		if(!this._playerIndex.changed) {
635 			this._playerIndex.changed = true;
636 			this._changed ~= &this.encodePlayerIndex;
637 		}
638 		return value;
639 	}
640 
641 	public pure nothrow @safe encodePlayerIndex(Buffer buffer) {
642 		with(buffer) {
643 			writeBytes(varuint.encode(28));
644 			writeBytes(varuint.encode(2));
645 			writeBytes(varint.encode(this._playerIndex.value));
646 		}
647 	}
648 
649 	public pure nothrow @property @safe @nogc Tuple!(int, "x", int, "y", int, "z") bedPosition() {
650 		return _bedPosition.value;
651 	}
652 
653 	public pure nothrow @property @safe Tuple!(int, "x", int, "y", int, "z") bedPosition(Tuple!(int, "x", int, "y", int, "z") value) {
654 		this._cached = false;
655 		this._bedPosition.value = value;
656 		if(!this._bedPosition.changed) {
657 			this._bedPosition.changed = true;
658 			this._changed ~= &this.encodeBedPosition;
659 		}
660 		return value;
661 	}
662 
663 	public pure nothrow @safe encodeBedPosition(Buffer buffer) {
664 		with(buffer) {
665 			writeBytes(varuint.encode(29));
666 			writeBytes(varuint.encode(6));
667 			writeBytes(varint.encode(this._bedPosition.value.x)); writeBytes(varint.encode(this._bedPosition.value.y)); writeBytes(varint.encode(this._bedPosition.value.z));
668 		}
669 	}
670 
671 	public pure nothrow @property @safe @nogc long leadHolder() {
672 		return _leadHolder;
673 	}
674 
675 	public pure nothrow @property @safe long leadHolder(long value) {
676 		this._cached = false;
677 		this._leadHolder = value;
678 		return value;
679 	}
680 
681 	public pure nothrow @safe encodeLeadHolder(Buffer buffer) {
682 		with(buffer) {
683 			writeBytes(varuint.encode(38));
684 			writeBytes(varuint.encode(7));
685 			writeBytes(varlong.encode(this._leadHolder));
686 		}
687 	}
688 
689 	public pure nothrow @property @safe @nogc float scale() {
690 		return _scale.value;
691 	}
692 
693 	public pure nothrow @property @safe float scale(float value) {
694 		this._cached = false;
695 		this._scale.value = value;
696 		if(!this._scale.changed) {
697 			this._scale.changed = true;
698 			this._changed ~= &this.encodeScale;
699 		}
700 		return value;
701 	}
702 
703 	public pure nothrow @safe encodeScale(Buffer buffer) {
704 		with(buffer) {
705 			writeBytes(varuint.encode(39));
706 			writeBytes(varuint.encode(3));
707 			writeLittleEndianFloat(this._scale.value);
708 		}
709 	}
710 
711 	public pure nothrow @property @safe @nogc string interactiveTag() {
712 		return _interactiveTag.value;
713 	}
714 
715 	public pure nothrow @property @safe string interactiveTag(string value) {
716 		this._cached = false;
717 		this._interactiveTag.value = value;
718 		if(!this._interactiveTag.changed) {
719 			this._interactiveTag.changed = true;
720 			this._changed ~= &this.encodeInteractiveTag;
721 		}
722 		return value;
723 	}
724 
725 	public pure nothrow @safe encodeInteractiveTag(Buffer buffer) {
726 		with(buffer) {
727 			writeBytes(varuint.encode(40));
728 			writeBytes(varuint.encode(4));
729 			writeBytes(varuint.encode(cast(uint)this._interactiveTag.value.length)); writeString(this._interactiveTag.value);
730 		}
731 	}
732 
733 	public pure nothrow @property @safe @nogc string interactiveTagUrl() {
734 		return _interactiveTagUrl.value;
735 	}
736 
737 	public pure nothrow @property @safe string interactiveTagUrl(string value) {
738 		this._cached = false;
739 		this._interactiveTagUrl.value = value;
740 		if(!this._interactiveTagUrl.changed) {
741 			this._interactiveTagUrl.changed = true;
742 			this._changed ~= &this.encodeInteractiveTagUrl;
743 		}
744 		return value;
745 	}
746 
747 	public pure nothrow @safe encodeInteractiveTagUrl(Buffer buffer) {
748 		with(buffer) {
749 			writeBytes(varuint.encode(43));
750 			writeBytes(varuint.encode(4));
751 			writeBytes(varuint.encode(cast(uint)this._interactiveTagUrl.value.length)); writeString(this._interactiveTagUrl.value);
752 		}
753 	}
754 
755 	public pure nothrow @property @safe @nogc short maxAir() {
756 		return _maxAir.value;
757 	}
758 
759 	public pure nothrow @property @safe short maxAir(short value) {
760 		this._cached = false;
761 		this._maxAir.value = value;
762 		if(!this._maxAir.changed) {
763 			this._maxAir.changed = true;
764 			this._changed ~= &this.encodeMaxAir;
765 		}
766 		return value;
767 	}
768 
769 	public pure nothrow @safe encodeMaxAir(Buffer buffer) {
770 		with(buffer) {
771 			writeBytes(varuint.encode(44));
772 			writeBytes(varuint.encode(1));
773 			writeLittleEndianShort(this._maxAir.value);
774 		}
775 	}
776 
777 	public pure nothrow @property @safe @nogc int markVariant() {
778 		return _markVariant.value;
779 	}
780 
781 	public pure nothrow @property @safe int markVariant(int value) {
782 		this._cached = false;
783 		this._markVariant.value = value;
784 		if(!this._markVariant.changed) {
785 			this._markVariant.changed = true;
786 			this._changed ~= &this.encodeMarkVariant;
787 		}
788 		return value;
789 	}
790 
791 	public pure nothrow @safe encodeMarkVariant(Buffer buffer) {
792 		with(buffer) {
793 			writeBytes(varuint.encode(45));
794 			writeBytes(varuint.encode(2));
795 			writeBytes(varint.encode(this._markVariant.value));
796 		}
797 	}
798 
799 	public pure nothrow @property @safe @nogc float boundingBoxWidth() {
800 		return _boundingBoxWidth.value;
801 	}
802 
803 	public pure nothrow @property @safe float boundingBoxWidth(float value) {
804 		this._cached = false;
805 		this._boundingBoxWidth.value = value;
806 		if(!this._boundingBoxWidth.changed) {
807 			this._boundingBoxWidth.changed = true;
808 			this._changed ~= &this.encodeBoundingBoxWidth;
809 		}
810 		return value;
811 	}
812 
813 	public pure nothrow @safe encodeBoundingBoxWidth(Buffer buffer) {
814 		with(buffer) {
815 			writeBytes(varuint.encode(54));
816 			writeBytes(varuint.encode(3));
817 			writeLittleEndianFloat(this._boundingBoxWidth.value);
818 		}
819 	}
820 
821 	public pure nothrow @property @safe @nogc float boundingBoxHeight() {
822 		return _boundingBoxHeight.value;
823 	}
824 
825 	public pure nothrow @property @safe float boundingBoxHeight(float value) {
826 		this._cached = false;
827 		this._boundingBoxHeight.value = value;
828 		if(!this._boundingBoxHeight.changed) {
829 			this._boundingBoxHeight.changed = true;
830 			this._changed ~= &this.encodeBoundingBoxHeight;
831 		}
832 		return value;
833 	}
834 
835 	public pure nothrow @safe encodeBoundingBoxHeight(Buffer buffer) {
836 		with(buffer) {
837 			writeBytes(varuint.encode(55));
838 			writeBytes(varuint.encode(3));
839 			writeLittleEndianFloat(this._boundingBoxHeight.value);
840 		}
841 	}
842 
843 	public pure nothrow @property @safe @nogc int fuseLength() {
844 		return _fuseLength.value;
845 	}
846 
847 	public pure nothrow @property @safe int fuseLength(int value) {
848 		this._cached = false;
849 		this._fuseLength.value = value;
850 		if(!this._fuseLength.changed) {
851 			this._fuseLength.changed = true;
852 			this._changed ~= &this.encodeFuseLength;
853 		}
854 		return value;
855 	}
856 
857 	public pure nothrow @safe encodeFuseLength(Buffer buffer) {
858 		with(buffer) {
859 			writeBytes(varuint.encode(56));
860 			writeBytes(varuint.encode(2));
861 			writeBytes(varint.encode(this._fuseLength.value));
862 		}
863 	}
864 
865 	public pure nothrow @property @safe @nogc float areaEffectCloudRadius() {
866 		return _areaEffectCloudRadius.value;
867 	}
868 
869 	public pure nothrow @property @safe float areaEffectCloudRadius(float value) {
870 		this._cached = false;
871 		this._areaEffectCloudRadius.value = value;
872 		if(!this._areaEffectCloudRadius.changed) {
873 			this._areaEffectCloudRadius.changed = true;
874 			this._changed ~= &this.encodeAreaEffectCloudRadius;
875 		}
876 		return value;
877 	}
878 
879 	public pure nothrow @safe encodeAreaEffectCloudRadius(Buffer buffer) {
880 		with(buffer) {
881 			writeBytes(varuint.encode(61));
882 			writeBytes(varuint.encode(3));
883 			writeLittleEndianFloat(this._areaEffectCloudRadius.value);
884 		}
885 	}
886 
887 	public pure nothrow @property @safe @nogc int areaEffectCloudWaiting() {
888 		return _areaEffectCloudWaiting.value;
889 	}
890 
891 	public pure nothrow @property @safe int areaEffectCloudWaiting(int value) {
892 		this._cached = false;
893 		this._areaEffectCloudWaiting.value = value;
894 		if(!this._areaEffectCloudWaiting.changed) {
895 			this._areaEffectCloudWaiting.changed = true;
896 			this._changed ~= &this.encodeAreaEffectCloudWaiting;
897 		}
898 		return value;
899 	}
900 
901 	public pure nothrow @safe encodeAreaEffectCloudWaiting(Buffer buffer) {
902 		with(buffer) {
903 			writeBytes(varuint.encode(62));
904 			writeBytes(varuint.encode(2));
905 			writeBytes(varint.encode(this._areaEffectCloudWaiting.value));
906 		}
907 	}
908 
909 	public pure nothrow @property @safe @nogc int areaEffectCloudParticle() {
910 		return _areaEffectCloudParticle.value;
911 	}
912 
913 	public pure nothrow @property @safe int areaEffectCloudParticle(int value) {
914 		this._cached = false;
915 		this._areaEffectCloudParticle.value = value;
916 		if(!this._areaEffectCloudParticle.changed) {
917 			this._areaEffectCloudParticle.changed = true;
918 			this._changed ~= &this.encodeAreaEffectCloudParticle;
919 		}
920 		return value;
921 	}
922 
923 	public pure nothrow @safe encodeAreaEffectCloudParticle(Buffer buffer) {
924 		with(buffer) {
925 			writeBytes(varuint.encode(63));
926 			writeBytes(varuint.encode(2));
927 			writeBytes(varint.encode(this._areaEffectCloudParticle.value));
928 		}
929 	}
930 
931 	public pure nothrow @property @safe @nogc long tradingPlayer() {
932 		return _tradingPlayer.value;
933 	}
934 
935 	public pure nothrow @property @safe long tradingPlayer(long value) {
936 		this._cached = false;
937 		this._tradingPlayer.value = value;
938 		if(!this._tradingPlayer.changed) {
939 			this._tradingPlayer.changed = true;
940 			this._changed ~= &this.encodeTradingPlayer;
941 		}
942 		return value;
943 	}
944 
945 	public pure nothrow @safe encodeTradingPlayer(Buffer buffer) {
946 		with(buffer) {
947 			writeBytes(varuint.encode(68));
948 			writeBytes(varuint.encode(7));
949 			writeBytes(varlong.encode(this._tradingPlayer.value));
950 		}
951 	}
952 
953 	public pure nothrow @safe encode(Buffer buffer) {
954 		with(buffer) {
955 			if(this._cached) {
956 				buffer.writeBytes(this._cache);
957 			} else {
958 				immutable start = buffer._buffer.length;
959 				writeBytes(varuint.encode(cast(uint)this._changed.length));
960 				foreach(del ; this._changed) del(buffer);
961 				this._cached = true;
962 				this._cache = buffer._buffer[start..$];
963 			}
964 		}
965 	}
966 
967 	public static pure nothrow @safe Metadata decode(Buffer buffer) {
968 		return null;
969 	}
970 
971 }