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/pocket113.xml 8 */ 9 module sul.metadata.pocket113; 10 11 import std.typecons : Tuple, tuple; 12 13 import sul.utils.buffer : Buffer; 14 import sul.utils.metadataflags; 15 import sul.utils.var; 16 17 static import sul.protocol.pocket113.types; 18 19 alias Changed(T) = Tuple!(T, "value", bool, "changed"); 20 21 enum MetadataType : uint { 22 23 BYTE = 0, 24 SHORT = 1, 25 INT = 2, 26 FLOAT = 3, 27 STRING = 4, 28 SLOT = 5, 29 BLOCK_POSITION = 6, 30 LONG = 7, 31 ENTITY_POSITION = 8, 32 } 33 34 class Metadata { 35 36 public enum ENTITY_FLAGS : size_t { 37 ON_FIRE = 0, 38 SNEAKING = 1, 39 RIDING = 2, 40 SPRINTING = 3, 41 USING_ITEM = 4, 42 INVISIBLE = 5, 43 TEMPTED = 6, 44 IN_LOVE = 7, 45 SADDLED = 8, 46 POWERED = 9, 47 IGNITED = 10, 48 BABY = 11, 49 CONVERTING = 12, 50 CRITICAL = 13, 51 SHOW_NAMETAG = 14, 52 ALWAYS_SHOW_NAMETAG = 15, 53 NO_AI = 16, 54 SILENT = 17, 55 CLIMBING = 18, 56 CAN_CLIMB = 19, 57 CAN_SWIM = 20, 58 CAN_FLY = 21, 59 RESTING = 22, 60 SITTING = 23, 61 ANGRY = 24, 62 INTERESTED = 25, 63 CHARGED = 26, 64 TAMED = 27, 65 LEASHED = 28, 66 SHEARED = 29, 67 GLIDING = 30, 68 ELDER = 31, 69 MOVING = 32, 70 BREATHING = 33, 71 CHESTED = 34, 72 STACKABLE = 35, 73 SHOWBASE = 36, 74 REARING = 37, 75 VIBRATING = 38, 76 IDLING = 39, 77 EVOKER_SPELL = 40, 78 CHARGE_ATTACK = 41, 79 LINGER = 45, 80 } 81 public enum uint HEALTH = 1; 82 public enum uint VARIANT = 2; 83 public enum uint COLOR = 3; 84 public enum uint NAMETAG = 4; 85 public enum uint OWNER = 5; 86 public enum uint TARGET = 6; 87 public enum uint AIR = 7; 88 public enum uint POTION_COLOR = 8; 89 public enum uint POTION_AMBIENT = 9; 90 public enum uint HURT_TIME = 11; 91 public enum uint HURT_DIRECTION = 12; 92 public enum uint PADDLE_TIME_LEFT = 13; 93 public enum uint PADDLE_TIME_RIGHT = 14; 94 public enum uint EXPERIENCE_COUNT = 15; 95 public enum uint MINECART_BLOCK = 16; 96 public enum uint MINECART_OFFSET = 17; 97 public enum uint MINECART_HAS_BLOCK = 18; 98 public enum uint ENDERMAN_ITEM_ID = 23; 99 public enum uint ENDERMAN_ITEM_DAMAGE = 24; 100 public enum uint AGE = 25; 101 public enum PLAYER_FLAGS : size_t { 102 ASLEEP = 1, 103 } 104 public enum uint PLAYER_INDEX = 28; 105 public enum uint BED_POSITION = 29; 106 public enum uint FIREBALL_POWER_X = 30; 107 public enum uint FIREBALL_POWER_Y = 31; 108 public enum uint FIREBALL_POWER_Z = 32; 109 public enum uint POTION_AUX_VALUE = 37; 110 public enum uint LEAD_HOLDER = 38; 111 public enum uint SCALE = 39; 112 public enum uint INTERACTIVE_TAG = 40; 113 public enum uint NPC_ID = 41; 114 public enum uint INTERACTIVE_TAG_URL = 42; 115 public enum uint MAX_AIR = 43; 116 public enum uint MARK_VARIANT = 44; 117 public enum uint BLOCK_TARGET = 48; 118 public enum uint INVULNERABLE_TIME = 49; 119 public enum uint CENTER_HEAD_TARGET = 50; 120 public enum uint LEFT_HEAD_TARGET = 51; 121 public enum uint RIGHT_HEAD_TARGET = 52; 122 public enum uint BOUNDING_BOX_WIDTH = 54; 123 public enum uint BOUNDING_BOX_HEIGHT = 55; 124 public enum uint FUSE_LENGTH = 56; 125 public enum uint RIDER_SEAT_POSITION = 57; 126 public enum uint RIDER_ROTATION_LOCKED = 58; 127 public enum uint RIDER_MAX_ROTATION = 59; 128 public enum uint RIDER_MIN_ROTATION = 60; 129 public enum uint AREA_EFFECT_CLOUD_RADIUS = 61; 130 public enum uint AREA_EFFECT_CLOUD_WAITING = 62; 131 public enum uint AREA_EFFECT_CLOUD_PARTICLE = 63; 132 public enum uint SHULKER_PEAK_HEIGHT = 64; 133 public enum uint SHULKER_DIRECTION = 65; 134 public enum uint SHULKER_ATTACHMENT = 67; 135 public enum uint TRADING_PLAYER = 68; 136 public enum uint COMMAND_BLOCK_COMMAND = 71; 137 public enum uint COMMAND_BLOCK_LAST_OUTPUT = 72; 138 public enum uint COMMAND_BLOCK_TRACK_OUTPUT = 73; 139 public enum uint CONTROLLING_RIDER_SEAT_NUMBER = 74; 140 public enum uint STRENGTH = 75; 141 public enum uint MAX_STRENGTH = 76; 142 143 public DecodedMetadata[] decoded; 144 145 private bool _cached = false; 146 private ubyte[] _cache; 147 148 private void delegate(Buffer) pure nothrow @safe[] _changed; 149 150 private MetadataFlags!(long) _entityFlags = cast(MetadataFlags!(long))0; 151 private Changed!(int) _health; 152 private Changed!(int) _variant; 153 private Changed!(byte) _color; 154 private Changed!(string) _nametag; 155 private Changed!(long) _owner = tuple(cast(long)-1, false); 156 private Changed!(long) _target; 157 private short _air = cast(short)0; 158 private Changed!(int) _potionColor; 159 private Changed!(byte) _potionAmbient; 160 private Changed!(int) _hurtTime; 161 private Changed!(int) _hurtDirection; 162 private Changed!(float) _paddleTimeLeft; 163 private Changed!(float) _paddleTimeRight; 164 private Changed!(int) _experienceCount; 165 private Changed!(int) _minecartBlock; 166 private Changed!(int) _minecartOffset; 167 private Changed!(byte) _minecartHasBlock; 168 private Changed!(short) _endermanItemId; 169 private Changed!(short) _endermanItemDamage; 170 private Changed!(short) _age; 171 private Changed!(MetadataFlags!(byte)) _playerFlags; 172 private Changed!(int) _playerIndex; 173 private Changed!(Tuple!(int, "x", int, "y", int, "z")) _bedPosition; 174 private Changed!(float) _fireballPowerX; 175 private Changed!(float) _fireballPowerY; 176 private Changed!(float) _fireballPowerZ; 177 private Changed!(short) _potionAuxValue; 178 private long _leadHolder = cast(long)-1; 179 private Changed!(float) _scale = tuple(cast(float)1, false); 180 private Changed!(string) _interactiveTag; 181 private Changed!(string) _npcId; 182 private Changed!(string) _interactiveTagUrl; 183 private Changed!(short) _maxAir; 184 private Changed!(int) _markVariant; 185 private Changed!(Tuple!(int, "x", int, "y", int, "z")) _blockTarget; 186 private Changed!(int) _invulnerableTime; 187 private Changed!(long) _centerHeadTarget; 188 private Changed!(long) _leftHeadTarget; 189 private Changed!(long) _rightHeadTarget; 190 private Changed!(float) _boundingBoxWidth; 191 private Changed!(float) _boundingBoxHeight; 192 private Changed!(int) _fuseLength; 193 private Changed!(Tuple!(float, "x", float, "y", float, "z")) _riderSeatPosition; 194 private Changed!(byte) _riderRotationLocked; 195 private Changed!(float) _riderMaxRotation; 196 private Changed!(float) _riderMinRotation; 197 private Changed!(float) _areaEffectCloudRadius = tuple(cast(float)0.5, false); 198 private Changed!(int) _areaEffectCloudWaiting; 199 private Changed!(int) _areaEffectCloudParticle; 200 private Changed!(int) _shulkerPeakHeight; 201 private Changed!(byte) _shulkerDirection; 202 private Changed!(Tuple!(int, "x", int, "y", int, "z")) _shulkerAttachment; 203 private Changed!(long) _tradingPlayer; 204 private Changed!(string) _commandBlockCommand; 205 private Changed!(string) _commandBlockLastOutput; 206 private Changed!(string) _commandBlockTrackOutput; 207 private Changed!(byte) _controllingRiderSeatNumber; 208 private Changed!(int) _strength; 209 private Changed!(int) _maxStrength; 210 211 public pure nothrow @safe this() { 212 this.reset(); 213 } 214 215 public pure nothrow @safe void reset() { 216 this._changed = [ 217 &this.encodeEntityFlags, 218 &this.encodeAir, 219 &this.encodeLeadHolder, 220 ]; 221 } 222 223 public pure nothrow @property @safe @nogc long entityFlags() { 224 return _entityFlags; 225 } 226 227 public pure nothrow @property @safe long entityFlags(long value) { 228 this._cached = false; 229 this._entityFlags = value; 230 return value; 231 } 232 233 public pure nothrow @safe encodeEntityFlags(Buffer buffer) { 234 with(buffer) { 235 writeBytes(varuint.encode(0)); 236 writeBytes(varuint.encode(7)); 237 writeBytes(varlong.encode(this._entityFlags)); 238 } 239 } 240 241 public pure nothrow @property @safe bool onFire() { 242 return _entityFlags._0; 243 } 244 245 public pure nothrow @property @safe bool onFire(bool value) { 246 _entityFlags._0 = value; 247 return value; 248 } 249 250 public pure nothrow @property @safe bool sneaking() { 251 return _entityFlags._1; 252 } 253 254 public pure nothrow @property @safe bool sneaking(bool value) { 255 _entityFlags._1 = value; 256 return value; 257 } 258 259 public pure nothrow @property @safe bool riding() { 260 return _entityFlags._2; 261 } 262 263 public pure nothrow @property @safe bool riding(bool value) { 264 _entityFlags._2 = value; 265 return value; 266 } 267 268 public pure nothrow @property @safe bool sprinting() { 269 return _entityFlags._3; 270 } 271 272 public pure nothrow @property @safe bool sprinting(bool value) { 273 _entityFlags._3 = value; 274 return value; 275 } 276 277 public pure nothrow @property @safe bool usingItem() { 278 return _entityFlags._4; 279 } 280 281 public pure nothrow @property @safe bool usingItem(bool value) { 282 _entityFlags._4 = value; 283 return value; 284 } 285 286 public pure nothrow @property @safe bool invisible() { 287 return _entityFlags._5; 288 } 289 290 public pure nothrow @property @safe bool invisible(bool value) { 291 _entityFlags._5 = value; 292 return value; 293 } 294 295 public pure nothrow @property @safe bool tempted() { 296 return _entityFlags._6; 297 } 298 299 public pure nothrow @property @safe bool tempted(bool value) { 300 _entityFlags._6 = value; 301 return value; 302 } 303 304 public pure nothrow @property @safe bool inLove() { 305 return _entityFlags._7; 306 } 307 308 public pure nothrow @property @safe bool inLove(bool value) { 309 _entityFlags._7 = value; 310 return value; 311 } 312 313 public pure nothrow @property @safe bool saddled() { 314 return _entityFlags._8; 315 } 316 317 public pure nothrow @property @safe bool saddled(bool value) { 318 _entityFlags._8 = value; 319 return value; 320 } 321 322 public pure nothrow @property @safe bool powered() { 323 return _entityFlags._9; 324 } 325 326 public pure nothrow @property @safe bool powered(bool value) { 327 _entityFlags._9 = value; 328 return value; 329 } 330 331 public pure nothrow @property @safe bool ignited() { 332 return _entityFlags._10; 333 } 334 335 public pure nothrow @property @safe bool ignited(bool value) { 336 _entityFlags._10 = value; 337 return value; 338 } 339 340 public pure nothrow @property @safe bool baby() { 341 return _entityFlags._11; 342 } 343 344 public pure nothrow @property @safe bool baby(bool value) { 345 _entityFlags._11 = value; 346 return value; 347 } 348 349 public pure nothrow @property @safe bool converting() { 350 return _entityFlags._12; 351 } 352 353 public pure nothrow @property @safe bool converting(bool value) { 354 _entityFlags._12 = value; 355 return value; 356 } 357 358 public pure nothrow @property @safe bool critical() { 359 return _entityFlags._13; 360 } 361 362 public pure nothrow @property @safe bool critical(bool value) { 363 _entityFlags._13 = value; 364 return value; 365 } 366 367 public pure nothrow @property @safe bool showNametag() { 368 return _entityFlags._14; 369 } 370 371 public pure nothrow @property @safe bool showNametag(bool value) { 372 _entityFlags._14 = value; 373 return value; 374 } 375 376 public pure nothrow @property @safe bool alwaysShowNametag() { 377 return _entityFlags._15; 378 } 379 380 public pure nothrow @property @safe bool alwaysShowNametag(bool value) { 381 _entityFlags._15 = value; 382 return value; 383 } 384 385 public pure nothrow @property @safe bool noAi() { 386 return _entityFlags._16; 387 } 388 389 public pure nothrow @property @safe bool noAi(bool value) { 390 _entityFlags._16 = value; 391 return value; 392 } 393 394 public pure nothrow @property @safe bool silent() { 395 return _entityFlags._17; 396 } 397 398 public pure nothrow @property @safe bool silent(bool value) { 399 _entityFlags._17 = value; 400 return value; 401 } 402 403 public pure nothrow @property @safe bool climbing() { 404 return _entityFlags._18; 405 } 406 407 public pure nothrow @property @safe bool climbing(bool value) { 408 _entityFlags._18 = value; 409 return value; 410 } 411 412 public pure nothrow @property @safe bool canClimb() { 413 return _entityFlags._19; 414 } 415 416 public pure nothrow @property @safe bool canClimb(bool value) { 417 _entityFlags._19 = value; 418 return value; 419 } 420 421 public pure nothrow @property @safe bool canSwim() { 422 return _entityFlags._20; 423 } 424 425 public pure nothrow @property @safe bool canSwim(bool value) { 426 _entityFlags._20 = value; 427 return value; 428 } 429 430 public pure nothrow @property @safe bool canFly() { 431 return _entityFlags._21; 432 } 433 434 public pure nothrow @property @safe bool canFly(bool value) { 435 _entityFlags._21 = value; 436 return value; 437 } 438 439 public pure nothrow @property @safe bool resting() { 440 return _entityFlags._22; 441 } 442 443 public pure nothrow @property @safe bool resting(bool value) { 444 _entityFlags._22 = value; 445 return value; 446 } 447 448 public pure nothrow @property @safe bool sitting() { 449 return _entityFlags._23; 450 } 451 452 public pure nothrow @property @safe bool sitting(bool value) { 453 _entityFlags._23 = value; 454 return value; 455 } 456 457 public pure nothrow @property @safe bool angry() { 458 return _entityFlags._24; 459 } 460 461 public pure nothrow @property @safe bool angry(bool value) { 462 _entityFlags._24 = value; 463 return value; 464 } 465 466 public pure nothrow @property @safe bool interested() { 467 return _entityFlags._25; 468 } 469 470 public pure nothrow @property @safe bool interested(bool value) { 471 _entityFlags._25 = value; 472 return value; 473 } 474 475 public pure nothrow @property @safe bool charged() { 476 return _entityFlags._26; 477 } 478 479 public pure nothrow @property @safe bool charged(bool value) { 480 _entityFlags._26 = value; 481 return value; 482 } 483 484 public pure nothrow @property @safe bool tamed() { 485 return _entityFlags._27; 486 } 487 488 public pure nothrow @property @safe bool tamed(bool value) { 489 _entityFlags._27 = value; 490 return value; 491 } 492 493 public pure nothrow @property @safe bool leashed() { 494 return _entityFlags._28; 495 } 496 497 public pure nothrow @property @safe bool leashed(bool value) { 498 _entityFlags._28 = value; 499 return value; 500 } 501 502 public pure nothrow @property @safe bool sheared() { 503 return _entityFlags._29; 504 } 505 506 public pure nothrow @property @safe bool sheared(bool value) { 507 _entityFlags._29 = value; 508 return value; 509 } 510 511 public pure nothrow @property @safe bool gliding() { 512 return _entityFlags._30; 513 } 514 515 public pure nothrow @property @safe bool gliding(bool value) { 516 _entityFlags._30 = value; 517 return value; 518 } 519 520 public pure nothrow @property @safe bool elder() { 521 return _entityFlags._31; 522 } 523 524 public pure nothrow @property @safe bool elder(bool value) { 525 _entityFlags._31 = value; 526 return value; 527 } 528 529 public pure nothrow @property @safe bool moving() { 530 return _entityFlags._32; 531 } 532 533 public pure nothrow @property @safe bool moving(bool value) { 534 _entityFlags._32 = value; 535 return value; 536 } 537 538 public pure nothrow @property @safe bool breathing() { 539 return _entityFlags._33; 540 } 541 542 public pure nothrow @property @safe bool breathing(bool value) { 543 _entityFlags._33 = value; 544 return value; 545 } 546 547 public pure nothrow @property @safe bool chested() { 548 return _entityFlags._34; 549 } 550 551 public pure nothrow @property @safe bool chested(bool value) { 552 _entityFlags._34 = value; 553 return value; 554 } 555 556 public pure nothrow @property @safe bool stackable() { 557 return _entityFlags._35; 558 } 559 560 public pure nothrow @property @safe bool stackable(bool value) { 561 _entityFlags._35 = value; 562 return value; 563 } 564 565 public pure nothrow @property @safe bool showbase() { 566 return _entityFlags._36; 567 } 568 569 public pure nothrow @property @safe bool showbase(bool value) { 570 _entityFlags._36 = value; 571 return value; 572 } 573 574 public pure nothrow @property @safe bool rearing() { 575 return _entityFlags._37; 576 } 577 578 public pure nothrow @property @safe bool rearing(bool value) { 579 _entityFlags._37 = value; 580 return value; 581 } 582 583 public pure nothrow @property @safe bool vibrating() { 584 return _entityFlags._38; 585 } 586 587 public pure nothrow @property @safe bool vibrating(bool value) { 588 _entityFlags._38 = value; 589 return value; 590 } 591 592 public pure nothrow @property @safe bool idling() { 593 return _entityFlags._39; 594 } 595 596 public pure nothrow @property @safe bool idling(bool value) { 597 _entityFlags._39 = value; 598 return value; 599 } 600 601 public pure nothrow @property @safe bool evokerSpell() { 602 return _entityFlags._40; 603 } 604 605 public pure nothrow @property @safe bool evokerSpell(bool value) { 606 _entityFlags._40 = value; 607 return value; 608 } 609 610 public pure nothrow @property @safe bool chargeAttack() { 611 return _entityFlags._41; 612 } 613 614 public pure nothrow @property @safe bool chargeAttack(bool value) { 615 _entityFlags._41 = value; 616 return value; 617 } 618 619 public pure nothrow @property @safe bool linger() { 620 return _entityFlags._45; 621 } 622 623 public pure nothrow @property @safe bool linger(bool value) { 624 _entityFlags._45 = value; 625 return value; 626 } 627 628 public pure nothrow @property @safe @nogc int health() { 629 return _health.value; 630 } 631 632 public pure nothrow @property @safe int health(int value) { 633 this._cached = false; 634 this._health.value = value; 635 if(!this._health.changed) { 636 this._health.changed = true; 637 this._changed ~= &this.encodeHealth; 638 } 639 return value; 640 } 641 642 public pure nothrow @safe encodeHealth(Buffer buffer) { 643 with(buffer) { 644 writeBytes(varuint.encode(1)); 645 writeBytes(varuint.encode(2)); 646 writeBytes(varint.encode(this._health.value)); 647 } 648 } 649 650 public pure nothrow @property @safe @nogc int variant() { 651 return _variant.value; 652 } 653 654 public pure nothrow @property @safe int variant(int value) { 655 this._cached = false; 656 this._variant.value = value; 657 if(!this._variant.changed) { 658 this._variant.changed = true; 659 this._changed ~= &this.encodeVariant; 660 } 661 return value; 662 } 663 664 public pure nothrow @safe encodeVariant(Buffer buffer) { 665 with(buffer) { 666 writeBytes(varuint.encode(2)); 667 writeBytes(varuint.encode(2)); 668 writeBytes(varint.encode(this._variant.value)); 669 } 670 } 671 672 public pure nothrow @property @safe @nogc byte color() { 673 return _color.value; 674 } 675 676 public pure nothrow @property @safe byte color(byte value) { 677 this._cached = false; 678 this._color.value = value; 679 if(!this._color.changed) { 680 this._color.changed = true; 681 this._changed ~= &this.encodeColor; 682 } 683 return value; 684 } 685 686 public pure nothrow @safe encodeColor(Buffer buffer) { 687 with(buffer) { 688 writeBytes(varuint.encode(3)); 689 writeBytes(varuint.encode(0)); 690 writeBigEndianByte(this._color.value); 691 } 692 } 693 694 public pure nothrow @property @safe @nogc string nametag() { 695 return _nametag.value; 696 } 697 698 public pure nothrow @property @safe string nametag(string value) { 699 this._cached = false; 700 this._nametag.value = value; 701 if(!this._nametag.changed) { 702 this._nametag.changed = true; 703 this._changed ~= &this.encodeNametag; 704 } 705 return value; 706 } 707 708 public pure nothrow @safe encodeNametag(Buffer buffer) { 709 with(buffer) { 710 writeBytes(varuint.encode(4)); 711 writeBytes(varuint.encode(4)); 712 writeBytes(varuint.encode(cast(uint)this._nametag.value.length)); writeString(this._nametag.value); 713 } 714 } 715 716 public pure nothrow @property @safe @nogc long owner() { 717 return _owner.value; 718 } 719 720 public pure nothrow @property @safe long owner(long value) { 721 this._cached = false; 722 this._owner.value = value; 723 if(!this._owner.changed) { 724 this._owner.changed = true; 725 this._changed ~= &this.encodeOwner; 726 } 727 return value; 728 } 729 730 public pure nothrow @safe encodeOwner(Buffer buffer) { 731 with(buffer) { 732 writeBytes(varuint.encode(5)); 733 writeBytes(varuint.encode(7)); 734 writeBytes(varlong.encode(this._owner.value)); 735 } 736 } 737 738 public pure nothrow @property @safe @nogc long target() { 739 return _target.value; 740 } 741 742 public pure nothrow @property @safe long target(long value) { 743 this._cached = false; 744 this._target.value = value; 745 if(!this._target.changed) { 746 this._target.changed = true; 747 this._changed ~= &this.encodeTarget; 748 } 749 return value; 750 } 751 752 public pure nothrow @safe encodeTarget(Buffer buffer) { 753 with(buffer) { 754 writeBytes(varuint.encode(6)); 755 writeBytes(varuint.encode(7)); 756 writeBytes(varlong.encode(this._target.value)); 757 } 758 } 759 760 public pure nothrow @property @safe @nogc short air() { 761 return _air; 762 } 763 764 public pure nothrow @property @safe short air(short value) { 765 this._cached = false; 766 this._air = value; 767 return value; 768 } 769 770 public pure nothrow @safe encodeAir(Buffer buffer) { 771 with(buffer) { 772 writeBytes(varuint.encode(7)); 773 writeBytes(varuint.encode(1)); 774 writeLittleEndianShort(this._air); 775 } 776 } 777 778 public pure nothrow @property @safe @nogc int potionColor() { 779 return _potionColor.value; 780 } 781 782 public pure nothrow @property @safe int potionColor(int value) { 783 this._cached = false; 784 this._potionColor.value = value; 785 if(!this._potionColor.changed) { 786 this._potionColor.changed = true; 787 this._changed ~= &this.encodePotionColor; 788 } 789 return value; 790 } 791 792 public pure nothrow @safe encodePotionColor(Buffer buffer) { 793 with(buffer) { 794 writeBytes(varuint.encode(8)); 795 writeBytes(varuint.encode(2)); 796 writeBytes(varint.encode(this._potionColor.value)); 797 } 798 } 799 800 public pure nothrow @property @safe @nogc byte potionAmbient() { 801 return _potionAmbient.value; 802 } 803 804 public pure nothrow @property @safe byte potionAmbient(byte value) { 805 this._cached = false; 806 this._potionAmbient.value = value; 807 if(!this._potionAmbient.changed) { 808 this._potionAmbient.changed = true; 809 this._changed ~= &this.encodePotionAmbient; 810 } 811 return value; 812 } 813 814 public pure nothrow @safe encodePotionAmbient(Buffer buffer) { 815 with(buffer) { 816 writeBytes(varuint.encode(9)); 817 writeBytes(varuint.encode(0)); 818 writeBigEndianByte(this._potionAmbient.value); 819 } 820 } 821 822 public pure nothrow @property @safe @nogc int hurtTime() { 823 return _hurtTime.value; 824 } 825 826 public pure nothrow @property @safe int hurtTime(int value) { 827 this._cached = false; 828 this._hurtTime.value = value; 829 if(!this._hurtTime.changed) { 830 this._hurtTime.changed = true; 831 this._changed ~= &this.encodeHurtTime; 832 } 833 return value; 834 } 835 836 public pure nothrow @safe encodeHurtTime(Buffer buffer) { 837 with(buffer) { 838 writeBytes(varuint.encode(11)); 839 writeBytes(varuint.encode(2)); 840 writeBytes(varint.encode(this._hurtTime.value)); 841 } 842 } 843 844 public pure nothrow @property @safe @nogc int hurtDirection() { 845 return _hurtDirection.value; 846 } 847 848 public pure nothrow @property @safe int hurtDirection(int value) { 849 this._cached = false; 850 this._hurtDirection.value = value; 851 if(!this._hurtDirection.changed) { 852 this._hurtDirection.changed = true; 853 this._changed ~= &this.encodeHurtDirection; 854 } 855 return value; 856 } 857 858 public pure nothrow @safe encodeHurtDirection(Buffer buffer) { 859 with(buffer) { 860 writeBytes(varuint.encode(12)); 861 writeBytes(varuint.encode(2)); 862 writeBytes(varint.encode(this._hurtDirection.value)); 863 } 864 } 865 866 public pure nothrow @property @safe @nogc float paddleTimeLeft() { 867 return _paddleTimeLeft.value; 868 } 869 870 public pure nothrow @property @safe float paddleTimeLeft(float value) { 871 this._cached = false; 872 this._paddleTimeLeft.value = value; 873 if(!this._paddleTimeLeft.changed) { 874 this._paddleTimeLeft.changed = true; 875 this._changed ~= &this.encodePaddleTimeLeft; 876 } 877 return value; 878 } 879 880 public pure nothrow @safe encodePaddleTimeLeft(Buffer buffer) { 881 with(buffer) { 882 writeBytes(varuint.encode(13)); 883 writeBytes(varuint.encode(3)); 884 writeLittleEndianFloat(this._paddleTimeLeft.value); 885 } 886 } 887 888 public pure nothrow @property @safe @nogc float paddleTimeRight() { 889 return _paddleTimeRight.value; 890 } 891 892 public pure nothrow @property @safe float paddleTimeRight(float value) { 893 this._cached = false; 894 this._paddleTimeRight.value = value; 895 if(!this._paddleTimeRight.changed) { 896 this._paddleTimeRight.changed = true; 897 this._changed ~= &this.encodePaddleTimeRight; 898 } 899 return value; 900 } 901 902 public pure nothrow @safe encodePaddleTimeRight(Buffer buffer) { 903 with(buffer) { 904 writeBytes(varuint.encode(14)); 905 writeBytes(varuint.encode(3)); 906 writeLittleEndianFloat(this._paddleTimeRight.value); 907 } 908 } 909 910 public pure nothrow @property @safe @nogc int experienceCount() { 911 return _experienceCount.value; 912 } 913 914 public pure nothrow @property @safe int experienceCount(int value) { 915 this._cached = false; 916 this._experienceCount.value = value; 917 if(!this._experienceCount.changed) { 918 this._experienceCount.changed = true; 919 this._changed ~= &this.encodeExperienceCount; 920 } 921 return value; 922 } 923 924 public pure nothrow @safe encodeExperienceCount(Buffer buffer) { 925 with(buffer) { 926 writeBytes(varuint.encode(15)); 927 writeBytes(varuint.encode(2)); 928 writeBytes(varint.encode(this._experienceCount.value)); 929 } 930 } 931 932 public pure nothrow @property @safe @nogc int minecartBlock() { 933 return _minecartBlock.value; 934 } 935 936 public pure nothrow @property @safe int minecartBlock(int value) { 937 this._cached = false; 938 this._minecartBlock.value = value; 939 if(!this._minecartBlock.changed) { 940 this._minecartBlock.changed = true; 941 this._changed ~= &this.encodeMinecartBlock; 942 } 943 return value; 944 } 945 946 public pure nothrow @safe encodeMinecartBlock(Buffer buffer) { 947 with(buffer) { 948 writeBytes(varuint.encode(16)); 949 writeBytes(varuint.encode(2)); 950 writeBytes(varint.encode(this._minecartBlock.value)); 951 } 952 } 953 954 public pure nothrow @property @safe @nogc int minecartOffset() { 955 return _minecartOffset.value; 956 } 957 958 public pure nothrow @property @safe int minecartOffset(int value) { 959 this._cached = false; 960 this._minecartOffset.value = value; 961 if(!this._minecartOffset.changed) { 962 this._minecartOffset.changed = true; 963 this._changed ~= &this.encodeMinecartOffset; 964 } 965 return value; 966 } 967 968 public pure nothrow @safe encodeMinecartOffset(Buffer buffer) { 969 with(buffer) { 970 writeBytes(varuint.encode(17)); 971 writeBytes(varuint.encode(2)); 972 writeBytes(varint.encode(this._minecartOffset.value)); 973 } 974 } 975 976 public pure nothrow @property @safe @nogc byte minecartHasBlock() { 977 return _minecartHasBlock.value; 978 } 979 980 public pure nothrow @property @safe byte minecartHasBlock(byte value) { 981 this._cached = false; 982 this._minecartHasBlock.value = value; 983 if(!this._minecartHasBlock.changed) { 984 this._minecartHasBlock.changed = true; 985 this._changed ~= &this.encodeMinecartHasBlock; 986 } 987 return value; 988 } 989 990 public pure nothrow @safe encodeMinecartHasBlock(Buffer buffer) { 991 with(buffer) { 992 writeBytes(varuint.encode(18)); 993 writeBytes(varuint.encode(0)); 994 writeBigEndianByte(this._minecartHasBlock.value); 995 } 996 } 997 998 public pure nothrow @property @safe @nogc short endermanItemId() { 999 return _endermanItemId.value; 1000 } 1001 1002 public pure nothrow @property @safe short endermanItemId(short value) { 1003 this._cached = false; 1004 this._endermanItemId.value = value; 1005 if(!this._endermanItemId.changed) { 1006 this._endermanItemId.changed = true; 1007 this._changed ~= &this.encodeEndermanItemId; 1008 } 1009 return value; 1010 } 1011 1012 public pure nothrow @safe encodeEndermanItemId(Buffer buffer) { 1013 with(buffer) { 1014 writeBytes(varuint.encode(23)); 1015 writeBytes(varuint.encode(1)); 1016 writeLittleEndianShort(this._endermanItemId.value); 1017 } 1018 } 1019 1020 public pure nothrow @property @safe @nogc short endermanItemDamage() { 1021 return _endermanItemDamage.value; 1022 } 1023 1024 public pure nothrow @property @safe short endermanItemDamage(short value) { 1025 this._cached = false; 1026 this._endermanItemDamage.value = value; 1027 if(!this._endermanItemDamage.changed) { 1028 this._endermanItemDamage.changed = true; 1029 this._changed ~= &this.encodeEndermanItemDamage; 1030 } 1031 return value; 1032 } 1033 1034 public pure nothrow @safe encodeEndermanItemDamage(Buffer buffer) { 1035 with(buffer) { 1036 writeBytes(varuint.encode(24)); 1037 writeBytes(varuint.encode(1)); 1038 writeLittleEndianShort(this._endermanItemDamage.value); 1039 } 1040 } 1041 1042 public pure nothrow @property @safe @nogc short age() { 1043 return _age.value; 1044 } 1045 1046 public pure nothrow @property @safe short age(short value) { 1047 this._cached = false; 1048 this._age.value = value; 1049 if(!this._age.changed) { 1050 this._age.changed = true; 1051 this._changed ~= &this.encodeAge; 1052 } 1053 return value; 1054 } 1055 1056 public pure nothrow @safe encodeAge(Buffer buffer) { 1057 with(buffer) { 1058 writeBytes(varuint.encode(25)); 1059 writeBytes(varuint.encode(1)); 1060 writeLittleEndianShort(this._age.value); 1061 } 1062 } 1063 1064 public pure nothrow @property @safe @nogc byte playerFlags() { 1065 return _playerFlags.value; 1066 } 1067 1068 public pure nothrow @property @safe byte playerFlags(byte value) { 1069 this._cached = false; 1070 this._playerFlags.value = value; 1071 if(!this._playerFlags.changed) { 1072 this._playerFlags.changed = true; 1073 this._changed ~= &this.encodePlayerFlags; 1074 } 1075 return value; 1076 } 1077 1078 public pure nothrow @safe encodePlayerFlags(Buffer buffer) { 1079 with(buffer) { 1080 writeBytes(varuint.encode(27)); 1081 writeBytes(varuint.encode(0)); 1082 writeBigEndianByte(this._playerFlags.value); 1083 } 1084 } 1085 1086 public pure nothrow @property @safe bool asleep() { 1087 return _playerFlags.value._1; 1088 } 1089 1090 public pure nothrow @property @safe bool asleep(bool value) { 1091 _playerFlags.value._1 = value; 1092 return value; 1093 } 1094 1095 public pure nothrow @property @safe @nogc int playerIndex() { 1096 return _playerIndex.value; 1097 } 1098 1099 public pure nothrow @property @safe int playerIndex(int value) { 1100 this._cached = false; 1101 this._playerIndex.value = value; 1102 if(!this._playerIndex.changed) { 1103 this._playerIndex.changed = true; 1104 this._changed ~= &this.encodePlayerIndex; 1105 } 1106 return value; 1107 } 1108 1109 public pure nothrow @safe encodePlayerIndex(Buffer buffer) { 1110 with(buffer) { 1111 writeBytes(varuint.encode(28)); 1112 writeBytes(varuint.encode(2)); 1113 writeBytes(varint.encode(this._playerIndex.value)); 1114 } 1115 } 1116 1117 public pure nothrow @property @safe @nogc Tuple!(int, "x", int, "y", int, "z") bedPosition() { 1118 return _bedPosition.value; 1119 } 1120 1121 public pure nothrow @property @safe Tuple!(int, "x", int, "y", int, "z") bedPosition(Tuple!(int, "x", int, "y", int, "z") value) { 1122 this._cached = false; 1123 this._bedPosition.value = value; 1124 if(!this._bedPosition.changed) { 1125 this._bedPosition.changed = true; 1126 this._changed ~= &this.encodeBedPosition; 1127 } 1128 return value; 1129 } 1130 1131 public pure nothrow @safe encodeBedPosition(Buffer buffer) { 1132 with(buffer) { 1133 writeBytes(varuint.encode(29)); 1134 writeBytes(varuint.encode(6)); 1135 writeBytes(varint.encode(this._bedPosition.value.x)); writeBytes(varint.encode(this._bedPosition.value.y)); writeBytes(varint.encode(this._bedPosition.value.z)); 1136 } 1137 } 1138 1139 public pure nothrow @property @safe @nogc float fireballPowerX() { 1140 return _fireballPowerX.value; 1141 } 1142 1143 public pure nothrow @property @safe float fireballPowerX(float value) { 1144 this._cached = false; 1145 this._fireballPowerX.value = value; 1146 if(!this._fireballPowerX.changed) { 1147 this._fireballPowerX.changed = true; 1148 this._changed ~= &this.encodeFireballPowerX; 1149 } 1150 return value; 1151 } 1152 1153 public pure nothrow @safe encodeFireballPowerX(Buffer buffer) { 1154 with(buffer) { 1155 writeBytes(varuint.encode(30)); 1156 writeBytes(varuint.encode(3)); 1157 writeLittleEndianFloat(this._fireballPowerX.value); 1158 } 1159 } 1160 1161 public pure nothrow @property @safe @nogc float fireballPowerY() { 1162 return _fireballPowerY.value; 1163 } 1164 1165 public pure nothrow @property @safe float fireballPowerY(float value) { 1166 this._cached = false; 1167 this._fireballPowerY.value = value; 1168 if(!this._fireballPowerY.changed) { 1169 this._fireballPowerY.changed = true; 1170 this._changed ~= &this.encodeFireballPowerY; 1171 } 1172 return value; 1173 } 1174 1175 public pure nothrow @safe encodeFireballPowerY(Buffer buffer) { 1176 with(buffer) { 1177 writeBytes(varuint.encode(31)); 1178 writeBytes(varuint.encode(3)); 1179 writeLittleEndianFloat(this._fireballPowerY.value); 1180 } 1181 } 1182 1183 public pure nothrow @property @safe @nogc float fireballPowerZ() { 1184 return _fireballPowerZ.value; 1185 } 1186 1187 public pure nothrow @property @safe float fireballPowerZ(float value) { 1188 this._cached = false; 1189 this._fireballPowerZ.value = value; 1190 if(!this._fireballPowerZ.changed) { 1191 this._fireballPowerZ.changed = true; 1192 this._changed ~= &this.encodeFireballPowerZ; 1193 } 1194 return value; 1195 } 1196 1197 public pure nothrow @safe encodeFireballPowerZ(Buffer buffer) { 1198 with(buffer) { 1199 writeBytes(varuint.encode(32)); 1200 writeBytes(varuint.encode(3)); 1201 writeLittleEndianFloat(this._fireballPowerZ.value); 1202 } 1203 } 1204 1205 public pure nothrow @property @safe @nogc short potionAuxValue() { 1206 return _potionAuxValue.value; 1207 } 1208 1209 public pure nothrow @property @safe short potionAuxValue(short value) { 1210 this._cached = false; 1211 this._potionAuxValue.value = value; 1212 if(!this._potionAuxValue.changed) { 1213 this._potionAuxValue.changed = true; 1214 this._changed ~= &this.encodePotionAuxValue; 1215 } 1216 return value; 1217 } 1218 1219 public pure nothrow @safe encodePotionAuxValue(Buffer buffer) { 1220 with(buffer) { 1221 writeBytes(varuint.encode(37)); 1222 writeBytes(varuint.encode(1)); 1223 writeLittleEndianShort(this._potionAuxValue.value); 1224 } 1225 } 1226 1227 public pure nothrow @property @safe @nogc long leadHolder() { 1228 return _leadHolder; 1229 } 1230 1231 public pure nothrow @property @safe long leadHolder(long value) { 1232 this._cached = false; 1233 this._leadHolder = value; 1234 return value; 1235 } 1236 1237 public pure nothrow @safe encodeLeadHolder(Buffer buffer) { 1238 with(buffer) { 1239 writeBytes(varuint.encode(38)); 1240 writeBytes(varuint.encode(7)); 1241 writeBytes(varlong.encode(this._leadHolder)); 1242 } 1243 } 1244 1245 public pure nothrow @property @safe @nogc float scale() { 1246 return _scale.value; 1247 } 1248 1249 public pure nothrow @property @safe float scale(float value) { 1250 this._cached = false; 1251 this._scale.value = value; 1252 if(!this._scale.changed) { 1253 this._scale.changed = true; 1254 this._changed ~= &this.encodeScale; 1255 } 1256 return value; 1257 } 1258 1259 public pure nothrow @safe encodeScale(Buffer buffer) { 1260 with(buffer) { 1261 writeBytes(varuint.encode(39)); 1262 writeBytes(varuint.encode(3)); 1263 writeLittleEndianFloat(this._scale.value); 1264 } 1265 } 1266 1267 public pure nothrow @property @safe @nogc string interactiveTag() { 1268 return _interactiveTag.value; 1269 } 1270 1271 public pure nothrow @property @safe string interactiveTag(string value) { 1272 this._cached = false; 1273 this._interactiveTag.value = value; 1274 if(!this._interactiveTag.changed) { 1275 this._interactiveTag.changed = true; 1276 this._changed ~= &this.encodeInteractiveTag; 1277 } 1278 return value; 1279 } 1280 1281 public pure nothrow @safe encodeInteractiveTag(Buffer buffer) { 1282 with(buffer) { 1283 writeBytes(varuint.encode(40)); 1284 writeBytes(varuint.encode(4)); 1285 writeBytes(varuint.encode(cast(uint)this._interactiveTag.value.length)); writeString(this._interactiveTag.value); 1286 } 1287 } 1288 1289 public pure nothrow @property @safe @nogc string npcId() { 1290 return _npcId.value; 1291 } 1292 1293 public pure nothrow @property @safe string npcId(string value) { 1294 this._cached = false; 1295 this._npcId.value = value; 1296 if(!this._npcId.changed) { 1297 this._npcId.changed = true; 1298 this._changed ~= &this.encodeNpcId; 1299 } 1300 return value; 1301 } 1302 1303 public pure nothrow @safe encodeNpcId(Buffer buffer) { 1304 with(buffer) { 1305 writeBytes(varuint.encode(41)); 1306 writeBytes(varuint.encode(4)); 1307 writeBytes(varuint.encode(cast(uint)this._npcId.value.length)); writeString(this._npcId.value); 1308 } 1309 } 1310 1311 public pure nothrow @property @safe @nogc string interactiveTagUrl() { 1312 return _interactiveTagUrl.value; 1313 } 1314 1315 public pure nothrow @property @safe string interactiveTagUrl(string value) { 1316 this._cached = false; 1317 this._interactiveTagUrl.value = value; 1318 if(!this._interactiveTagUrl.changed) { 1319 this._interactiveTagUrl.changed = true; 1320 this._changed ~= &this.encodeInteractiveTagUrl; 1321 } 1322 return value; 1323 } 1324 1325 public pure nothrow @safe encodeInteractiveTagUrl(Buffer buffer) { 1326 with(buffer) { 1327 writeBytes(varuint.encode(42)); 1328 writeBytes(varuint.encode(4)); 1329 writeBytes(varuint.encode(cast(uint)this._interactiveTagUrl.value.length)); writeString(this._interactiveTagUrl.value); 1330 } 1331 } 1332 1333 public pure nothrow @property @safe @nogc short maxAir() { 1334 return _maxAir.value; 1335 } 1336 1337 public pure nothrow @property @safe short maxAir(short value) { 1338 this._cached = false; 1339 this._maxAir.value = value; 1340 if(!this._maxAir.changed) { 1341 this._maxAir.changed = true; 1342 this._changed ~= &this.encodeMaxAir; 1343 } 1344 return value; 1345 } 1346 1347 public pure nothrow @safe encodeMaxAir(Buffer buffer) { 1348 with(buffer) { 1349 writeBytes(varuint.encode(43)); 1350 writeBytes(varuint.encode(1)); 1351 writeLittleEndianShort(this._maxAir.value); 1352 } 1353 } 1354 1355 public pure nothrow @property @safe @nogc int markVariant() { 1356 return _markVariant.value; 1357 } 1358 1359 public pure nothrow @property @safe int markVariant(int value) { 1360 this._cached = false; 1361 this._markVariant.value = value; 1362 if(!this._markVariant.changed) { 1363 this._markVariant.changed = true; 1364 this._changed ~= &this.encodeMarkVariant; 1365 } 1366 return value; 1367 } 1368 1369 public pure nothrow @safe encodeMarkVariant(Buffer buffer) { 1370 with(buffer) { 1371 writeBytes(varuint.encode(44)); 1372 writeBytes(varuint.encode(2)); 1373 writeBytes(varint.encode(this._markVariant.value)); 1374 } 1375 } 1376 1377 public pure nothrow @property @safe @nogc Tuple!(int, "x", int, "y", int, "z") blockTarget() { 1378 return _blockTarget.value; 1379 } 1380 1381 public pure nothrow @property @safe Tuple!(int, "x", int, "y", int, "z") blockTarget(Tuple!(int, "x", int, "y", int, "z") value) { 1382 this._cached = false; 1383 this._blockTarget.value = value; 1384 if(!this._blockTarget.changed) { 1385 this._blockTarget.changed = true; 1386 this._changed ~= &this.encodeBlockTarget; 1387 } 1388 return value; 1389 } 1390 1391 public pure nothrow @safe encodeBlockTarget(Buffer buffer) { 1392 with(buffer) { 1393 writeBytes(varuint.encode(48)); 1394 writeBytes(varuint.encode(6)); 1395 writeBytes(varint.encode(this._blockTarget.value.x)); writeBytes(varint.encode(this._blockTarget.value.y)); writeBytes(varint.encode(this._blockTarget.value.z)); 1396 } 1397 } 1398 1399 public pure nothrow @property @safe @nogc int invulnerableTime() { 1400 return _invulnerableTime.value; 1401 } 1402 1403 public pure nothrow @property @safe int invulnerableTime(int value) { 1404 this._cached = false; 1405 this._invulnerableTime.value = value; 1406 if(!this._invulnerableTime.changed) { 1407 this._invulnerableTime.changed = true; 1408 this._changed ~= &this.encodeInvulnerableTime; 1409 } 1410 return value; 1411 } 1412 1413 public pure nothrow @safe encodeInvulnerableTime(Buffer buffer) { 1414 with(buffer) { 1415 writeBytes(varuint.encode(49)); 1416 writeBytes(varuint.encode(2)); 1417 writeBytes(varint.encode(this._invulnerableTime.value)); 1418 } 1419 } 1420 1421 public pure nothrow @property @safe @nogc long centerHeadTarget() { 1422 return _centerHeadTarget.value; 1423 } 1424 1425 public pure nothrow @property @safe long centerHeadTarget(long value) { 1426 this._cached = false; 1427 this._centerHeadTarget.value = value; 1428 if(!this._centerHeadTarget.changed) { 1429 this._centerHeadTarget.changed = true; 1430 this._changed ~= &this.encodeCenterHeadTarget; 1431 } 1432 return value; 1433 } 1434 1435 public pure nothrow @safe encodeCenterHeadTarget(Buffer buffer) { 1436 with(buffer) { 1437 writeBytes(varuint.encode(50)); 1438 writeBytes(varuint.encode(7)); 1439 writeBytes(varlong.encode(this._centerHeadTarget.value)); 1440 } 1441 } 1442 1443 public pure nothrow @property @safe @nogc long leftHeadTarget() { 1444 return _leftHeadTarget.value; 1445 } 1446 1447 public pure nothrow @property @safe long leftHeadTarget(long value) { 1448 this._cached = false; 1449 this._leftHeadTarget.value = value; 1450 if(!this._leftHeadTarget.changed) { 1451 this._leftHeadTarget.changed = true; 1452 this._changed ~= &this.encodeLeftHeadTarget; 1453 } 1454 return value; 1455 } 1456 1457 public pure nothrow @safe encodeLeftHeadTarget(Buffer buffer) { 1458 with(buffer) { 1459 writeBytes(varuint.encode(51)); 1460 writeBytes(varuint.encode(7)); 1461 writeBytes(varlong.encode(this._leftHeadTarget.value)); 1462 } 1463 } 1464 1465 public pure nothrow @property @safe @nogc long rightHeadTarget() { 1466 return _rightHeadTarget.value; 1467 } 1468 1469 public pure nothrow @property @safe long rightHeadTarget(long value) { 1470 this._cached = false; 1471 this._rightHeadTarget.value = value; 1472 if(!this._rightHeadTarget.changed) { 1473 this._rightHeadTarget.changed = true; 1474 this._changed ~= &this.encodeRightHeadTarget; 1475 } 1476 return value; 1477 } 1478 1479 public pure nothrow @safe encodeRightHeadTarget(Buffer buffer) { 1480 with(buffer) { 1481 writeBytes(varuint.encode(52)); 1482 writeBytes(varuint.encode(7)); 1483 writeBytes(varlong.encode(this._rightHeadTarget.value)); 1484 } 1485 } 1486 1487 public pure nothrow @property @safe @nogc float boundingBoxWidth() { 1488 return _boundingBoxWidth.value; 1489 } 1490 1491 public pure nothrow @property @safe float boundingBoxWidth(float value) { 1492 this._cached = false; 1493 this._boundingBoxWidth.value = value; 1494 if(!this._boundingBoxWidth.changed) { 1495 this._boundingBoxWidth.changed = true; 1496 this._changed ~= &this.encodeBoundingBoxWidth; 1497 } 1498 return value; 1499 } 1500 1501 public pure nothrow @safe encodeBoundingBoxWidth(Buffer buffer) { 1502 with(buffer) { 1503 writeBytes(varuint.encode(54)); 1504 writeBytes(varuint.encode(3)); 1505 writeLittleEndianFloat(this._boundingBoxWidth.value); 1506 } 1507 } 1508 1509 public pure nothrow @property @safe @nogc float boundingBoxHeight() { 1510 return _boundingBoxHeight.value; 1511 } 1512 1513 public pure nothrow @property @safe float boundingBoxHeight(float value) { 1514 this._cached = false; 1515 this._boundingBoxHeight.value = value; 1516 if(!this._boundingBoxHeight.changed) { 1517 this._boundingBoxHeight.changed = true; 1518 this._changed ~= &this.encodeBoundingBoxHeight; 1519 } 1520 return value; 1521 } 1522 1523 public pure nothrow @safe encodeBoundingBoxHeight(Buffer buffer) { 1524 with(buffer) { 1525 writeBytes(varuint.encode(55)); 1526 writeBytes(varuint.encode(3)); 1527 writeLittleEndianFloat(this._boundingBoxHeight.value); 1528 } 1529 } 1530 1531 public pure nothrow @property @safe @nogc int fuseLength() { 1532 return _fuseLength.value; 1533 } 1534 1535 public pure nothrow @property @safe int fuseLength(int value) { 1536 this._cached = false; 1537 this._fuseLength.value = value; 1538 if(!this._fuseLength.changed) { 1539 this._fuseLength.changed = true; 1540 this._changed ~= &this.encodeFuseLength; 1541 } 1542 return value; 1543 } 1544 1545 public pure nothrow @safe encodeFuseLength(Buffer buffer) { 1546 with(buffer) { 1547 writeBytes(varuint.encode(56)); 1548 writeBytes(varuint.encode(2)); 1549 writeBytes(varint.encode(this._fuseLength.value)); 1550 } 1551 } 1552 1553 public pure nothrow @property @safe @nogc Tuple!(float, "x", float, "y", float, "z") riderSeatPosition() { 1554 return _riderSeatPosition.value; 1555 } 1556 1557 public pure nothrow @property @safe Tuple!(float, "x", float, "y", float, "z") riderSeatPosition(Tuple!(float, "x", float, "y", float, "z") value) { 1558 this._cached = false; 1559 this._riderSeatPosition.value = value; 1560 if(!this._riderSeatPosition.changed) { 1561 this._riderSeatPosition.changed = true; 1562 this._changed ~= &this.encodeRiderSeatPosition; 1563 } 1564 return value; 1565 } 1566 1567 public pure nothrow @safe encodeRiderSeatPosition(Buffer buffer) { 1568 with(buffer) { 1569 writeBytes(varuint.encode(57)); 1570 writeBytes(varuint.encode(8)); 1571 writeLittleEndianFloat(this._riderSeatPosition.value.x); writeLittleEndianFloat(this._riderSeatPosition.value.y); writeLittleEndianFloat(this._riderSeatPosition.value.z); 1572 } 1573 } 1574 1575 public pure nothrow @property @safe @nogc byte riderRotationLocked() { 1576 return _riderRotationLocked.value; 1577 } 1578 1579 public pure nothrow @property @safe byte riderRotationLocked(byte value) { 1580 this._cached = false; 1581 this._riderRotationLocked.value = value; 1582 if(!this._riderRotationLocked.changed) { 1583 this._riderRotationLocked.changed = true; 1584 this._changed ~= &this.encodeRiderRotationLocked; 1585 } 1586 return value; 1587 } 1588 1589 public pure nothrow @safe encodeRiderRotationLocked(Buffer buffer) { 1590 with(buffer) { 1591 writeBytes(varuint.encode(58)); 1592 writeBytes(varuint.encode(0)); 1593 writeBigEndianByte(this._riderRotationLocked.value); 1594 } 1595 } 1596 1597 public pure nothrow @property @safe @nogc float riderMaxRotation() { 1598 return _riderMaxRotation.value; 1599 } 1600 1601 public pure nothrow @property @safe float riderMaxRotation(float value) { 1602 this._cached = false; 1603 this._riderMaxRotation.value = value; 1604 if(!this._riderMaxRotation.changed) { 1605 this._riderMaxRotation.changed = true; 1606 this._changed ~= &this.encodeRiderMaxRotation; 1607 } 1608 return value; 1609 } 1610 1611 public pure nothrow @safe encodeRiderMaxRotation(Buffer buffer) { 1612 with(buffer) { 1613 writeBytes(varuint.encode(59)); 1614 writeBytes(varuint.encode(3)); 1615 writeLittleEndianFloat(this._riderMaxRotation.value); 1616 } 1617 } 1618 1619 public pure nothrow @property @safe @nogc float riderMinRotation() { 1620 return _riderMinRotation.value; 1621 } 1622 1623 public pure nothrow @property @safe float riderMinRotation(float value) { 1624 this._cached = false; 1625 this._riderMinRotation.value = value; 1626 if(!this._riderMinRotation.changed) { 1627 this._riderMinRotation.changed = true; 1628 this._changed ~= &this.encodeRiderMinRotation; 1629 } 1630 return value; 1631 } 1632 1633 public pure nothrow @safe encodeRiderMinRotation(Buffer buffer) { 1634 with(buffer) { 1635 writeBytes(varuint.encode(60)); 1636 writeBytes(varuint.encode(3)); 1637 writeLittleEndianFloat(this._riderMinRotation.value); 1638 } 1639 } 1640 1641 public pure nothrow @property @safe @nogc float areaEffectCloudRadius() { 1642 return _areaEffectCloudRadius.value; 1643 } 1644 1645 public pure nothrow @property @safe float areaEffectCloudRadius(float value) { 1646 this._cached = false; 1647 this._areaEffectCloudRadius.value = value; 1648 if(!this._areaEffectCloudRadius.changed) { 1649 this._areaEffectCloudRadius.changed = true; 1650 this._changed ~= &this.encodeAreaEffectCloudRadius; 1651 } 1652 return value; 1653 } 1654 1655 public pure nothrow @safe encodeAreaEffectCloudRadius(Buffer buffer) { 1656 with(buffer) { 1657 writeBytes(varuint.encode(61)); 1658 writeBytes(varuint.encode(3)); 1659 writeLittleEndianFloat(this._areaEffectCloudRadius.value); 1660 } 1661 } 1662 1663 public pure nothrow @property @safe @nogc int areaEffectCloudWaiting() { 1664 return _areaEffectCloudWaiting.value; 1665 } 1666 1667 public pure nothrow @property @safe int areaEffectCloudWaiting(int value) { 1668 this._cached = false; 1669 this._areaEffectCloudWaiting.value = value; 1670 if(!this._areaEffectCloudWaiting.changed) { 1671 this._areaEffectCloudWaiting.changed = true; 1672 this._changed ~= &this.encodeAreaEffectCloudWaiting; 1673 } 1674 return value; 1675 } 1676 1677 public pure nothrow @safe encodeAreaEffectCloudWaiting(Buffer buffer) { 1678 with(buffer) { 1679 writeBytes(varuint.encode(62)); 1680 writeBytes(varuint.encode(2)); 1681 writeBytes(varint.encode(this._areaEffectCloudWaiting.value)); 1682 } 1683 } 1684 1685 public pure nothrow @property @safe @nogc int areaEffectCloudParticle() { 1686 return _areaEffectCloudParticle.value; 1687 } 1688 1689 public pure nothrow @property @safe int areaEffectCloudParticle(int value) { 1690 this._cached = false; 1691 this._areaEffectCloudParticle.value = value; 1692 if(!this._areaEffectCloudParticle.changed) { 1693 this._areaEffectCloudParticle.changed = true; 1694 this._changed ~= &this.encodeAreaEffectCloudParticle; 1695 } 1696 return value; 1697 } 1698 1699 public pure nothrow @safe encodeAreaEffectCloudParticle(Buffer buffer) { 1700 with(buffer) { 1701 writeBytes(varuint.encode(63)); 1702 writeBytes(varuint.encode(2)); 1703 writeBytes(varint.encode(this._areaEffectCloudParticle.value)); 1704 } 1705 } 1706 1707 public pure nothrow @property @safe @nogc int shulkerPeakHeight() { 1708 return _shulkerPeakHeight.value; 1709 } 1710 1711 public pure nothrow @property @safe int shulkerPeakHeight(int value) { 1712 this._cached = false; 1713 this._shulkerPeakHeight.value = value; 1714 if(!this._shulkerPeakHeight.changed) { 1715 this._shulkerPeakHeight.changed = true; 1716 this._changed ~= &this.encodeShulkerPeakHeight; 1717 } 1718 return value; 1719 } 1720 1721 public pure nothrow @safe encodeShulkerPeakHeight(Buffer buffer) { 1722 with(buffer) { 1723 writeBytes(varuint.encode(64)); 1724 writeBytes(varuint.encode(2)); 1725 writeBytes(varint.encode(this._shulkerPeakHeight.value)); 1726 } 1727 } 1728 1729 public pure nothrow @property @safe @nogc byte shulkerDirection() { 1730 return _shulkerDirection.value; 1731 } 1732 1733 public pure nothrow @property @safe byte shulkerDirection(byte value) { 1734 this._cached = false; 1735 this._shulkerDirection.value = value; 1736 if(!this._shulkerDirection.changed) { 1737 this._shulkerDirection.changed = true; 1738 this._changed ~= &this.encodeShulkerDirection; 1739 } 1740 return value; 1741 } 1742 1743 public pure nothrow @safe encodeShulkerDirection(Buffer buffer) { 1744 with(buffer) { 1745 writeBytes(varuint.encode(65)); 1746 writeBytes(varuint.encode(0)); 1747 writeBigEndianByte(this._shulkerDirection.value); 1748 } 1749 } 1750 1751 public pure nothrow @property @safe @nogc Tuple!(int, "x", int, "y", int, "z") shulkerAttachment() { 1752 return _shulkerAttachment.value; 1753 } 1754 1755 public pure nothrow @property @safe Tuple!(int, "x", int, "y", int, "z") shulkerAttachment(Tuple!(int, "x", int, "y", int, "z") value) { 1756 this._cached = false; 1757 this._shulkerAttachment.value = value; 1758 if(!this._shulkerAttachment.changed) { 1759 this._shulkerAttachment.changed = true; 1760 this._changed ~= &this.encodeShulkerAttachment; 1761 } 1762 return value; 1763 } 1764 1765 public pure nothrow @safe encodeShulkerAttachment(Buffer buffer) { 1766 with(buffer) { 1767 writeBytes(varuint.encode(67)); 1768 writeBytes(varuint.encode(6)); 1769 writeBytes(varint.encode(this._shulkerAttachment.value.x)); writeBytes(varint.encode(this._shulkerAttachment.value.y)); writeBytes(varint.encode(this._shulkerAttachment.value.z)); 1770 } 1771 } 1772 1773 public pure nothrow @property @safe @nogc long tradingPlayer() { 1774 return _tradingPlayer.value; 1775 } 1776 1777 public pure nothrow @property @safe long tradingPlayer(long value) { 1778 this._cached = false; 1779 this._tradingPlayer.value = value; 1780 if(!this._tradingPlayer.changed) { 1781 this._tradingPlayer.changed = true; 1782 this._changed ~= &this.encodeTradingPlayer; 1783 } 1784 return value; 1785 } 1786 1787 public pure nothrow @safe encodeTradingPlayer(Buffer buffer) { 1788 with(buffer) { 1789 writeBytes(varuint.encode(68)); 1790 writeBytes(varuint.encode(7)); 1791 writeBytes(varlong.encode(this._tradingPlayer.value)); 1792 } 1793 } 1794 1795 public pure nothrow @property @safe @nogc string commandBlockCommand() { 1796 return _commandBlockCommand.value; 1797 } 1798 1799 public pure nothrow @property @safe string commandBlockCommand(string value) { 1800 this._cached = false; 1801 this._commandBlockCommand.value = value; 1802 if(!this._commandBlockCommand.changed) { 1803 this._commandBlockCommand.changed = true; 1804 this._changed ~= &this.encodeCommandBlockCommand; 1805 } 1806 return value; 1807 } 1808 1809 public pure nothrow @safe encodeCommandBlockCommand(Buffer buffer) { 1810 with(buffer) { 1811 writeBytes(varuint.encode(71)); 1812 writeBytes(varuint.encode(4)); 1813 writeBytes(varuint.encode(cast(uint)this._commandBlockCommand.value.length)); writeString(this._commandBlockCommand.value); 1814 } 1815 } 1816 1817 public pure nothrow @property @safe @nogc string commandBlockLastOutput() { 1818 return _commandBlockLastOutput.value; 1819 } 1820 1821 public pure nothrow @property @safe string commandBlockLastOutput(string value) { 1822 this._cached = false; 1823 this._commandBlockLastOutput.value = value; 1824 if(!this._commandBlockLastOutput.changed) { 1825 this._commandBlockLastOutput.changed = true; 1826 this._changed ~= &this.encodeCommandBlockLastOutput; 1827 } 1828 return value; 1829 } 1830 1831 public pure nothrow @safe encodeCommandBlockLastOutput(Buffer buffer) { 1832 with(buffer) { 1833 writeBytes(varuint.encode(72)); 1834 writeBytes(varuint.encode(4)); 1835 writeBytes(varuint.encode(cast(uint)this._commandBlockLastOutput.value.length)); writeString(this._commandBlockLastOutput.value); 1836 } 1837 } 1838 1839 public pure nothrow @property @safe @nogc string commandBlockTrackOutput() { 1840 return _commandBlockTrackOutput.value; 1841 } 1842 1843 public pure nothrow @property @safe string commandBlockTrackOutput(string value) { 1844 this._cached = false; 1845 this._commandBlockTrackOutput.value = value; 1846 if(!this._commandBlockTrackOutput.changed) { 1847 this._commandBlockTrackOutput.changed = true; 1848 this._changed ~= &this.encodeCommandBlockTrackOutput; 1849 } 1850 return value; 1851 } 1852 1853 public pure nothrow @safe encodeCommandBlockTrackOutput(Buffer buffer) { 1854 with(buffer) { 1855 writeBytes(varuint.encode(73)); 1856 writeBytes(varuint.encode(4)); 1857 writeBytes(varuint.encode(cast(uint)this._commandBlockTrackOutput.value.length)); writeString(this._commandBlockTrackOutput.value); 1858 } 1859 } 1860 1861 public pure nothrow @property @safe @nogc byte controllingRiderSeatNumber() { 1862 return _controllingRiderSeatNumber.value; 1863 } 1864 1865 public pure nothrow @property @safe byte controllingRiderSeatNumber(byte value) { 1866 this._cached = false; 1867 this._controllingRiderSeatNumber.value = value; 1868 if(!this._controllingRiderSeatNumber.changed) { 1869 this._controllingRiderSeatNumber.changed = true; 1870 this._changed ~= &this.encodeControllingRiderSeatNumber; 1871 } 1872 return value; 1873 } 1874 1875 public pure nothrow @safe encodeControllingRiderSeatNumber(Buffer buffer) { 1876 with(buffer) { 1877 writeBytes(varuint.encode(74)); 1878 writeBytes(varuint.encode(0)); 1879 writeBigEndianByte(this._controllingRiderSeatNumber.value); 1880 } 1881 } 1882 1883 public pure nothrow @property @safe @nogc int strength() { 1884 return _strength.value; 1885 } 1886 1887 public pure nothrow @property @safe int strength(int value) { 1888 this._cached = false; 1889 this._strength.value = value; 1890 if(!this._strength.changed) { 1891 this._strength.changed = true; 1892 this._changed ~= &this.encodeStrength; 1893 } 1894 return value; 1895 } 1896 1897 public pure nothrow @safe encodeStrength(Buffer buffer) { 1898 with(buffer) { 1899 writeBytes(varuint.encode(75)); 1900 writeBytes(varuint.encode(2)); 1901 writeBytes(varint.encode(this._strength.value)); 1902 } 1903 } 1904 1905 public pure nothrow @property @safe @nogc int maxStrength() { 1906 return _maxStrength.value; 1907 } 1908 1909 public pure nothrow @property @safe int maxStrength(int value) { 1910 this._cached = false; 1911 this._maxStrength.value = value; 1912 if(!this._maxStrength.changed) { 1913 this._maxStrength.changed = true; 1914 this._changed ~= &this.encodeMaxStrength; 1915 } 1916 return value; 1917 } 1918 1919 public pure nothrow @safe encodeMaxStrength(Buffer buffer) { 1920 with(buffer) { 1921 writeBytes(varuint.encode(76)); 1922 writeBytes(varuint.encode(2)); 1923 writeBytes(varint.encode(this._maxStrength.value)); 1924 } 1925 } 1926 1927 public pure nothrow @safe encode(Buffer buffer) { 1928 with(buffer) { 1929 if(this._cached) { 1930 buffer.writeBytes(this._cache); 1931 } else { 1932 immutable start = buffer._buffer.length; 1933 writeBytes(varuint.encode(cast(uint)this._changed.length)); 1934 foreach(del ; this._changed) del(buffer); 1935 this._cached = true; 1936 this._cache = buffer._buffer[start..$]; 1937 } 1938 } 1939 } 1940 1941 public static pure nothrow @safe Metadata decode(Buffer buffer) { 1942 auto metadata = new Metadata(); 1943 with(buffer) { 1944 uint id; 1945 size_t length=varuint.decode(_buffer, &_index); 1946 while(length-- > 0) { 1947 id=varuint.decode(_buffer, &_index); 1948 switch(varuint.decode(_buffer, &_index)) { 1949 case 0: 1950 byte _0; 1951 _0=readBigEndianByte(); 1952 metadata.decoded ~= DecodedMetadata.fromByte(id, _0); 1953 break; 1954 case 1: 1955 short _1; 1956 _1=readLittleEndianShort(); 1957 metadata.decoded ~= DecodedMetadata.fromShort(id, _1); 1958 break; 1959 case 2: 1960 int _2; 1961 _2=varint.decode(_buffer, &_index); 1962 metadata.decoded ~= DecodedMetadata.fromInt(id, _2); 1963 break; 1964 case 3: 1965 float _3; 1966 _3=readLittleEndianFloat(); 1967 metadata.decoded ~= DecodedMetadata.fromFloat(id, _3); 1968 break; 1969 case 4: 1970 string _4; 1971 uint xq=varuint.decode(_buffer, &_index); _4=readString(xq); 1972 metadata.decoded ~= DecodedMetadata.fromString(id, _4); 1973 break; 1974 case 5: 1975 sul.protocol.pocket113.types.Slot _5; 1976 _5.decode(bufferInstance); 1977 metadata.decoded ~= DecodedMetadata.fromSlot(id, _5); 1978 break; 1979 case 6: 1980 Tuple!(int, "x", int, "y", int, "z") _6; 1981 _6.x=varint.decode(_buffer, &_index); _6.y=varint.decode(_buffer, &_index); _6.z=varint.decode(_buffer, &_index); 1982 metadata.decoded ~= DecodedMetadata.fromBlockPosition(id, _6); 1983 break; 1984 case 7: 1985 long _7; 1986 _7=varlong.decode(_buffer, &_index); 1987 metadata.decoded ~= DecodedMetadata.fromLong(id, _7); 1988 break; 1989 case 8: 1990 Tuple!(float, "x", float, "y", float, "z") _8; 1991 _8.x=readLittleEndianFloat(); _8.y=readLittleEndianFloat(); _8.z=readLittleEndianFloat(); 1992 metadata.decoded ~= DecodedMetadata.fromEntityPosition(id, _8); 1993 break; 1994 default: 1995 break; 1996 } 1997 } 1998 } 1999 return metadata; 2000 } 2001 2002 } 2003 2004 class DecodedMetadata { 2005 2006 public immutable uint id; 2007 public immutable uint type; 2008 2009 union { 2010 byte byte_; 2011 short short_; 2012 int int_; 2013 float float_; 2014 string string_; 2015 sul.protocol.pocket113.types.Slot slot; 2016 Tuple!(int, "x", int, "y", int, "z") block_position; 2017 long long_; 2018 Tuple!(float, "x", float, "y", float, "z") entity_position; 2019 } 2020 2021 private pure nothrow @safe @nogc this(uint id, uint type) { 2022 this.id = id; 2023 this.type = type; 2024 } 2025 2026 public static pure nothrow @trusted DecodedMetadata fromByte(uint id, byte value) { 2027 auto ret = new DecodedMetadata(id, 0); 2028 ret.byte_ = value; 2029 return ret; 2030 } 2031 2032 public static pure nothrow @trusted DecodedMetadata fromShort(uint id, short value) { 2033 auto ret = new DecodedMetadata(id, 1); 2034 ret.short_ = value; 2035 return ret; 2036 } 2037 2038 public static pure nothrow @trusted DecodedMetadata fromInt(uint id, int value) { 2039 auto ret = new DecodedMetadata(id, 2); 2040 ret.int_ = value; 2041 return ret; 2042 } 2043 2044 public static pure nothrow @trusted DecodedMetadata fromFloat(uint id, float value) { 2045 auto ret = new DecodedMetadata(id, 3); 2046 ret.float_ = value; 2047 return ret; 2048 } 2049 2050 public static pure nothrow @trusted DecodedMetadata fromString(uint id, string value) { 2051 auto ret = new DecodedMetadata(id, 4); 2052 ret.string_ = value; 2053 return ret; 2054 } 2055 2056 public static pure nothrow @trusted DecodedMetadata fromSlot(uint id, sul.protocol.pocket113.types.Slot value) { 2057 auto ret = new DecodedMetadata(id, 5); 2058 ret.slot = value; 2059 return ret; 2060 } 2061 2062 public static pure nothrow @trusted DecodedMetadata fromBlockPosition(uint id, Tuple!(int, "x", int, "y", int, "z") value) { 2063 auto ret = new DecodedMetadata(id, 6); 2064 ret.block_position = value; 2065 return ret; 2066 } 2067 2068 public static pure nothrow @trusted DecodedMetadata fromLong(uint id, long value) { 2069 auto ret = new DecodedMetadata(id, 7); 2070 ret.long_ = value; 2071 return ret; 2072 } 2073 2074 public static pure nothrow @trusted DecodedMetadata fromEntityPosition(uint id, Tuple!(float, "x", float, "y", float, "z") value) { 2075 auto ret = new DecodedMetadata(id, 8); 2076 ret.entity_position = value; 2077 return ret; 2078 } 2079 2080 }