1 /* 2 * This file has been automatically generated by Soupply and released under the MIT license. 3 * Generated from data/java210.xml 4 */ 5 module soupply.java210.protocol.serverbound; 6 7 static import std.conv; 8 import std.typetuple : TypeTuple; 9 import xpacket; 10 11 import soupply.util; 12 import soupply.java210.metadata : Metadata; 13 import soupply.java210.packet : Java210Packet; 14 15 static import soupply.java210.types; 16 17 alias Packets = TypeTuple!(TeleportConfirm, TabComplete, ChatMessage, ClientStatus, ClientSettings, ConfirmTransaction, EnchantItem, ClickWindow, CloseWindow, PluginMessage, UseEntity, KeepAlive, PlayerPosition, PlayerPositionAndLook, PlayerLook, Player, VehicleMove, SteerBoat, PlayerAbilities, PlayerDigging, EntityAction, SteerVehicle, ResourcePackStatus, HeldItemChange, CreativeInventoryAction, UpdateSign, Animation, Spectate, PlayerBlockPlacement, UseItem); 18 19 class TeleportConfirm : Java210Packet 20 { 21 22 enum uint ID = 0; 23 24 enum bool CLIENTBOUND = false; 25 enum bool SERVERBOUND = true; 26 27 enum string[] __fields = ["teleportId"]; 28 29 @Var uint teleportId; 30 31 this() pure nothrow @safe @nogc {} 32 33 this(uint teleportId) pure nothrow @safe @nogc 34 { 35 this.teleportId = teleportId; 36 } 37 38 mixin Make; 39 40 public static typeof(this) fromBuffer(ubyte[] buffer) 41 { 42 TeleportConfirm ret = new TeleportConfirm(); 43 ret.decode(buffer); 44 return ret; 45 } 46 47 override string toString() 48 { 49 return "TeleportConfirm(teleportId: " ~ std.conv.to!string(this.teleportId) ~ ")"; 50 } 51 52 } 53 54 class TabComplete : Java210Packet 55 { 56 57 enum uint ID = 1; 58 59 enum bool CLIENTBOUND = false; 60 enum bool SERVERBOUND = true; 61 62 enum string[] __fields = ["text", "command", "hasPosition", "block"]; 63 64 string text; 65 bool command; 66 bool hasPosition; 67 @Condition("hasPosition==true") ulong block; 68 69 this() pure nothrow @safe @nogc {} 70 71 this(string text, bool command=bool.init, bool hasPosition=bool.init, ulong block=ulong.init) pure nothrow @safe @nogc 72 { 73 this.text = text; 74 this.command = command; 75 this.hasPosition = hasPosition; 76 this.block = block; 77 } 78 79 mixin Make; 80 81 public static typeof(this) fromBuffer(ubyte[] buffer) 82 { 83 TabComplete ret = new TabComplete(); 84 ret.decode(buffer); 85 return ret; 86 } 87 88 override string toString() 89 { 90 return "TabComplete(text: " ~ std.conv.to!string(this.text) ~ ", command: " ~ std.conv.to!string(this.command) ~ ", hasPosition: " ~ std.conv.to!string(this.hasPosition) ~ ", block: " ~ std.conv.to!string(this.block) ~ ")"; 91 } 92 93 } 94 95 class ChatMessage : Java210Packet 96 { 97 98 enum uint ID = 2; 99 100 enum bool CLIENTBOUND = false; 101 enum bool SERVERBOUND = true; 102 103 enum string[] __fields = ["text"]; 104 105 string text; 106 107 this() pure nothrow @safe @nogc {} 108 109 this(string text) pure nothrow @safe @nogc 110 { 111 this.text = text; 112 } 113 114 mixin Make; 115 116 public static typeof(this) fromBuffer(ubyte[] buffer) 117 { 118 ChatMessage ret = new ChatMessage(); 119 ret.decode(buffer); 120 return ret; 121 } 122 123 override string toString() 124 { 125 return "ChatMessage(text: " ~ std.conv.to!string(this.text) ~ ")"; 126 } 127 128 } 129 130 class ClientStatus : Java210Packet 131 { 132 133 enum uint ID = 3; 134 135 enum bool CLIENTBOUND = false; 136 enum bool SERVERBOUND = true; 137 138 // action 139 enum uint RESPAWN = 0; 140 enum uint REQUEST_STATS = 1; 141 enum uint OPEN_INVENTORY = 2; 142 143 enum string[] __fields = ["action"]; 144 145 @Var uint action; 146 147 this() pure nothrow @safe @nogc {} 148 149 this(uint action) pure nothrow @safe @nogc 150 { 151 this.action = action; 152 } 153 154 mixin Make; 155 156 public static typeof(this) fromBuffer(ubyte[] buffer) 157 { 158 ClientStatus ret = new ClientStatus(); 159 ret.decode(buffer); 160 return ret; 161 } 162 163 override string toString() 164 { 165 return "ClientStatus(action: " ~ std.conv.to!string(this.action) ~ ")"; 166 } 167 168 } 169 170 class ClientSettings : Java210Packet 171 { 172 173 enum uint ID = 4; 174 175 enum bool CLIENTBOUND = false; 176 enum bool SERVERBOUND = true; 177 178 // chat mode 179 enum uint ENABLED = 0; 180 enum uint COMMANDS_ONLY = 1; 181 enum uint DISABLED = 2; 182 183 // displayed skin parts 184 enum ubyte CAPE = 1; 185 enum ubyte JACKET = 2; 186 enum ubyte LEFT_SLEEVE = 4; 187 enum ubyte RIGHT_SLEEVE = 8; 188 enum ubyte LEFT_PANTS = 16; 189 enum ubyte RIGHT_PANTS = 32; 190 enum ubyte HAT = 64; 191 192 // main hand 193 enum ubyte RIGHT = 0; 194 enum ubyte LEFT = 1; 195 196 enum string[] __fields = ["language", "viewDistance", "chatMode", "chatColors", "displayedSkinParts", "mainHand"]; 197 198 string language; 199 ubyte viewDistance; 200 @Var uint chatMode; 201 bool chatColors; 202 ubyte displayedSkinParts; 203 ubyte mainHand; 204 205 this() pure nothrow @safe @nogc {} 206 207 this(string language, ubyte viewDistance=ubyte.init, uint chatMode=uint.init, bool chatColors=bool.init, ubyte displayedSkinParts=ubyte.init, ubyte mainHand=ubyte.init) pure nothrow @safe @nogc 208 { 209 this.language = language; 210 this.viewDistance = viewDistance; 211 this.chatMode = chatMode; 212 this.chatColors = chatColors; 213 this.displayedSkinParts = displayedSkinParts; 214 this.mainHand = mainHand; 215 } 216 217 mixin Make; 218 219 public static typeof(this) fromBuffer(ubyte[] buffer) 220 { 221 ClientSettings ret = new ClientSettings(); 222 ret.decode(buffer); 223 return ret; 224 } 225 226 override string toString() 227 { 228 return "ClientSettings(language: " ~ std.conv.to!string(this.language) ~ ", viewDistance: " ~ std.conv.to!string(this.viewDistance) ~ ", chatMode: " ~ std.conv.to!string(this.chatMode) ~ ", chatColors: " ~ std.conv.to!string(this.chatColors) ~ ", displayedSkinParts: " ~ std.conv.to!string(this.displayedSkinParts) ~ ", mainHand: " ~ std.conv.to!string(this.mainHand) ~ ")"; 229 } 230 231 } 232 233 class ConfirmTransaction : Java210Packet 234 { 235 236 enum uint ID = 5; 237 238 enum bool CLIENTBOUND = false; 239 enum bool SERVERBOUND = true; 240 241 enum string[] __fields = ["window", "action", "accepted"]; 242 243 ubyte window; 244 ushort action; 245 bool accepted; 246 247 this() pure nothrow @safe @nogc {} 248 249 this(ubyte window, ushort action=ushort.init, bool accepted=bool.init) pure nothrow @safe @nogc 250 { 251 this.window = window; 252 this.action = action; 253 this.accepted = accepted; 254 } 255 256 mixin Make; 257 258 public static typeof(this) fromBuffer(ubyte[] buffer) 259 { 260 ConfirmTransaction ret = new ConfirmTransaction(); 261 ret.decode(buffer); 262 return ret; 263 } 264 265 override string toString() 266 { 267 return "ConfirmTransaction(window: " ~ std.conv.to!string(this.window) ~ ", action: " ~ std.conv.to!string(this.action) ~ ", accepted: " ~ std.conv.to!string(this.accepted) ~ ")"; 268 } 269 270 } 271 272 class EnchantItem : Java210Packet 273 { 274 275 enum uint ID = 6; 276 277 enum bool CLIENTBOUND = false; 278 enum bool SERVERBOUND = true; 279 280 enum string[] __fields = ["window", "enchantment"]; 281 282 ubyte window; 283 ubyte enchantment; 284 285 this() pure nothrow @safe @nogc {} 286 287 this(ubyte window, ubyte enchantment=ubyte.init) pure nothrow @safe @nogc 288 { 289 this.window = window; 290 this.enchantment = enchantment; 291 } 292 293 mixin Make; 294 295 public static typeof(this) fromBuffer(ubyte[] buffer) 296 { 297 EnchantItem ret = new EnchantItem(); 298 ret.decode(buffer); 299 return ret; 300 } 301 302 override string toString() 303 { 304 return "EnchantItem(window: " ~ std.conv.to!string(this.window) ~ ", enchantment: " ~ std.conv.to!string(this.enchantment) ~ ")"; 305 } 306 307 } 308 309 class ClickWindow : Java210Packet 310 { 311 312 enum uint ID = 7; 313 314 enum bool CLIENTBOUND = false; 315 enum bool SERVERBOUND = true; 316 317 enum string[] __fields = ["window", "slot", "button", "action", "mode", "clickedItem"]; 318 319 ubyte window; 320 ushort slot; 321 ubyte button; 322 ushort action; 323 @Var uint mode; 324 soupply.java210.types.Slot clickedItem; 325 326 this() pure nothrow @safe @nogc {} 327 328 this(ubyte window, ushort slot=ushort.init, ubyte button=ubyte.init, ushort action=ushort.init, uint mode=uint.init, soupply.java210.types.Slot clickedItem=soupply.java210.types.Slot.init) pure nothrow @safe @nogc 329 { 330 this.window = window; 331 this.slot = slot; 332 this.button = button; 333 this.action = action; 334 this.mode = mode; 335 this.clickedItem = clickedItem; 336 } 337 338 mixin Make; 339 340 public static typeof(this) fromBuffer(ubyte[] buffer) 341 { 342 ClickWindow ret = new ClickWindow(); 343 ret.decode(buffer); 344 return ret; 345 } 346 347 override string toString() 348 { 349 return "ClickWindow(window: " ~ std.conv.to!string(this.window) ~ ", slot: " ~ std.conv.to!string(this.slot) ~ ", button: " ~ std.conv.to!string(this.button) ~ ", action: " ~ std.conv.to!string(this.action) ~ ", mode: " ~ std.conv.to!string(this.mode) ~ ", clickedItem: " ~ std.conv.to!string(this.clickedItem) ~ ")"; 350 } 351 352 } 353 354 class CloseWindow : Java210Packet 355 { 356 357 enum uint ID = 8; 358 359 enum bool CLIENTBOUND = false; 360 enum bool SERVERBOUND = true; 361 362 enum string[] __fields = ["window"]; 363 364 ubyte window; 365 366 this() pure nothrow @safe @nogc {} 367 368 this(ubyte window) pure nothrow @safe @nogc 369 { 370 this.window = window; 371 } 372 373 mixin Make; 374 375 public static typeof(this) fromBuffer(ubyte[] buffer) 376 { 377 CloseWindow ret = new CloseWindow(); 378 ret.decode(buffer); 379 return ret; 380 } 381 382 override string toString() 383 { 384 return "CloseWindow(window: " ~ std.conv.to!string(this.window) ~ ")"; 385 } 386 387 } 388 389 class PluginMessage : Java210Packet 390 { 391 392 enum uint ID = 9; 393 394 enum bool CLIENTBOUND = false; 395 enum bool SERVERBOUND = true; 396 397 enum string[] __fields = ["channel", "data"]; 398 399 string channel; 400 @NoLength ubyte[] data; 401 402 this() pure nothrow @safe @nogc {} 403 404 this(string channel, ubyte[] data=(ubyte[]).init) pure nothrow @safe @nogc 405 { 406 this.channel = channel; 407 this.data = data; 408 } 409 410 mixin Make; 411 412 public static typeof(this) fromBuffer(ubyte[] buffer) 413 { 414 PluginMessage ret = new PluginMessage(); 415 ret.decode(buffer); 416 return ret; 417 } 418 419 override string toString() 420 { 421 return "PluginMessage(channel: " ~ std.conv.to!string(this.channel) ~ ", data: " ~ std.conv.to!string(this.data) ~ ")"; 422 } 423 424 } 425 426 class UseEntity : Java210Packet 427 { 428 429 enum uint ID = 10; 430 431 enum bool CLIENTBOUND = false; 432 enum bool SERVERBOUND = true; 433 434 // type 435 enum uint INTERACT = 0; 436 enum uint ATTACK = 1; 437 enum uint INTERACT_AT = 2; 438 439 // hand 440 enum uint MAIN_HAND = 0; 441 enum uint OFF_HAND = 1; 442 443 enum string[] __fields = ["target", "type", "targetPosition", "hand"]; 444 445 @Var uint target; 446 @Var uint type; 447 @Condition("type==2") Vector!(float, "xyz") targetPosition; 448 @Condition("type==0||type==2") @Var uint hand; 449 450 this() pure nothrow @safe @nogc {} 451 452 this(uint target, uint type=uint.init, Vector!(float, "xyz") targetPosition=Vector!(float, "xyz").init, uint hand=uint.init) pure nothrow @safe @nogc 453 { 454 this.target = target; 455 this.type = type; 456 this.targetPosition = targetPosition; 457 this.hand = hand; 458 } 459 460 mixin Make; 461 462 public static typeof(this) fromBuffer(ubyte[] buffer) 463 { 464 UseEntity ret = new UseEntity(); 465 ret.decode(buffer); 466 return ret; 467 } 468 469 override string toString() 470 { 471 return "UseEntity(target: " ~ std.conv.to!string(this.target) ~ ", type: " ~ std.conv.to!string(this.type) ~ ", targetPosition: " ~ std.conv.to!string(this.targetPosition) ~ ", hand: " ~ std.conv.to!string(this.hand) ~ ")"; 472 } 473 474 } 475 476 class KeepAlive : Java210Packet 477 { 478 479 enum uint ID = 11; 480 481 enum bool CLIENTBOUND = false; 482 enum bool SERVERBOUND = true; 483 484 enum string[] __fields = ["id"]; 485 486 @Var uint id; 487 488 this() pure nothrow @safe @nogc {} 489 490 this(uint id) pure nothrow @safe @nogc 491 { 492 this.id = id; 493 } 494 495 mixin Make; 496 497 public static typeof(this) fromBuffer(ubyte[] buffer) 498 { 499 KeepAlive ret = new KeepAlive(); 500 ret.decode(buffer); 501 return ret; 502 } 503 504 override string toString() 505 { 506 return "KeepAlive(id: " ~ std.conv.to!string(this.id) ~ ")"; 507 } 508 509 } 510 511 class PlayerPosition : Java210Packet 512 { 513 514 enum uint ID = 12; 515 516 enum bool CLIENTBOUND = false; 517 enum bool SERVERBOUND = true; 518 519 enum string[] __fields = ["position", "onGround"]; 520 521 Vector!(double, "xyz") position; 522 bool onGround; 523 524 this() pure nothrow @safe @nogc {} 525 526 this(Vector!(double, "xyz") position, bool onGround=bool.init) pure nothrow @safe @nogc 527 { 528 this.position = position; 529 this.onGround = onGround; 530 } 531 532 mixin Make; 533 534 public static typeof(this) fromBuffer(ubyte[] buffer) 535 { 536 PlayerPosition ret = new PlayerPosition(); 537 ret.decode(buffer); 538 return ret; 539 } 540 541 override string toString() 542 { 543 return "PlayerPosition(position: " ~ std.conv.to!string(this.position) ~ ", onGround: " ~ std.conv.to!string(this.onGround) ~ ")"; 544 } 545 546 } 547 548 class PlayerPositionAndLook : Java210Packet 549 { 550 551 enum uint ID = 13; 552 553 enum bool CLIENTBOUND = false; 554 enum bool SERVERBOUND = true; 555 556 enum string[] __fields = ["position", "yaw", "pitch", "onGround"]; 557 558 Vector!(double, "xyz") position; 559 float yaw; 560 float pitch; 561 bool onGround; 562 563 this() pure nothrow @safe @nogc {} 564 565 this(Vector!(double, "xyz") position, float yaw=float.init, float pitch=float.init, bool onGround=bool.init) pure nothrow @safe @nogc 566 { 567 this.position = position; 568 this.yaw = yaw; 569 this.pitch = pitch; 570 this.onGround = onGround; 571 } 572 573 mixin Make; 574 575 public static typeof(this) fromBuffer(ubyte[] buffer) 576 { 577 PlayerPositionAndLook ret = new PlayerPositionAndLook(); 578 ret.decode(buffer); 579 return ret; 580 } 581 582 override string toString() 583 { 584 return "PlayerPositionAndLook(position: " ~ std.conv.to!string(this.position) ~ ", yaw: " ~ std.conv.to!string(this.yaw) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ", onGround: " ~ std.conv.to!string(this.onGround) ~ ")"; 585 } 586 587 } 588 589 class PlayerLook : Java210Packet 590 { 591 592 enum uint ID = 14; 593 594 enum bool CLIENTBOUND = false; 595 enum bool SERVERBOUND = true; 596 597 enum string[] __fields = ["yaw", "pitch", "onGround"]; 598 599 float yaw; 600 float pitch; 601 bool onGround; 602 603 this() pure nothrow @safe @nogc {} 604 605 this(float yaw, float pitch=float.init, bool onGround=bool.init) pure nothrow @safe @nogc 606 { 607 this.yaw = yaw; 608 this.pitch = pitch; 609 this.onGround = onGround; 610 } 611 612 mixin Make; 613 614 public static typeof(this) fromBuffer(ubyte[] buffer) 615 { 616 PlayerLook ret = new PlayerLook(); 617 ret.decode(buffer); 618 return ret; 619 } 620 621 override string toString() 622 { 623 return "PlayerLook(yaw: " ~ std.conv.to!string(this.yaw) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ", onGround: " ~ std.conv.to!string(this.onGround) ~ ")"; 624 } 625 626 } 627 628 class Player : Java210Packet 629 { 630 631 enum uint ID = 15; 632 633 enum bool CLIENTBOUND = false; 634 enum bool SERVERBOUND = true; 635 636 enum string[] __fields = ["onGround"]; 637 638 bool onGround; 639 640 this() pure nothrow @safe @nogc {} 641 642 this(bool onGround) pure nothrow @safe @nogc 643 { 644 this.onGround = onGround; 645 } 646 647 mixin Make; 648 649 public static typeof(this) fromBuffer(ubyte[] buffer) 650 { 651 Player ret = new Player(); 652 ret.decode(buffer); 653 return ret; 654 } 655 656 override string toString() 657 { 658 return "Player(onGround: " ~ std.conv.to!string(this.onGround) ~ ")"; 659 } 660 661 } 662 663 class VehicleMove : Java210Packet 664 { 665 666 enum uint ID = 16; 667 668 enum bool CLIENTBOUND = false; 669 enum bool SERVERBOUND = true; 670 671 enum string[] __fields = ["position", "yaw", "pitch"]; 672 673 Vector!(double, "xyz") position; 674 float yaw; 675 float pitch; 676 677 this() pure nothrow @safe @nogc {} 678 679 this(Vector!(double, "xyz") position, float yaw=float.init, float pitch=float.init) pure nothrow @safe @nogc 680 { 681 this.position = position; 682 this.yaw = yaw; 683 this.pitch = pitch; 684 } 685 686 mixin Make; 687 688 public static typeof(this) fromBuffer(ubyte[] buffer) 689 { 690 VehicleMove ret = new VehicleMove(); 691 ret.decode(buffer); 692 return ret; 693 } 694 695 override string toString() 696 { 697 return "VehicleMove(position: " ~ std.conv.to!string(this.position) ~ ", yaw: " ~ std.conv.to!string(this.yaw) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ")"; 698 } 699 700 } 701 702 class SteerBoat : Java210Packet 703 { 704 705 enum uint ID = 17; 706 707 enum bool CLIENTBOUND = false; 708 enum bool SERVERBOUND = true; 709 710 enum string[] __fields = ["rightPaddleTurning", "leftPaddleTurning"]; 711 712 bool rightPaddleTurning; 713 bool leftPaddleTurning; 714 715 this() pure nothrow @safe @nogc {} 716 717 this(bool rightPaddleTurning, bool leftPaddleTurning=bool.init) pure nothrow @safe @nogc 718 { 719 this.rightPaddleTurning = rightPaddleTurning; 720 this.leftPaddleTurning = leftPaddleTurning; 721 } 722 723 mixin Make; 724 725 public static typeof(this) fromBuffer(ubyte[] buffer) 726 { 727 SteerBoat ret = new SteerBoat(); 728 ret.decode(buffer); 729 return ret; 730 } 731 732 override string toString() 733 { 734 return "SteerBoat(rightPaddleTurning: " ~ std.conv.to!string(this.rightPaddleTurning) ~ ", leftPaddleTurning: " ~ std.conv.to!string(this.leftPaddleTurning) ~ ")"; 735 } 736 737 } 738 739 class PlayerAbilities : Java210Packet 740 { 741 742 enum uint ID = 18; 743 744 enum bool CLIENTBOUND = false; 745 enum bool SERVERBOUND = true; 746 747 // flags 748 enum ubyte CREATIVE_MODE = 1; 749 enum ubyte FLYING = 2; 750 enum ubyte ALLOW_FLYING = 4; 751 enum ubyte INVINCIBLE = 8; 752 753 enum string[] __fields = ["flags", "flyingSpeed", "walkingSpeed"]; 754 755 ubyte flags; 756 float flyingSpeed; 757 float walkingSpeed; 758 759 this() pure nothrow @safe @nogc {} 760 761 this(ubyte flags, float flyingSpeed=float.init, float walkingSpeed=float.init) pure nothrow @safe @nogc 762 { 763 this.flags = flags; 764 this.flyingSpeed = flyingSpeed; 765 this.walkingSpeed = walkingSpeed; 766 } 767 768 mixin Make; 769 770 public static typeof(this) fromBuffer(ubyte[] buffer) 771 { 772 PlayerAbilities ret = new PlayerAbilities(); 773 ret.decode(buffer); 774 return ret; 775 } 776 777 override string toString() 778 { 779 return "PlayerAbilities(flags: " ~ std.conv.to!string(this.flags) ~ ", flyingSpeed: " ~ std.conv.to!string(this.flyingSpeed) ~ ", walkingSpeed: " ~ std.conv.to!string(this.walkingSpeed) ~ ")"; 780 } 781 782 } 783 784 class PlayerDigging : Java210Packet 785 { 786 787 enum uint ID = 19; 788 789 enum bool CLIENTBOUND = false; 790 enum bool SERVERBOUND = true; 791 792 // status 793 enum uint START_DIGGING = 0; 794 enum uint CANCEL_DIGGING = 1; 795 enum uint FINISH_DIGGING = 2; 796 enum uint DROP_ITEM_STACK = 3; 797 enum uint DROP_ITEM = 4; 798 enum uint SHOOT_ARROW = 5; 799 enum uint FINISH_EATING = 5; 800 enum uint SWAP_ITEM_IN_HAND = 6; 801 802 enum string[] __fields = ["status", "position", "face"]; 803 804 @Var uint status; 805 ulong position; 806 ubyte face; 807 808 this() pure nothrow @safe @nogc {} 809 810 this(uint status, ulong position=ulong.init, ubyte face=ubyte.init) pure nothrow @safe @nogc 811 { 812 this.status = status; 813 this.position = position; 814 this.face = face; 815 } 816 817 mixin Make; 818 819 public static typeof(this) fromBuffer(ubyte[] buffer) 820 { 821 PlayerDigging ret = new PlayerDigging(); 822 ret.decode(buffer); 823 return ret; 824 } 825 826 override string toString() 827 { 828 return "PlayerDigging(status: " ~ std.conv.to!string(this.status) ~ ", position: " ~ std.conv.to!string(this.position) ~ ", face: " ~ std.conv.to!string(this.face) ~ ")"; 829 } 830 831 } 832 833 class EntityAction : Java210Packet 834 { 835 836 enum uint ID = 20; 837 838 enum bool CLIENTBOUND = false; 839 enum bool SERVERBOUND = true; 840 841 // action 842 enum uint START_SNEAKING = 0; 843 enum uint STOP_SNEAKING = 1; 844 enum uint LEAVE_BED = 2; 845 enum uint START_SPRINTING = 3; 846 enum uint STOP_SPRINTING = 4; 847 enum uint START_HORSE_JUMP = 5; 848 enum uint STOP_HORSE_JUMP = 6; 849 enum uint OPEN_HORSE_INVENTORY = 7; 850 enum uint START_ELYTRA_FLYING = 8; 851 852 enum string[] __fields = ["entityId", "action", "jumpBoost"]; 853 854 @Var uint entityId; 855 @Var uint action; 856 @Var uint jumpBoost; 857 858 this() pure nothrow @safe @nogc {} 859 860 this(uint entityId, uint action=uint.init, uint jumpBoost=uint.init) pure nothrow @safe @nogc 861 { 862 this.entityId = entityId; 863 this.action = action; 864 this.jumpBoost = jumpBoost; 865 } 866 867 mixin Make; 868 869 public static typeof(this) fromBuffer(ubyte[] buffer) 870 { 871 EntityAction ret = new EntityAction(); 872 ret.decode(buffer); 873 return ret; 874 } 875 876 override string toString() 877 { 878 return "EntityAction(entityId: " ~ std.conv.to!string(this.entityId) ~ ", action: " ~ std.conv.to!string(this.action) ~ ", jumpBoost: " ~ std.conv.to!string(this.jumpBoost) ~ ")"; 879 } 880 881 } 882 883 class SteerVehicle : Java210Packet 884 { 885 886 enum uint ID = 21; 887 888 enum bool CLIENTBOUND = false; 889 enum bool SERVERBOUND = true; 890 891 // flags 892 enum ubyte JUMP = 1; 893 enum ubyte UNMOUNT = 2; 894 895 enum string[] __fields = ["sideways", "forward", "flags"]; 896 897 float sideways; 898 float forward; 899 ubyte flags; 900 901 this() pure nothrow @safe @nogc {} 902 903 this(float sideways, float forward=float.init, ubyte flags=ubyte.init) pure nothrow @safe @nogc 904 { 905 this.sideways = sideways; 906 this.forward = forward; 907 this.flags = flags; 908 } 909 910 mixin Make; 911 912 public static typeof(this) fromBuffer(ubyte[] buffer) 913 { 914 SteerVehicle ret = new SteerVehicle(); 915 ret.decode(buffer); 916 return ret; 917 } 918 919 override string toString() 920 { 921 return "SteerVehicle(sideways: " ~ std.conv.to!string(this.sideways) ~ ", forward: " ~ std.conv.to!string(this.forward) ~ ", flags: " ~ std.conv.to!string(this.flags) ~ ")"; 922 } 923 924 } 925 926 class ResourcePackStatus : Java210Packet 927 { 928 929 enum uint ID = 22; 930 931 enum bool CLIENTBOUND = false; 932 enum bool SERVERBOUND = true; 933 934 // result 935 enum uint LOADED = 0; 936 enum uint DECLINED = 1; 937 enum uint FAILED = 2; 938 enum uint ACCEPTED = 3; 939 940 enum string[] __fields = ["result"]; 941 942 @Var uint result; 943 944 this() pure nothrow @safe @nogc {} 945 946 this(uint result) pure nothrow @safe @nogc 947 { 948 this.result = result; 949 } 950 951 mixin Make; 952 953 public static typeof(this) fromBuffer(ubyte[] buffer) 954 { 955 ResourcePackStatus ret = new ResourcePackStatus(); 956 ret.decode(buffer); 957 return ret; 958 } 959 960 override string toString() 961 { 962 return "ResourcePackStatus(result: " ~ std.conv.to!string(this.result) ~ ")"; 963 } 964 965 } 966 967 class HeldItemChange : Java210Packet 968 { 969 970 enum uint ID = 23; 971 972 enum bool CLIENTBOUND = false; 973 enum bool SERVERBOUND = true; 974 975 enum string[] __fields = ["slot"]; 976 977 ushort slot; 978 979 this() pure nothrow @safe @nogc {} 980 981 this(ushort slot) pure nothrow @safe @nogc 982 { 983 this.slot = slot; 984 } 985 986 mixin Make; 987 988 public static typeof(this) fromBuffer(ubyte[] buffer) 989 { 990 HeldItemChange ret = new HeldItemChange(); 991 ret.decode(buffer); 992 return ret; 993 } 994 995 override string toString() 996 { 997 return "HeldItemChange(slot: " ~ std.conv.to!string(this.slot) ~ ")"; 998 } 999 1000 } 1001 1002 class CreativeInventoryAction : Java210Packet 1003 { 1004 1005 enum uint ID = 24; 1006 1007 enum bool CLIENTBOUND = false; 1008 enum bool SERVERBOUND = true; 1009 1010 enum string[] __fields = ["slot", "clickedItem"]; 1011 1012 ushort slot; 1013 soupply.java210.types.Slot clickedItem; 1014 1015 this() pure nothrow @safe @nogc {} 1016 1017 this(ushort slot, soupply.java210.types.Slot clickedItem=soupply.java210.types.Slot.init) pure nothrow @safe @nogc 1018 { 1019 this.slot = slot; 1020 this.clickedItem = clickedItem; 1021 } 1022 1023 mixin Make; 1024 1025 public static typeof(this) fromBuffer(ubyte[] buffer) 1026 { 1027 CreativeInventoryAction ret = new CreativeInventoryAction(); 1028 ret.decode(buffer); 1029 return ret; 1030 } 1031 1032 override string toString() 1033 { 1034 return "CreativeInventoryAction(slot: " ~ std.conv.to!string(this.slot) ~ ", clickedItem: " ~ std.conv.to!string(this.clickedItem) ~ ")"; 1035 } 1036 1037 } 1038 1039 class UpdateSign : Java210Packet 1040 { 1041 1042 enum uint ID = 25; 1043 1044 enum bool CLIENTBOUND = false; 1045 enum bool SERVERBOUND = true; 1046 1047 enum string[] __fields = ["position", "lines"]; 1048 1049 ulong position; 1050 string[4] lines; 1051 1052 this() pure nothrow @safe @nogc {} 1053 1054 this(ulong position, string[4] lines=(string[4]).init) pure nothrow @safe @nogc 1055 { 1056 this.position = position; 1057 this.lines = lines; 1058 } 1059 1060 mixin Make; 1061 1062 public static typeof(this) fromBuffer(ubyte[] buffer) 1063 { 1064 UpdateSign ret = new UpdateSign(); 1065 ret.decode(buffer); 1066 return ret; 1067 } 1068 1069 override string toString() 1070 { 1071 return "UpdateSign(position: " ~ std.conv.to!string(this.position) ~ ", lines: " ~ std.conv.to!string(this.lines) ~ ")"; 1072 } 1073 1074 } 1075 1076 class Animation : Java210Packet 1077 { 1078 1079 enum uint ID = 26; 1080 1081 enum bool CLIENTBOUND = false; 1082 enum bool SERVERBOUND = true; 1083 1084 // hand 1085 enum uint MAIN_HAND = 0; 1086 enum uint OFF_HAND = 1; 1087 1088 enum string[] __fields = ["hand"]; 1089 1090 @Var uint hand; 1091 1092 this() pure nothrow @safe @nogc {} 1093 1094 this(uint hand) pure nothrow @safe @nogc 1095 { 1096 this.hand = hand; 1097 } 1098 1099 mixin Make; 1100 1101 public static typeof(this) fromBuffer(ubyte[] buffer) 1102 { 1103 Animation ret = new Animation(); 1104 ret.decode(buffer); 1105 return ret; 1106 } 1107 1108 override string toString() 1109 { 1110 return "Animation(hand: " ~ std.conv.to!string(this.hand) ~ ")"; 1111 } 1112 1113 } 1114 1115 class Spectate : Java210Packet 1116 { 1117 1118 enum uint ID = 27; 1119 1120 enum bool CLIENTBOUND = false; 1121 enum bool SERVERBOUND = true; 1122 1123 enum string[] __fields = ["player"]; 1124 1125 UUID player; 1126 1127 this() pure nothrow @safe @nogc {} 1128 1129 this(UUID player) pure nothrow @safe @nogc 1130 { 1131 this.player = player; 1132 } 1133 1134 mixin Make; 1135 1136 public static typeof(this) fromBuffer(ubyte[] buffer) 1137 { 1138 Spectate ret = new Spectate(); 1139 ret.decode(buffer); 1140 return ret; 1141 } 1142 1143 override string toString() 1144 { 1145 return "Spectate(player: " ~ std.conv.to!string(this.player) ~ ")"; 1146 } 1147 1148 } 1149 1150 class PlayerBlockPlacement : Java210Packet 1151 { 1152 1153 enum uint ID = 28; 1154 1155 enum bool CLIENTBOUND = false; 1156 enum bool SERVERBOUND = true; 1157 1158 // hand 1159 enum uint MAIN_HAND = 0; 1160 enum uint OFF_HAND = 1; 1161 1162 enum string[] __fields = ["position", "face", "hand", "cursorPosition"]; 1163 1164 ulong position; 1165 @Var uint face; 1166 @Var uint hand; 1167 Vector!(ubyte, "xyz") cursorPosition; 1168 1169 this() pure nothrow @safe @nogc {} 1170 1171 this(ulong position, uint face=uint.init, uint hand=uint.init, Vector!(ubyte, "xyz") cursorPosition=Vector!(ubyte, "xyz").init) pure nothrow @safe @nogc 1172 { 1173 this.position = position; 1174 this.face = face; 1175 this.hand = hand; 1176 this.cursorPosition = cursorPosition; 1177 } 1178 1179 mixin Make; 1180 1181 public static typeof(this) fromBuffer(ubyte[] buffer) 1182 { 1183 PlayerBlockPlacement ret = new PlayerBlockPlacement(); 1184 ret.decode(buffer); 1185 return ret; 1186 } 1187 1188 override string toString() 1189 { 1190 return "PlayerBlockPlacement(position: " ~ std.conv.to!string(this.position) ~ ", face: " ~ std.conv.to!string(this.face) ~ ", hand: " ~ std.conv.to!string(this.hand) ~ ", cursorPosition: " ~ std.conv.to!string(this.cursorPosition) ~ ")"; 1191 } 1192 1193 } 1194 1195 class UseItem : Java210Packet 1196 { 1197 1198 enum uint ID = 29; 1199 1200 enum bool CLIENTBOUND = false; 1201 enum bool SERVERBOUND = true; 1202 1203 // hand 1204 enum uint MAIN_HAND = 0; 1205 enum uint OFF_HAND = 1; 1206 1207 enum string[] __fields = ["hand"]; 1208 1209 @Var uint hand; 1210 1211 this() pure nothrow @safe @nogc {} 1212 1213 this(uint hand) pure nothrow @safe @nogc 1214 { 1215 this.hand = hand; 1216 } 1217 1218 mixin Make; 1219 1220 public static typeof(this) fromBuffer(ubyte[] buffer) 1221 { 1222 UseItem ret = new UseItem(); 1223 ret.decode(buffer); 1224 return ret; 1225 } 1226 1227 override string toString() 1228 { 1229 return "UseItem(hand: " ~ std.conv.to!string(this.hand) ~ ")"; 1230 } 1231 1232 }