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