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