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