1 /* 2 * This file was automatically generated by sel-utils and 3 * released under the MIT License. 4 * 5 * License: https://github.com/sel-project/sel-utils/blob/master/LICENSE 6 * Repository: https://github.com/sel-project/sel-utils 7 * Generated from https://github.com/sel-project/sel-utils/blob/master/xml/protocol/java335.xml 8 */ 9 module sul.protocol.java335.clientbound; 10 11 import std.bitmanip : write, peek; 12 static import std.conv; 13 import std.system : Endian; 14 import std.typetuple : TypeTuple; 15 import std.typecons : Tuple; 16 import std.uuid : UUID; 17 18 import sul.utils.buffer; 19 import sul.utils.var; 20 21 static import sul.protocol.java335.types; 22 23 static if(__traits(compiles, { import sul.metadata.java335; })) import sul.metadata.java335; 24 25 alias Packets = TypeTuple!(SpawnObject, SpawnExperienceOrb, SpawnGlobalEntity, SpawnMob, SpawnPainting, SpawnPlayer, Animation, Statistics, BlockBreakAnimation, UpdateBlockEntity, BlockAction, BlockChange, BossBar, ServerDifficulty, TabComplete, ChatMessage, MultiBlockChange, ConfirmTransaction, CloseWindow, OpenWindow, WindowItems, WindowProperty, SetSlot, SetCooldown, PluginMessage, NamedSoundEffect, Disconnect, EntityStatus, Explosion, UnloadChunk, ChangeGameState, KeepAlive, ChunkData, Effect, Particle, JoinGame, Map, Entity, EntityRelativeMove, EntityLookAndRelativeMove, EntityLook, VehicleMove, OpenSignEditor, PlayerAbilities, CombatEvent, PlayerListItem, PlayerPositionAndLook, UseBed, UnlockRecipes, DestroyEntities, RemoveEntityEffect, ResourcePackSend, Respawn, EntityHeadLook, AdvancementProgress, WorldBorder, Camera, HeldItemChange, DisplayScoreboard, EntityMetadata, AttachEntity, EntityVelocity, EntityEquipment, SetExperience, UpdateHealth, ScoreboardObjective, SetPassengers, Teams, UpdateScore, SpawnPosition, TimeUpdate, Title, SoundEffect, PlayerListHeaderAndFooter, CollectItem, EntityTeleport, Advencements, EntityProperties, EntityEffect); 26 27 class SpawnObject : Buffer { 28 29 public enum uint ID = 0; 30 31 public enum bool CLIENTBOUND = true; 32 public enum bool SERVERBOUND = false; 33 34 public enum string[] FIELDS = ["entityId", "uuid", "type", "position", "pitch", "yaw", "data", "velocity"]; 35 36 public uint entityId; 37 public UUID uuid; 38 public ubyte type; 39 public Tuple!(double, "x", double, "y", double, "z") position; 40 public ubyte pitch; 41 public ubyte yaw; 42 public int data; 43 public Tuple!(short, "x", short, "y", short, "z") velocity; 44 45 public pure nothrow @safe @nogc this() {} 46 47 public pure nothrow @safe @nogc this(uint entityId, UUID uuid=UUID.init, ubyte type=ubyte.init, Tuple!(double, "x", double, "y", double, "z") position=Tuple!(double, "x", double, "y", double, "z").init, ubyte pitch=ubyte.init, ubyte yaw=ubyte.init, int data=int.init, Tuple!(short, "x", short, "y", short, "z") velocity=Tuple!(short, "x", short, "y", short, "z").init) { 48 this.entityId = entityId; 49 this.uuid = uuid; 50 this.type = type; 51 this.position = position; 52 this.pitch = pitch; 53 this.yaw = yaw; 54 this.data = data; 55 this.velocity = velocity; 56 } 57 58 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 59 _buffer.length = 0; 60 static if(writeId){ writeBytes(varuint.encode(ID)); } 61 writeBytes(varuint.encode(entityId)); 62 writeBytes(uuid.data); 63 writeBigEndianUbyte(type); 64 writeBigEndianDouble(position.x); writeBigEndianDouble(position.y); writeBigEndianDouble(position.z); 65 writeBigEndianUbyte(pitch); 66 writeBigEndianUbyte(yaw); 67 writeBigEndianInt(data); 68 writeBigEndianShort(velocity.x); writeBigEndianShort(velocity.y); writeBigEndianShort(velocity.z); 69 return _buffer; 70 } 71 72 public pure nothrow @safe void decode(bool readId=true)() { 73 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 74 entityId=varuint.decode(_buffer, &_index); 75 if(_buffer.length>=_index+16){ ubyte[16] dvz=_buffer[_index.._index+16].dup; _index+=16; uuid=UUID(dvz); } 76 type=readBigEndianUbyte(); 77 position.x=readBigEndianDouble(); position.y=readBigEndianDouble(); position.z=readBigEndianDouble(); 78 pitch=readBigEndianUbyte(); 79 yaw=readBigEndianUbyte(); 80 data=readBigEndianInt(); 81 velocity.x=readBigEndianShort(); velocity.y=readBigEndianShort(); velocity.z=readBigEndianShort(); 82 } 83 84 public static pure nothrow @safe SpawnObject fromBuffer(bool readId=true)(ubyte[] buffer) { 85 SpawnObject ret = new SpawnObject(); 86 ret._buffer = buffer; 87 ret.decode!readId(); 88 return ret; 89 } 90 91 public override string toString() { 92 return "SpawnObject(entityId: " ~ std.conv.to!string(this.entityId) ~ ", uuid: " ~ std.conv.to!string(this.uuid) ~ ", type: " ~ std.conv.to!string(this.type) ~ ", position: " ~ std.conv.to!string(this.position) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ", yaw: " ~ std.conv.to!string(this.yaw) ~ ", data: " ~ std.conv.to!string(this.data) ~ ", velocity: " ~ std.conv.to!string(this.velocity) ~ ")"; 93 } 94 95 } 96 97 class SpawnExperienceOrb : Buffer { 98 99 public enum uint ID = 1; 100 101 public enum bool CLIENTBOUND = true; 102 public enum bool SERVERBOUND = false; 103 104 public enum string[] FIELDS = ["entityId", "position", "count"]; 105 106 public uint entityId; 107 public Tuple!(double, "x", double, "y", double, "z") position; 108 public ushort count; 109 110 public pure nothrow @safe @nogc this() {} 111 112 public pure nothrow @safe @nogc this(uint entityId, Tuple!(double, "x", double, "y", double, "z") position=Tuple!(double, "x", double, "y", double, "z").init, ushort count=ushort.init) { 113 this.entityId = entityId; 114 this.position = position; 115 this.count = count; 116 } 117 118 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 119 _buffer.length = 0; 120 static if(writeId){ writeBytes(varuint.encode(ID)); } 121 writeBytes(varuint.encode(entityId)); 122 writeBigEndianDouble(position.x); writeBigEndianDouble(position.y); writeBigEndianDouble(position.z); 123 writeBigEndianUshort(count); 124 return _buffer; 125 } 126 127 public pure nothrow @safe void decode(bool readId=true)() { 128 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 129 entityId=varuint.decode(_buffer, &_index); 130 position.x=readBigEndianDouble(); position.y=readBigEndianDouble(); position.z=readBigEndianDouble(); 131 count=readBigEndianUshort(); 132 } 133 134 public static pure nothrow @safe SpawnExperienceOrb fromBuffer(bool readId=true)(ubyte[] buffer) { 135 SpawnExperienceOrb ret = new SpawnExperienceOrb(); 136 ret._buffer = buffer; 137 ret.decode!readId(); 138 return ret; 139 } 140 141 public override string toString() { 142 return "SpawnExperienceOrb(entityId: " ~ std.conv.to!string(this.entityId) ~ ", position: " ~ std.conv.to!string(this.position) ~ ", count: " ~ std.conv.to!string(this.count) ~ ")"; 143 } 144 145 } 146 147 class SpawnGlobalEntity : Buffer { 148 149 public enum uint ID = 2; 150 151 public enum bool CLIENTBOUND = true; 152 public enum bool SERVERBOUND = false; 153 154 // type 155 public enum ubyte THUNDERBOLT = 1; 156 157 public enum string[] FIELDS = ["entityId", "type", "position"]; 158 159 public uint entityId; 160 public ubyte type; 161 public Tuple!(double, "x", double, "y", double, "z") position; 162 163 public pure nothrow @safe @nogc this() {} 164 165 public pure nothrow @safe @nogc this(uint entityId, ubyte type=ubyte.init, Tuple!(double, "x", double, "y", double, "z") position=Tuple!(double, "x", double, "y", double, "z").init) { 166 this.entityId = entityId; 167 this.type = type; 168 this.position = position; 169 } 170 171 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 172 _buffer.length = 0; 173 static if(writeId){ writeBytes(varuint.encode(ID)); } 174 writeBytes(varuint.encode(entityId)); 175 writeBigEndianUbyte(type); 176 writeBigEndianDouble(position.x); writeBigEndianDouble(position.y); writeBigEndianDouble(position.z); 177 return _buffer; 178 } 179 180 public pure nothrow @safe void decode(bool readId=true)() { 181 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 182 entityId=varuint.decode(_buffer, &_index); 183 type=readBigEndianUbyte(); 184 position.x=readBigEndianDouble(); position.y=readBigEndianDouble(); position.z=readBigEndianDouble(); 185 } 186 187 public static pure nothrow @safe SpawnGlobalEntity fromBuffer(bool readId=true)(ubyte[] buffer) { 188 SpawnGlobalEntity ret = new SpawnGlobalEntity(); 189 ret._buffer = buffer; 190 ret.decode!readId(); 191 return ret; 192 } 193 194 public override string toString() { 195 return "SpawnGlobalEntity(entityId: " ~ std.conv.to!string(this.entityId) ~ ", type: " ~ std.conv.to!string(this.type) ~ ", position: " ~ std.conv.to!string(this.position) ~ ")"; 196 } 197 198 } 199 200 class SpawnMob : Buffer { 201 202 public enum uint ID = 3; 203 204 public enum bool CLIENTBOUND = true; 205 public enum bool SERVERBOUND = false; 206 207 public enum string[] FIELDS = ["entityId", "uuid", "type", "position", "yaw", "pitch", "headPitch", "velocity", "metadata"]; 208 209 public uint entityId; 210 public UUID uuid; 211 public uint type; 212 public Tuple!(double, "x", double, "y", double, "z") position; 213 public ubyte yaw; 214 public ubyte pitch; 215 public ubyte headPitch; 216 public Tuple!(short, "x", short, "y", short, "z") velocity; 217 public Metadata metadata; 218 219 public pure nothrow @safe @nogc this() {} 220 221 public pure nothrow @safe @nogc this(uint entityId, UUID uuid=UUID.init, uint type=uint.init, Tuple!(double, "x", double, "y", double, "z") position=Tuple!(double, "x", double, "y", double, "z").init, ubyte yaw=ubyte.init, ubyte pitch=ubyte.init, ubyte headPitch=ubyte.init, Tuple!(short, "x", short, "y", short, "z") velocity=Tuple!(short, "x", short, "y", short, "z").init, Metadata metadata=Metadata.init) { 222 this.entityId = entityId; 223 this.uuid = uuid; 224 this.type = type; 225 this.position = position; 226 this.yaw = yaw; 227 this.pitch = pitch; 228 this.headPitch = headPitch; 229 this.velocity = velocity; 230 this.metadata = metadata; 231 } 232 233 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 234 _buffer.length = 0; 235 static if(writeId){ writeBytes(varuint.encode(ID)); } 236 writeBytes(varuint.encode(entityId)); 237 writeBytes(uuid.data); 238 writeBytes(varuint.encode(type)); 239 writeBigEndianDouble(position.x); writeBigEndianDouble(position.y); writeBigEndianDouble(position.z); 240 writeBigEndianUbyte(yaw); 241 writeBigEndianUbyte(pitch); 242 writeBigEndianUbyte(headPitch); 243 writeBigEndianShort(velocity.x); writeBigEndianShort(velocity.y); writeBigEndianShort(velocity.z); 244 metadata.encode(bufferInstance); 245 return _buffer; 246 } 247 248 public pure nothrow @safe void decode(bool readId=true)() { 249 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 250 entityId=varuint.decode(_buffer, &_index); 251 if(_buffer.length>=_index+16){ ubyte[16] dvz=_buffer[_index.._index+16].dup; _index+=16; uuid=UUID(dvz); } 252 type=varuint.decode(_buffer, &_index); 253 position.x=readBigEndianDouble(); position.y=readBigEndianDouble(); position.z=readBigEndianDouble(); 254 yaw=readBigEndianUbyte(); 255 pitch=readBigEndianUbyte(); 256 headPitch=readBigEndianUbyte(); 257 velocity.x=readBigEndianShort(); velocity.y=readBigEndianShort(); velocity.z=readBigEndianShort(); 258 metadata=Metadata.decode(bufferInstance); 259 } 260 261 public static pure nothrow @safe SpawnMob fromBuffer(bool readId=true)(ubyte[] buffer) { 262 SpawnMob ret = new SpawnMob(); 263 ret._buffer = buffer; 264 ret.decode!readId(); 265 return ret; 266 } 267 268 public override string toString() { 269 return "SpawnMob(entityId: " ~ std.conv.to!string(this.entityId) ~ ", uuid: " ~ std.conv.to!string(this.uuid) ~ ", type: " ~ std.conv.to!string(this.type) ~ ", position: " ~ std.conv.to!string(this.position) ~ ", yaw: " ~ std.conv.to!string(this.yaw) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ", headPitch: " ~ std.conv.to!string(this.headPitch) ~ ", velocity: " ~ std.conv.to!string(this.velocity) ~ ", metadata: " ~ std.conv.to!string(this.metadata) ~ ")"; 270 } 271 272 } 273 274 class SpawnPainting : Buffer { 275 276 public enum uint ID = 4; 277 278 public enum bool CLIENTBOUND = true; 279 public enum bool SERVERBOUND = false; 280 281 // direction 282 public enum ubyte SOUTH = 0; 283 public enum ubyte WEST = 1; 284 public enum ubyte NORTH = 2; 285 public enum ubyte EAST = 3; 286 287 public enum string[] FIELDS = ["entityId", "uuid", "title", "position", "direction"]; 288 289 public uint entityId; 290 public UUID uuid; 291 public string title; 292 public ulong position; 293 public ubyte direction; 294 295 public pure nothrow @safe @nogc this() {} 296 297 public pure nothrow @safe @nogc this(uint entityId, UUID uuid=UUID.init, string title=string.init, ulong position=ulong.init, ubyte direction=ubyte.init) { 298 this.entityId = entityId; 299 this.uuid = uuid; 300 this.title = title; 301 this.position = position; 302 this.direction = direction; 303 } 304 305 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 306 _buffer.length = 0; 307 static if(writeId){ writeBytes(varuint.encode(ID)); } 308 writeBytes(varuint.encode(entityId)); 309 writeBytes(uuid.data); 310 writeBytes(varuint.encode(cast(uint)title.length)); writeString(title); 311 writeBigEndianUlong(position); 312 writeBigEndianUbyte(direction); 313 return _buffer; 314 } 315 316 public pure nothrow @safe void decode(bool readId=true)() { 317 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 318 entityId=varuint.decode(_buffer, &_index); 319 if(_buffer.length>=_index+16){ ubyte[16] dvz=_buffer[_index.._index+16].dup; _index+=16; uuid=UUID(dvz); } 320 uint dlbu=varuint.decode(_buffer, &_index); title=readString(dlbu); 321 position=readBigEndianUlong(); 322 direction=readBigEndianUbyte(); 323 } 324 325 public static pure nothrow @safe SpawnPainting fromBuffer(bool readId=true)(ubyte[] buffer) { 326 SpawnPainting ret = new SpawnPainting(); 327 ret._buffer = buffer; 328 ret.decode!readId(); 329 return ret; 330 } 331 332 public override string toString() { 333 return "SpawnPainting(entityId: " ~ std.conv.to!string(this.entityId) ~ ", uuid: " ~ std.conv.to!string(this.uuid) ~ ", title: " ~ std.conv.to!string(this.title) ~ ", position: " ~ std.conv.to!string(this.position) ~ ", direction: " ~ std.conv.to!string(this.direction) ~ ")"; 334 } 335 336 } 337 338 class SpawnPlayer : Buffer { 339 340 public enum uint ID = 5; 341 342 public enum bool CLIENTBOUND = true; 343 public enum bool SERVERBOUND = false; 344 345 public enum string[] FIELDS = ["entityId", "uuid", "position", "yaw", "pitch", "metadata"]; 346 347 public uint entityId; 348 public UUID uuid; 349 public Tuple!(double, "x", double, "y", double, "z") position; 350 public ubyte yaw; 351 public ubyte pitch; 352 public Metadata metadata; 353 354 public pure nothrow @safe @nogc this() {} 355 356 public pure nothrow @safe @nogc this(uint entityId, UUID uuid=UUID.init, Tuple!(double, "x", double, "y", double, "z") position=Tuple!(double, "x", double, "y", double, "z").init, ubyte yaw=ubyte.init, ubyte pitch=ubyte.init, Metadata metadata=Metadata.init) { 357 this.entityId = entityId; 358 this.uuid = uuid; 359 this.position = position; 360 this.yaw = yaw; 361 this.pitch = pitch; 362 this.metadata = metadata; 363 } 364 365 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 366 _buffer.length = 0; 367 static if(writeId){ writeBytes(varuint.encode(ID)); } 368 writeBytes(varuint.encode(entityId)); 369 writeBytes(uuid.data); 370 writeBigEndianDouble(position.x); writeBigEndianDouble(position.y); writeBigEndianDouble(position.z); 371 writeBigEndianUbyte(yaw); 372 writeBigEndianUbyte(pitch); 373 metadata.encode(bufferInstance); 374 return _buffer; 375 } 376 377 public pure nothrow @safe void decode(bool readId=true)() { 378 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 379 entityId=varuint.decode(_buffer, &_index); 380 if(_buffer.length>=_index+16){ ubyte[16] dvz=_buffer[_index.._index+16].dup; _index+=16; uuid=UUID(dvz); } 381 position.x=readBigEndianDouble(); position.y=readBigEndianDouble(); position.z=readBigEndianDouble(); 382 yaw=readBigEndianUbyte(); 383 pitch=readBigEndianUbyte(); 384 metadata=Metadata.decode(bufferInstance); 385 } 386 387 public static pure nothrow @safe SpawnPlayer fromBuffer(bool readId=true)(ubyte[] buffer) { 388 SpawnPlayer ret = new SpawnPlayer(); 389 ret._buffer = buffer; 390 ret.decode!readId(); 391 return ret; 392 } 393 394 public override string toString() { 395 return "SpawnPlayer(entityId: " ~ std.conv.to!string(this.entityId) ~ ", uuid: " ~ std.conv.to!string(this.uuid) ~ ", position: " ~ std.conv.to!string(this.position) ~ ", yaw: " ~ std.conv.to!string(this.yaw) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ", metadata: " ~ std.conv.to!string(this.metadata) ~ ")"; 396 } 397 398 } 399 400 class Animation : Buffer { 401 402 public enum uint ID = 6; 403 404 public enum bool CLIENTBOUND = true; 405 public enum bool SERVERBOUND = false; 406 407 // animation 408 public enum ubyte SWING_MAIN_ARM = 0; 409 public enum ubyte TAKE_DAMAGE = 1; 410 public enum ubyte LEAVE_BED = 2; 411 public enum ubyte SWING_OFFHAND = 3; 412 public enum ubyte CRITICAL_EFFECT = 4; 413 public enum ubyte MAGICAL_CRITICAL_EFFECT = 5; 414 415 public enum string[] FIELDS = ["entityId", "animation"]; 416 417 public uint entityId; 418 public ubyte animation; 419 420 public pure nothrow @safe @nogc this() {} 421 422 public pure nothrow @safe @nogc this(uint entityId, ubyte animation=ubyte.init) { 423 this.entityId = entityId; 424 this.animation = animation; 425 } 426 427 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 428 _buffer.length = 0; 429 static if(writeId){ writeBytes(varuint.encode(ID)); } 430 writeBytes(varuint.encode(entityId)); 431 writeBigEndianUbyte(animation); 432 return _buffer; 433 } 434 435 public pure nothrow @safe void decode(bool readId=true)() { 436 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 437 entityId=varuint.decode(_buffer, &_index); 438 animation=readBigEndianUbyte(); 439 } 440 441 public static pure nothrow @safe Animation fromBuffer(bool readId=true)(ubyte[] buffer) { 442 Animation ret = new Animation(); 443 ret._buffer = buffer; 444 ret.decode!readId(); 445 return ret; 446 } 447 448 public override string toString() { 449 return "Animation(entityId: " ~ std.conv.to!string(this.entityId) ~ ", animation: " ~ std.conv.to!string(this.animation) ~ ")"; 450 } 451 452 } 453 454 class Statistics : Buffer { 455 456 public enum uint ID = 7; 457 458 public enum bool CLIENTBOUND = true; 459 public enum bool SERVERBOUND = false; 460 461 public enum string[] FIELDS = ["statistics"]; 462 463 public sul.protocol.java335.types.Statistic[] statistics; 464 465 public pure nothrow @safe @nogc this() {} 466 467 public pure nothrow @safe @nogc this(sul.protocol.java335.types.Statistic[] statistics) { 468 this.statistics = statistics; 469 } 470 471 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 472 _buffer.length = 0; 473 static if(writeId){ writeBytes(varuint.encode(ID)); } 474 writeBytes(varuint.encode(cast(uint)statistics.length)); foreach(crdldlc;statistics){ crdldlc.encode(bufferInstance); } 475 return _buffer; 476 } 477 478 public pure nothrow @safe void decode(bool readId=true)() { 479 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 480 statistics.length=varuint.decode(_buffer, &_index); foreach(ref crdldlc;statistics){ crdldlc.decode(bufferInstance); } 481 } 482 483 public static pure nothrow @safe Statistics fromBuffer(bool readId=true)(ubyte[] buffer) { 484 Statistics ret = new Statistics(); 485 ret._buffer = buffer; 486 ret.decode!readId(); 487 return ret; 488 } 489 490 public override string toString() { 491 return "Statistics(statistics: " ~ std.conv.to!string(this.statistics) ~ ")"; 492 } 493 494 } 495 496 class BlockBreakAnimation : Buffer { 497 498 public enum uint ID = 8; 499 500 public enum bool CLIENTBOUND = true; 501 public enum bool SERVERBOUND = false; 502 503 public enum string[] FIELDS = ["entityId", "position", "stage"]; 504 505 public uint entityId; 506 public ulong position; 507 public ubyte stage; 508 509 public pure nothrow @safe @nogc this() {} 510 511 public pure nothrow @safe @nogc this(uint entityId, ulong position=ulong.init, ubyte stage=ubyte.init) { 512 this.entityId = entityId; 513 this.position = position; 514 this.stage = stage; 515 } 516 517 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 518 _buffer.length = 0; 519 static if(writeId){ writeBytes(varuint.encode(ID)); } 520 writeBytes(varuint.encode(entityId)); 521 writeBigEndianUlong(position); 522 writeBigEndianUbyte(stage); 523 return _buffer; 524 } 525 526 public pure nothrow @safe void decode(bool readId=true)() { 527 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 528 entityId=varuint.decode(_buffer, &_index); 529 position=readBigEndianUlong(); 530 stage=readBigEndianUbyte(); 531 } 532 533 public static pure nothrow @safe BlockBreakAnimation fromBuffer(bool readId=true)(ubyte[] buffer) { 534 BlockBreakAnimation ret = new BlockBreakAnimation(); 535 ret._buffer = buffer; 536 ret.decode!readId(); 537 return ret; 538 } 539 540 public override string toString() { 541 return "BlockBreakAnimation(entityId: " ~ std.conv.to!string(this.entityId) ~ ", position: " ~ std.conv.to!string(this.position) ~ ", stage: " ~ std.conv.to!string(this.stage) ~ ")"; 542 } 543 544 } 545 546 class UpdateBlockEntity : Buffer { 547 548 public enum uint ID = 9; 549 550 public enum bool CLIENTBOUND = true; 551 public enum bool SERVERBOUND = false; 552 553 // action 554 public enum ubyte MOB_SPAWNER_DATA = 1; 555 public enum ubyte COMMAND_BLOCK_TEXT = 2; 556 public enum ubyte BEACON_POWERS = 3; 557 public enum ubyte MOB_HEAD_DATA = 4; 558 public enum ubyte FLOWER_POT_FLOWER = 5; 559 public enum ubyte BANNER_DATA = 6; 560 public enum ubyte STRUCTURE_DATA = 7; 561 public enum ubyte END_GATEWAY_DESTINATION = 8; 562 public enum ubyte SIGN_TEXT = 9; 563 public enum ubyte SHULKER_BOX_DECLARATION = 10; 564 public enum ubyte BED_COLOR = 11; 565 566 public enum string[] FIELDS = ["position", "action", "nbt"]; 567 568 public ulong position; 569 public ubyte action; 570 public ubyte[] nbt; 571 572 public pure nothrow @safe @nogc this() {} 573 574 public pure nothrow @safe @nogc this(ulong position, ubyte action=ubyte.init, ubyte[] nbt=(ubyte[]).init) { 575 this.position = position; 576 this.action = action; 577 this.nbt = nbt; 578 } 579 580 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 581 _buffer.length = 0; 582 static if(writeId){ writeBytes(varuint.encode(ID)); } 583 writeBigEndianUlong(position); 584 writeBigEndianUbyte(action); 585 writeBytes(nbt); 586 return _buffer; 587 } 588 589 public pure nothrow @safe void decode(bool readId=true)() { 590 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 591 position=readBigEndianUlong(); 592 action=readBigEndianUbyte(); 593 nbt=_buffer[_index..$].dup; _index=_buffer.length; 594 } 595 596 public static pure nothrow @safe UpdateBlockEntity fromBuffer(bool readId=true)(ubyte[] buffer) { 597 UpdateBlockEntity ret = new UpdateBlockEntity(); 598 ret._buffer = buffer; 599 ret.decode!readId(); 600 return ret; 601 } 602 603 public override string toString() { 604 return "UpdateBlockEntity(position: " ~ std.conv.to!string(this.position) ~ ", action: " ~ std.conv.to!string(this.action) ~ ", nbt: " ~ std.conv.to!string(this.nbt) ~ ")"; 605 } 606 607 } 608 609 class BlockAction : Buffer { 610 611 public enum uint ID = 10; 612 613 public enum bool CLIENTBOUND = true; 614 public enum bool SERVERBOUND = false; 615 616 // action 617 public enum ubyte NOTE_BLOCK_HARP = 0; 618 public enum ubyte NOTE_BLOCK_BASS_DRUM = 1; 619 public enum ubyte NOTE_BLOCK_SNARE_DRUM = 2; 620 public enum ubyte NOTE_BLOCK_CLICKS = 3; 621 public enum ubyte NOTE_BLOCK_STICKS = 3; 622 public enum ubyte NOTE_BLOCK_BASS_GUITAR = 4; 623 public enum ubyte PISTON_EXTEND = 0; 624 public enum ubyte PISTON_RETRACT = 1; 625 public enum ubyte CHEST_WATCHERS = 1; 626 public enum ubyte BEACON_RECALCULATE = 1; 627 public enum ubyte MOB_SPAWNER_RESET_DELAY = 1; 628 public enum ubyte END_GATEWAY_YELLOW_BEAM = 1; 629 630 // parameter 631 public enum ubyte PISTON_DOWN = 0; 632 public enum ubyte PISTON_UP = 1; 633 public enum ubyte PISTON_SOUTH = 2; 634 public enum ubyte PISTON_WEST = 3; 635 public enum ubyte PISTON_NORTH = 4; 636 public enum ubyte PISTON_EAST = 5; 637 638 public enum string[] FIELDS = ["position", "action", "parameter", "blockType"]; 639 640 public ulong position; 641 public ubyte action; 642 public ubyte parameter; 643 public uint blockType; 644 645 public pure nothrow @safe @nogc this() {} 646 647 public pure nothrow @safe @nogc this(ulong position, ubyte action=ubyte.init, ubyte parameter=ubyte.init, uint blockType=uint.init) { 648 this.position = position; 649 this.action = action; 650 this.parameter = parameter; 651 this.blockType = blockType; 652 } 653 654 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 655 _buffer.length = 0; 656 static if(writeId){ writeBytes(varuint.encode(ID)); } 657 writeBigEndianUlong(position); 658 writeBigEndianUbyte(action); 659 writeBigEndianUbyte(parameter); 660 writeBytes(varuint.encode(blockType)); 661 return _buffer; 662 } 663 664 public pure nothrow @safe void decode(bool readId=true)() { 665 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 666 position=readBigEndianUlong(); 667 action=readBigEndianUbyte(); 668 parameter=readBigEndianUbyte(); 669 blockType=varuint.decode(_buffer, &_index); 670 } 671 672 public static pure nothrow @safe BlockAction fromBuffer(bool readId=true)(ubyte[] buffer) { 673 BlockAction ret = new BlockAction(); 674 ret._buffer = buffer; 675 ret.decode!readId(); 676 return ret; 677 } 678 679 public override string toString() { 680 return "BlockAction(position: " ~ std.conv.to!string(this.position) ~ ", action: " ~ std.conv.to!string(this.action) ~ ", parameter: " ~ std.conv.to!string(this.parameter) ~ ", blockType: " ~ std.conv.to!string(this.blockType) ~ ")"; 681 } 682 683 } 684 685 class BlockChange : Buffer { 686 687 public enum uint ID = 11; 688 689 public enum bool CLIENTBOUND = true; 690 public enum bool SERVERBOUND = false; 691 692 public enum string[] FIELDS = ["position", "block"]; 693 694 public ulong position; 695 public uint block; 696 697 public pure nothrow @safe @nogc this() {} 698 699 public pure nothrow @safe @nogc this(ulong position, uint block=uint.init) { 700 this.position = position; 701 this.block = block; 702 } 703 704 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 705 _buffer.length = 0; 706 static if(writeId){ writeBytes(varuint.encode(ID)); } 707 writeBigEndianUlong(position); 708 writeBytes(varuint.encode(block)); 709 return _buffer; 710 } 711 712 public pure nothrow @safe void decode(bool readId=true)() { 713 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 714 position=readBigEndianUlong(); 715 block=varuint.decode(_buffer, &_index); 716 } 717 718 public static pure nothrow @safe BlockChange fromBuffer(bool readId=true)(ubyte[] buffer) { 719 BlockChange ret = new BlockChange(); 720 ret._buffer = buffer; 721 ret.decode!readId(); 722 return ret; 723 } 724 725 public override string toString() { 726 return "BlockChange(position: " ~ std.conv.to!string(this.position) ~ ", block: " ~ std.conv.to!string(this.block) ~ ")"; 727 } 728 729 } 730 731 class BossBar : Buffer { 732 733 public enum uint ID = 12; 734 735 public enum bool CLIENTBOUND = true; 736 public enum bool SERVERBOUND = false; 737 738 public enum string[] FIELDS = ["uuid", "action"]; 739 740 public UUID uuid; 741 public uint action; 742 743 public pure nothrow @safe @nogc this() {} 744 745 public pure nothrow @safe @nogc this(UUID uuid, uint action=uint.init) { 746 this.uuid = uuid; 747 this.action = action; 748 } 749 750 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 751 _buffer.length = 0; 752 static if(writeId){ writeBytes(varuint.encode(ID)); } 753 writeBytes(uuid.data); 754 writeBytes(varuint.encode(action)); 755 return _buffer; 756 } 757 758 public pure nothrow @safe void decode(bool readId=true)() { 759 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 760 if(_buffer.length>=_index+16){ ubyte[16] dvz=_buffer[_index.._index+16].dup; _index+=16; uuid=UUID(dvz); } 761 action=varuint.decode(_buffer, &_index); 762 } 763 764 public static pure nothrow @safe BossBar fromBuffer(bool readId=true)(ubyte[] buffer) { 765 BossBar ret = new BossBar(); 766 ret._buffer = buffer; 767 ret.decode!readId(); 768 return ret; 769 } 770 771 public override string toString() { 772 return "BossBar(uuid: " ~ std.conv.to!string(this.uuid) ~ ", action: " ~ std.conv.to!string(this.action) ~ ")"; 773 } 774 775 alias _encode = encode; 776 777 enum string variantField = "action"; 778 779 alias Variants = TypeTuple!(Add, Remove, UpdateHealth, UpdateTitle, UpdateStyle, UpdateFlags); 780 781 public class Add { 782 783 public enum typeof(action) ACTION = 0; 784 785 // color 786 public enum uint PINK = 0; 787 public enum uint BLUE = 1; 788 public enum uint RED = 2; 789 public enum uint GREEN = 3; 790 public enum uint YELLOW = 4; 791 public enum uint PURPLE = 5; 792 public enum uint WHITE = 6; 793 794 // division 795 public enum uint NO_DIVISION = 0; 796 public enum uint SIX_NOTCHES = 1; 797 public enum uint TEN_NOTCHES = 2; 798 public enum uint TWELVE_NOTCHES = 3; 799 public enum uint TWENTY_NOTCHES = 4; 800 801 // flags 802 public enum ubyte DARK_SKY = 1; 803 public enum ubyte IS_DRAGON_BAR = 2; 804 805 public enum string[] FIELDS = ["title", "health", "color", "division", "flags"]; 806 807 public string title; 808 public float health; 809 public uint color; 810 public uint division; 811 public ubyte flags; 812 813 public pure nothrow @safe @nogc this() {} 814 815 public pure nothrow @safe @nogc this(string title, float health=float.init, uint color=uint.init, uint division=uint.init, ubyte flags=ubyte.init) { 816 this.title = title; 817 this.health = health; 818 this.color = color; 819 this.division = division; 820 this.flags = flags; 821 } 822 823 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 824 action = 0; 825 _encode!writeId(); 826 writeBytes(varuint.encode(cast(uint)title.length)); writeString(title); 827 writeBigEndianFloat(health); 828 writeBytes(varuint.encode(color)); 829 writeBytes(varuint.encode(division)); 830 writeBigEndianUbyte(flags); 831 return _buffer; 832 } 833 834 public pure nothrow @safe void decode() { 835 uint dlbu=varuint.decode(_buffer, &_index); title=readString(dlbu); 836 health=readBigEndianFloat(); 837 color=varuint.decode(_buffer, &_index); 838 division=varuint.decode(_buffer, &_index); 839 flags=readBigEndianUbyte(); 840 } 841 842 public override string toString() { 843 return "BossBar.Add(title: " ~ std.conv.to!string(this.title) ~ ", health: " ~ std.conv.to!string(this.health) ~ ", color: " ~ std.conv.to!string(this.color) ~ ", division: " ~ std.conv.to!string(this.division) ~ ", flags: " ~ std.conv.to!string(this.flags) ~ ")"; 844 } 845 846 } 847 848 public class Remove { 849 850 public enum typeof(action) ACTION = 1; 851 852 public enum string[] FIELDS = []; 853 854 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 855 action = 1; 856 _encode!writeId(); 857 return _buffer; 858 } 859 860 public pure nothrow @safe void decode() { 861 } 862 863 public override string toString() { 864 return "BossBar.Remove()"; 865 } 866 867 } 868 869 public class UpdateHealth { 870 871 public enum typeof(action) ACTION = 2; 872 873 public enum string[] FIELDS = ["health"]; 874 875 public float health; 876 877 public pure nothrow @safe @nogc this() {} 878 879 public pure nothrow @safe @nogc this(float health) { 880 this.health = health; 881 } 882 883 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 884 action = 2; 885 _encode!writeId(); 886 writeBigEndianFloat(health); 887 return _buffer; 888 } 889 890 public pure nothrow @safe void decode() { 891 health=readBigEndianFloat(); 892 } 893 894 public override string toString() { 895 return "BossBar.UpdateHealth(health: " ~ std.conv.to!string(this.health) ~ ")"; 896 } 897 898 } 899 900 public class UpdateTitle { 901 902 public enum typeof(action) ACTION = 3; 903 904 public enum string[] FIELDS = ["title"]; 905 906 public string title; 907 908 public pure nothrow @safe @nogc this() {} 909 910 public pure nothrow @safe @nogc this(string title) { 911 this.title = title; 912 } 913 914 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 915 action = 3; 916 _encode!writeId(); 917 writeBytes(varuint.encode(cast(uint)title.length)); writeString(title); 918 return _buffer; 919 } 920 921 public pure nothrow @safe void decode() { 922 uint dlbu=varuint.decode(_buffer, &_index); title=readString(dlbu); 923 } 924 925 public override string toString() { 926 return "BossBar.UpdateTitle(title: " ~ std.conv.to!string(this.title) ~ ")"; 927 } 928 929 } 930 931 public class UpdateStyle { 932 933 public enum typeof(action) ACTION = 4; 934 935 // color 936 public enum uint PINK = 0; 937 public enum uint BLUE = 1; 938 public enum uint RED = 2; 939 public enum uint GREEN = 3; 940 public enum uint YELLOW = 4; 941 public enum uint PURPLE = 5; 942 public enum uint WHITE = 6; 943 944 // division 945 public enum uint NO_DIVISION = 0; 946 public enum uint SIX_NOTCHES = 1; 947 public enum uint TEN_NOTCHES = 2; 948 public enum uint TWELVE_NOTCHES = 3; 949 public enum uint TWENTY_NOTCHES = 4; 950 951 public enum string[] FIELDS = ["color", "division"]; 952 953 public uint color; 954 public uint division; 955 956 public pure nothrow @safe @nogc this() {} 957 958 public pure nothrow @safe @nogc this(uint color, uint division=uint.init) { 959 this.color = color; 960 this.division = division; 961 } 962 963 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 964 action = 4; 965 _encode!writeId(); 966 writeBytes(varuint.encode(color)); 967 writeBytes(varuint.encode(division)); 968 return _buffer; 969 } 970 971 public pure nothrow @safe void decode() { 972 color=varuint.decode(_buffer, &_index); 973 division=varuint.decode(_buffer, &_index); 974 } 975 976 public override string toString() { 977 return "BossBar.UpdateStyle(color: " ~ std.conv.to!string(this.color) ~ ", division: " ~ std.conv.to!string(this.division) ~ ")"; 978 } 979 980 } 981 982 public class UpdateFlags { 983 984 public enum typeof(action) ACTION = 5; 985 986 // flags 987 public enum ubyte DARK_SKY = 1; 988 public enum ubyte IS_DRAGON_BAR = 2; 989 990 public enum string[] FIELDS = ["flags"]; 991 992 public ubyte flags; 993 994 public pure nothrow @safe @nogc this() {} 995 996 public pure nothrow @safe @nogc this(ubyte flags) { 997 this.flags = flags; 998 } 999 1000 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1001 action = 5; 1002 _encode!writeId(); 1003 writeBigEndianUbyte(flags); 1004 return _buffer; 1005 } 1006 1007 public pure nothrow @safe void decode() { 1008 flags=readBigEndianUbyte(); 1009 } 1010 1011 public override string toString() { 1012 return "BossBar.UpdateFlags(flags: " ~ std.conv.to!string(this.flags) ~ ")"; 1013 } 1014 1015 } 1016 1017 } 1018 1019 class ServerDifficulty : Buffer { 1020 1021 public enum uint ID = 13; 1022 1023 public enum bool CLIENTBOUND = true; 1024 public enum bool SERVERBOUND = false; 1025 1026 // difficulty 1027 public enum ubyte PEACEFUL = 0; 1028 public enum ubyte EASY = 1; 1029 public enum ubyte NORMAL = 2; 1030 public enum ubyte HARD = 3; 1031 1032 public enum string[] FIELDS = ["difficulty"]; 1033 1034 public ubyte difficulty; 1035 1036 public pure nothrow @safe @nogc this() {} 1037 1038 public pure nothrow @safe @nogc this(ubyte difficulty) { 1039 this.difficulty = difficulty; 1040 } 1041 1042 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1043 _buffer.length = 0; 1044 static if(writeId){ writeBytes(varuint.encode(ID)); } 1045 writeBigEndianUbyte(difficulty); 1046 return _buffer; 1047 } 1048 1049 public pure nothrow @safe void decode(bool readId=true)() { 1050 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1051 difficulty=readBigEndianUbyte(); 1052 } 1053 1054 public static pure nothrow @safe ServerDifficulty fromBuffer(bool readId=true)(ubyte[] buffer) { 1055 ServerDifficulty ret = new ServerDifficulty(); 1056 ret._buffer = buffer; 1057 ret.decode!readId(); 1058 return ret; 1059 } 1060 1061 public override string toString() { 1062 return "ServerDifficulty(difficulty: " ~ std.conv.to!string(this.difficulty) ~ ")"; 1063 } 1064 1065 } 1066 1067 class TabComplete : Buffer { 1068 1069 public enum uint ID = 14; 1070 1071 public enum bool CLIENTBOUND = true; 1072 public enum bool SERVERBOUND = false; 1073 1074 public enum string[] FIELDS = ["matches"]; 1075 1076 public string[] matches; 1077 1078 public pure nothrow @safe @nogc this() {} 1079 1080 public pure nothrow @safe @nogc this(string[] matches) { 1081 this.matches = matches; 1082 } 1083 1084 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1085 _buffer.length = 0; 1086 static if(writeId){ writeBytes(varuint.encode(ID)); } 1087 writeBytes(varuint.encode(cast(uint)matches.length)); foreach(bfyhc;matches){ writeBytes(varuint.encode(cast(uint)bfyhc.length)); writeString(bfyhc); } 1088 return _buffer; 1089 } 1090 1091 public pure nothrow @safe void decode(bool readId=true)() { 1092 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1093 matches.length=varuint.decode(_buffer, &_index); foreach(ref bfyhc;matches){ uint yzam=varuint.decode(_buffer, &_index); bfyhc=readString(yzam); } 1094 } 1095 1096 public static pure nothrow @safe TabComplete fromBuffer(bool readId=true)(ubyte[] buffer) { 1097 TabComplete ret = new TabComplete(); 1098 ret._buffer = buffer; 1099 ret.decode!readId(); 1100 return ret; 1101 } 1102 1103 public override string toString() { 1104 return "TabComplete(matches: " ~ std.conv.to!string(this.matches) ~ ")"; 1105 } 1106 1107 } 1108 1109 class ChatMessage : Buffer { 1110 1111 public enum uint ID = 15; 1112 1113 public enum bool CLIENTBOUND = true; 1114 public enum bool SERVERBOUND = false; 1115 1116 // position 1117 public enum ubyte CHAT = 0; 1118 public enum ubyte SYSTEM_MESSAGE = 1; 1119 public enum ubyte ABOVE_HOTBAR = 2; 1120 1121 public enum string[] FIELDS = ["message", "position"]; 1122 1123 public string message; 1124 public ubyte position; 1125 1126 public pure nothrow @safe @nogc this() {} 1127 1128 public pure nothrow @safe @nogc this(string message, ubyte position=ubyte.init) { 1129 this.message = message; 1130 this.position = position; 1131 } 1132 1133 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1134 _buffer.length = 0; 1135 static if(writeId){ writeBytes(varuint.encode(ID)); } 1136 writeBytes(varuint.encode(cast(uint)message.length)); writeString(message); 1137 writeBigEndianUbyte(position); 1138 return _buffer; 1139 } 1140 1141 public pure nothrow @safe void decode(bool readId=true)() { 1142 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1143 uint bvcfz=varuint.decode(_buffer, &_index); message=readString(bvcfz); 1144 position=readBigEndianUbyte(); 1145 } 1146 1147 public static pure nothrow @safe ChatMessage fromBuffer(bool readId=true)(ubyte[] buffer) { 1148 ChatMessage ret = new ChatMessage(); 1149 ret._buffer = buffer; 1150 ret.decode!readId(); 1151 return ret; 1152 } 1153 1154 public override string toString() { 1155 return "ChatMessage(message: " ~ std.conv.to!string(this.message) ~ ", position: " ~ std.conv.to!string(this.position) ~ ")"; 1156 } 1157 1158 } 1159 1160 class MultiBlockChange : Buffer { 1161 1162 public enum uint ID = 16; 1163 1164 public enum bool CLIENTBOUND = true; 1165 public enum bool SERVERBOUND = false; 1166 1167 public enum string[] FIELDS = ["chunk", "changes"]; 1168 1169 public Tuple!(int, "x", int, "z") chunk; 1170 public sul.protocol.java335.types.BlockChange[] changes; 1171 1172 public pure nothrow @safe @nogc this() {} 1173 1174 public pure nothrow @safe @nogc this(Tuple!(int, "x", int, "z") chunk, sul.protocol.java335.types.BlockChange[] changes=(sul.protocol.java335.types.BlockChange[]).init) { 1175 this.chunk = chunk; 1176 this.changes = changes; 1177 } 1178 1179 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1180 _buffer.length = 0; 1181 static if(writeId){ writeBytes(varuint.encode(ID)); } 1182 writeBigEndianInt(chunk.x); writeBigEndianInt(chunk.z); 1183 writeBytes(varuint.encode(cast(uint)changes.length)); foreach(yhbdc;changes){ yhbdc.encode(bufferInstance); } 1184 return _buffer; 1185 } 1186 1187 public pure nothrow @safe void decode(bool readId=true)() { 1188 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1189 chunk.x=readBigEndianInt(); chunk.z=readBigEndianInt(); 1190 changes.length=varuint.decode(_buffer, &_index); foreach(ref yhbdc;changes){ yhbdc.decode(bufferInstance); } 1191 } 1192 1193 public static pure nothrow @safe MultiBlockChange fromBuffer(bool readId=true)(ubyte[] buffer) { 1194 MultiBlockChange ret = new MultiBlockChange(); 1195 ret._buffer = buffer; 1196 ret.decode!readId(); 1197 return ret; 1198 } 1199 1200 public override string toString() { 1201 return "MultiBlockChange(chunk: " ~ std.conv.to!string(this.chunk) ~ ", changes: " ~ std.conv.to!string(this.changes) ~ ")"; 1202 } 1203 1204 } 1205 1206 class ConfirmTransaction : Buffer { 1207 1208 public enum uint ID = 17; 1209 1210 public enum bool CLIENTBOUND = true; 1211 public enum bool SERVERBOUND = false; 1212 1213 public enum string[] FIELDS = ["window", "action", "accepted"]; 1214 1215 public ubyte window; 1216 public ushort action; 1217 public bool accepted; 1218 1219 public pure nothrow @safe @nogc this() {} 1220 1221 public pure nothrow @safe @nogc this(ubyte window, ushort action=ushort.init, bool accepted=bool.init) { 1222 this.window = window; 1223 this.action = action; 1224 this.accepted = accepted; 1225 } 1226 1227 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1228 _buffer.length = 0; 1229 static if(writeId){ writeBytes(varuint.encode(ID)); } 1230 writeBigEndianUbyte(window); 1231 writeBigEndianUshort(action); 1232 writeBigEndianBool(accepted); 1233 return _buffer; 1234 } 1235 1236 public pure nothrow @safe void decode(bool readId=true)() { 1237 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1238 window=readBigEndianUbyte(); 1239 action=readBigEndianUshort(); 1240 accepted=readBigEndianBool(); 1241 } 1242 1243 public static pure nothrow @safe ConfirmTransaction fromBuffer(bool readId=true)(ubyte[] buffer) { 1244 ConfirmTransaction ret = new ConfirmTransaction(); 1245 ret._buffer = buffer; 1246 ret.decode!readId(); 1247 return ret; 1248 } 1249 1250 public override string toString() { 1251 return "ConfirmTransaction(window: " ~ std.conv.to!string(this.window) ~ ", action: " ~ std.conv.to!string(this.action) ~ ", accepted: " ~ std.conv.to!string(this.accepted) ~ ")"; 1252 } 1253 1254 } 1255 1256 class CloseWindow : Buffer { 1257 1258 public enum uint ID = 18; 1259 1260 public enum bool CLIENTBOUND = true; 1261 public enum bool SERVERBOUND = false; 1262 1263 public enum string[] FIELDS = ["window"]; 1264 1265 public ubyte window; 1266 1267 public pure nothrow @safe @nogc this() {} 1268 1269 public pure nothrow @safe @nogc this(ubyte window) { 1270 this.window = window; 1271 } 1272 1273 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1274 _buffer.length = 0; 1275 static if(writeId){ writeBytes(varuint.encode(ID)); } 1276 writeBigEndianUbyte(window); 1277 return _buffer; 1278 } 1279 1280 public pure nothrow @safe void decode(bool readId=true)() { 1281 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1282 window=readBigEndianUbyte(); 1283 } 1284 1285 public static pure nothrow @safe CloseWindow fromBuffer(bool readId=true)(ubyte[] buffer) { 1286 CloseWindow ret = new CloseWindow(); 1287 ret._buffer = buffer; 1288 ret.decode!readId(); 1289 return ret; 1290 } 1291 1292 public override string toString() { 1293 return "CloseWindow(window: " ~ std.conv.to!string(this.window) ~ ")"; 1294 } 1295 1296 } 1297 1298 class OpenWindow : Buffer { 1299 1300 public enum uint ID = 19; 1301 1302 public enum bool CLIENTBOUND = true; 1303 public enum bool SERVERBOUND = false; 1304 1305 public enum string[] FIELDS = ["window", "type", "title", "slots"]; 1306 1307 public ubyte window; 1308 public string type; 1309 public string title; 1310 public ubyte slots; 1311 1312 public pure nothrow @safe @nogc this() {} 1313 1314 public pure nothrow @safe @nogc this(ubyte window, string type=string.init, string title=string.init, ubyte slots=ubyte.init) { 1315 this.window = window; 1316 this.type = type; 1317 this.title = title; 1318 this.slots = slots; 1319 } 1320 1321 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1322 _buffer.length = 0; 1323 static if(writeId){ writeBytes(varuint.encode(ID)); } 1324 writeBigEndianUbyte(window); 1325 writeBytes(varuint.encode(cast(uint)type.length)); writeString(type); 1326 writeBytes(varuint.encode(cast(uint)title.length)); writeString(title); 1327 writeBigEndianUbyte(slots); 1328 return _buffer; 1329 } 1330 1331 public pure nothrow @safe void decode(bool readId=true)() { 1332 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1333 window=readBigEndianUbyte(); 1334 uint dlz=varuint.decode(_buffer, &_index); type=readString(dlz); 1335 uint dlbu=varuint.decode(_buffer, &_index); title=readString(dlbu); 1336 slots=readBigEndianUbyte(); 1337 } 1338 1339 public static pure nothrow @safe OpenWindow fromBuffer(bool readId=true)(ubyte[] buffer) { 1340 OpenWindow ret = new OpenWindow(); 1341 ret._buffer = buffer; 1342 ret.decode!readId(); 1343 return ret; 1344 } 1345 1346 public override string toString() { 1347 return "OpenWindow(window: " ~ std.conv.to!string(this.window) ~ ", type: " ~ std.conv.to!string(this.type) ~ ", title: " ~ std.conv.to!string(this.title) ~ ", slots: " ~ std.conv.to!string(this.slots) ~ ")"; 1348 } 1349 1350 } 1351 1352 class WindowItems : Buffer { 1353 1354 public enum uint ID = 20; 1355 1356 public enum bool CLIENTBOUND = true; 1357 public enum bool SERVERBOUND = false; 1358 1359 public enum string[] FIELDS = ["window", "slots"]; 1360 1361 public ubyte window; 1362 public sul.protocol.java335.types.Slot[] slots; 1363 1364 public pure nothrow @safe @nogc this() {} 1365 1366 public pure nothrow @safe @nogc this(ubyte window, sul.protocol.java335.types.Slot[] slots=(sul.protocol.java335.types.Slot[]).init) { 1367 this.window = window; 1368 this.slots = slots; 1369 } 1370 1371 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1372 _buffer.length = 0; 1373 static if(writeId){ writeBytes(varuint.encode(ID)); } 1374 writeBigEndianUbyte(window); 1375 writeBigEndianUshort(cast(ushort)slots.length); foreach(cxdm;slots){ cxdm.encode(bufferInstance); } 1376 return _buffer; 1377 } 1378 1379 public pure nothrow @safe void decode(bool readId=true)() { 1380 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1381 window=readBigEndianUbyte(); 1382 slots.length=readBigEndianUshort(); foreach(ref cxdm;slots){ cxdm.decode(bufferInstance); } 1383 } 1384 1385 public static pure nothrow @safe WindowItems fromBuffer(bool readId=true)(ubyte[] buffer) { 1386 WindowItems ret = new WindowItems(); 1387 ret._buffer = buffer; 1388 ret.decode!readId(); 1389 return ret; 1390 } 1391 1392 public override string toString() { 1393 return "WindowItems(window: " ~ std.conv.to!string(this.window) ~ ", slots: " ~ std.conv.to!string(this.slots) ~ ")"; 1394 } 1395 1396 } 1397 1398 class WindowProperty : Buffer { 1399 1400 public enum uint ID = 21; 1401 1402 public enum bool CLIENTBOUND = true; 1403 public enum bool SERVERBOUND = false; 1404 1405 // property 1406 public enum ushort FURNANCE_FIRE_ICON = 0; 1407 public enum ushort FURNACE_MAX_FUEL_BURN_TIME = 1; 1408 public enum ushort FURNACE_PROGRESS_ARROW = 2; 1409 public enum ushort FURNCE_MAX_PROGRESS = 3; 1410 public enum ushort ENCHANTMENT_LEVEL_REQUIREMENT_TOP = 0; 1411 public enum ushort ENCHANTMENT_LEVEL_REQUIREMENT_MIDDLE = 1; 1412 public enum ushort ENCHANTMENT_LEVEL_REQUIREMENT_BOTTOM = 2; 1413 public enum ushort ENCHANTMENT_SEED = 3; 1414 public enum ushort ENCHANTMENT_ID_TOP = 4; 1415 public enum ushort ENCHANTMENT_ID_MIDDLE = 5; 1416 public enum ushort ENCHANTMENT_ID_BOTTOM = 6; 1417 public enum ushort ENCHANTMENT_LEVEL_TOP = 7; 1418 public enum ushort ENCHANTMENT_LEVEL_MIDDLE = 8; 1419 public enum ushort ENCHANTMENT_LEVEL_BOTTOM = 9; 1420 public enum ushort BEACON_POWER_LEVEL = 0; 1421 public enum ushort BEACON_FIRST_EFFECT = 1; 1422 public enum ushort BEACON_SECOND_EFFECT = 2; 1423 public enum ushort ANVIL_REPAIR_COST = 0; 1424 public enum ushort BREWING_STAND_BREW_TIME = 0; 1425 1426 public enum string[] FIELDS = ["window", "property", "value"]; 1427 1428 public ubyte window; 1429 public ushort property; 1430 public short value; 1431 1432 public pure nothrow @safe @nogc this() {} 1433 1434 public pure nothrow @safe @nogc this(ubyte window, ushort property=ushort.init, short value=short.init) { 1435 this.window = window; 1436 this.property = property; 1437 this.value = value; 1438 } 1439 1440 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1441 _buffer.length = 0; 1442 static if(writeId){ writeBytes(varuint.encode(ID)); } 1443 writeBigEndianUbyte(window); 1444 writeBigEndianUshort(property); 1445 writeBigEndianShort(value); 1446 return _buffer; 1447 } 1448 1449 public pure nothrow @safe void decode(bool readId=true)() { 1450 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1451 window=readBigEndianUbyte(); 1452 property=readBigEndianUshort(); 1453 value=readBigEndianShort(); 1454 } 1455 1456 public static pure nothrow @safe WindowProperty fromBuffer(bool readId=true)(ubyte[] buffer) { 1457 WindowProperty ret = new WindowProperty(); 1458 ret._buffer = buffer; 1459 ret.decode!readId(); 1460 return ret; 1461 } 1462 1463 public override string toString() { 1464 return "WindowProperty(window: " ~ std.conv.to!string(this.window) ~ ", property: " ~ std.conv.to!string(this.property) ~ ", value: " ~ std.conv.to!string(this.value) ~ ")"; 1465 } 1466 1467 } 1468 1469 class SetSlot : Buffer { 1470 1471 public enum uint ID = 22; 1472 1473 public enum bool CLIENTBOUND = true; 1474 public enum bool SERVERBOUND = false; 1475 1476 public enum string[] FIELDS = ["window", "slot", "item"]; 1477 1478 public ubyte window; 1479 public ushort slot; 1480 public sul.protocol.java335.types.Slot item; 1481 1482 public pure nothrow @safe @nogc this() {} 1483 1484 public pure nothrow @safe @nogc this(ubyte window, ushort slot=ushort.init, sul.protocol.java335.types.Slot item=sul.protocol.java335.types.Slot.init) { 1485 this.window = window; 1486 this.slot = slot; 1487 this.item = item; 1488 } 1489 1490 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1491 _buffer.length = 0; 1492 static if(writeId){ writeBytes(varuint.encode(ID)); } 1493 writeBigEndianUbyte(window); 1494 writeBigEndianUshort(slot); 1495 item.encode(bufferInstance); 1496 return _buffer; 1497 } 1498 1499 public pure nothrow @safe void decode(bool readId=true)() { 1500 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1501 window=readBigEndianUbyte(); 1502 slot=readBigEndianUshort(); 1503 item.decode(bufferInstance); 1504 } 1505 1506 public static pure nothrow @safe SetSlot fromBuffer(bool readId=true)(ubyte[] buffer) { 1507 SetSlot ret = new SetSlot(); 1508 ret._buffer = buffer; 1509 ret.decode!readId(); 1510 return ret; 1511 } 1512 1513 public override string toString() { 1514 return "SetSlot(window: " ~ std.conv.to!string(this.window) ~ ", slot: " ~ std.conv.to!string(this.slot) ~ ", item: " ~ std.conv.to!string(this.item) ~ ")"; 1515 } 1516 1517 } 1518 1519 class SetCooldown : Buffer { 1520 1521 public enum uint ID = 23; 1522 1523 public enum bool CLIENTBOUND = true; 1524 public enum bool SERVERBOUND = false; 1525 1526 public enum string[] FIELDS = ["item", "cooldown"]; 1527 1528 public uint item; 1529 public uint cooldown; 1530 1531 public pure nothrow @safe @nogc this() {} 1532 1533 public pure nothrow @safe @nogc this(uint item, uint cooldown=uint.init) { 1534 this.item = item; 1535 this.cooldown = cooldown; 1536 } 1537 1538 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1539 _buffer.length = 0; 1540 static if(writeId){ writeBytes(varuint.encode(ID)); } 1541 writeBytes(varuint.encode(item)); 1542 writeBytes(varuint.encode(cooldown)); 1543 return _buffer; 1544 } 1545 1546 public pure nothrow @safe void decode(bool readId=true)() { 1547 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1548 item=varuint.decode(_buffer, &_index); 1549 cooldown=varuint.decode(_buffer, &_index); 1550 } 1551 1552 public static pure nothrow @safe SetCooldown fromBuffer(bool readId=true)(ubyte[] buffer) { 1553 SetCooldown ret = new SetCooldown(); 1554 ret._buffer = buffer; 1555 ret.decode!readId(); 1556 return ret; 1557 } 1558 1559 public override string toString() { 1560 return "SetCooldown(item: " ~ std.conv.to!string(this.item) ~ ", cooldown: " ~ std.conv.to!string(this.cooldown) ~ ")"; 1561 } 1562 1563 } 1564 1565 class PluginMessage : Buffer { 1566 1567 public enum uint ID = 24; 1568 1569 public enum bool CLIENTBOUND = true; 1570 public enum bool SERVERBOUND = false; 1571 1572 public enum string[] FIELDS = ["channel", "data"]; 1573 1574 public string channel; 1575 public ubyte[] data; 1576 1577 public pure nothrow @safe @nogc this() {} 1578 1579 public pure nothrow @safe @nogc this(string channel, ubyte[] data=(ubyte[]).init) { 1580 this.channel = channel; 1581 this.data = data; 1582 } 1583 1584 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1585 _buffer.length = 0; 1586 static if(writeId){ writeBytes(varuint.encode(ID)); } 1587 writeBytes(varuint.encode(cast(uint)channel.length)); writeString(channel); 1588 writeBytes(data); 1589 return _buffer; 1590 } 1591 1592 public pure nothrow @safe void decode(bool readId=true)() { 1593 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1594 uint yhb5b=varuint.decode(_buffer, &_index); channel=readString(yhb5b); 1595 data=_buffer[_index..$].dup; _index=_buffer.length; 1596 } 1597 1598 public static pure nothrow @safe PluginMessage fromBuffer(bool readId=true)(ubyte[] buffer) { 1599 PluginMessage ret = new PluginMessage(); 1600 ret._buffer = buffer; 1601 ret.decode!readId(); 1602 return ret; 1603 } 1604 1605 public override string toString() { 1606 return "PluginMessage(channel: " ~ std.conv.to!string(this.channel) ~ ", data: " ~ std.conv.to!string(this.data) ~ ")"; 1607 } 1608 1609 } 1610 1611 class NamedSoundEffect : Buffer { 1612 1613 public enum uint ID = 25; 1614 1615 public enum bool CLIENTBOUND = true; 1616 public enum bool SERVERBOUND = false; 1617 1618 public enum string[] FIELDS = ["name", "category", "position", "volume", "pitch"]; 1619 1620 public string name; 1621 public uint category; 1622 public Tuple!(int, "x", int, "y", int, "z") position; 1623 public float volume; 1624 public float pitch; 1625 1626 public pure nothrow @safe @nogc this() {} 1627 1628 public pure nothrow @safe @nogc this(string name, uint category=uint.init, Tuple!(int, "x", int, "y", int, "z") position=Tuple!(int, "x", int, "y", int, "z").init, float volume=float.init, float pitch=float.init) { 1629 this.name = name; 1630 this.category = category; 1631 this.position = position; 1632 this.volume = volume; 1633 this.pitch = pitch; 1634 } 1635 1636 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1637 _buffer.length = 0; 1638 static if(writeId){ writeBytes(varuint.encode(ID)); } 1639 writeBytes(varuint.encode(cast(uint)name.length)); writeString(name); 1640 writeBytes(varuint.encode(category)); 1641 writeBigEndianInt(position.x); writeBigEndianInt(position.y); writeBigEndianInt(position.z); 1642 writeBigEndianFloat(volume); 1643 writeBigEndianFloat(pitch); 1644 return _buffer; 1645 } 1646 1647 public pure nothrow @safe void decode(bool readId=true)() { 1648 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1649 uint bfz=varuint.decode(_buffer, &_index); name=readString(bfz); 1650 category=varuint.decode(_buffer, &_index); 1651 position.x=readBigEndianInt(); position.y=readBigEndianInt(); position.z=readBigEndianInt(); 1652 volume=readBigEndianFloat(); 1653 pitch=readBigEndianFloat(); 1654 } 1655 1656 public static pure nothrow @safe NamedSoundEffect fromBuffer(bool readId=true)(ubyte[] buffer) { 1657 NamedSoundEffect ret = new NamedSoundEffect(); 1658 ret._buffer = buffer; 1659 ret.decode!readId(); 1660 return ret; 1661 } 1662 1663 public override string toString() { 1664 return "NamedSoundEffect(name: " ~ std.conv.to!string(this.name) ~ ", category: " ~ std.conv.to!string(this.category) ~ ", position: " ~ std.conv.to!string(this.position) ~ ", volume: " ~ std.conv.to!string(this.volume) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ")"; 1665 } 1666 1667 } 1668 1669 class Disconnect : Buffer { 1670 1671 public enum uint ID = 26; 1672 1673 public enum bool CLIENTBOUND = true; 1674 public enum bool SERVERBOUND = false; 1675 1676 public enum string[] FIELDS = ["reason"]; 1677 1678 public string reason; 1679 1680 public pure nothrow @safe @nogc this() {} 1681 1682 public pure nothrow @safe @nogc this(string reason) { 1683 this.reason = reason; 1684 } 1685 1686 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1687 _buffer.length = 0; 1688 static if(writeId){ writeBytes(varuint.encode(ID)); } 1689 writeBytes(varuint.encode(cast(uint)reason.length)); writeString(reason); 1690 return _buffer; 1691 } 1692 1693 public pure nothrow @safe void decode(bool readId=true)() { 1694 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1695 uint cvc9=varuint.decode(_buffer, &_index); reason=readString(cvc9); 1696 } 1697 1698 public static pure nothrow @safe Disconnect fromBuffer(bool readId=true)(ubyte[] buffer) { 1699 Disconnect ret = new Disconnect(); 1700 ret._buffer = buffer; 1701 ret.decode!readId(); 1702 return ret; 1703 } 1704 1705 public override string toString() { 1706 return "Disconnect(reason: " ~ std.conv.to!string(this.reason) ~ ")"; 1707 } 1708 1709 } 1710 1711 class EntityStatus : Buffer { 1712 1713 public enum uint ID = 27; 1714 1715 public enum bool CLIENTBOUND = true; 1716 public enum bool SERVERBOUND = false; 1717 1718 // status 1719 public enum ubyte SPAWN_TIPPED_ARROW_PARTICLE_EFFECTS = 0; 1720 public enum ubyte PLAY_JUMPING_ANIMATION_AND_PARTICLES = 1; 1721 public enum ubyte RESET_SPAWNER_DELAY = 1; 1722 public enum ubyte PLAY_HURT_ANIMATION_AND_SOUND = 2; 1723 public enum ubyte PLAY_DEATH_ANIMATION_AND_SOUND = 3; 1724 public enum ubyte PLAY_ATTACK_ANIMATION_AND_SOUND = 4; 1725 public enum ubyte SPAWN_SMOKE_PARTICLES = 6; 1726 public enum ubyte SPAWN_HEART_PARTICLES = 7; 1727 public enum ubyte PLAY_SHAKING_WATER_ANIMATION = 8; 1728 public enum ubyte FINISHED_CONSUMING = 9; 1729 public enum ubyte PLAY_EATING_GRASS_ANIMATION = 10; 1730 public enum ubyte IGNITE_MINECART_TNT = 10; 1731 public enum ubyte HOLD_POPPY = 11; 1732 public enum ubyte SPAWN_VILLAGER_MATING_HEART_PARTICLES = 12; 1733 public enum ubyte SPAWN_VILLAGER_ANGRY_PARTICLES = 13; 1734 public enum ubyte SPAWN_VILLAGER_HAPPY_PARTICLES = 14; 1735 public enum ubyte SPAWN_WITCH_MAGIC_PARTICLES = 15; 1736 public enum ubyte PLAY_ZOMBIE_CURE_FINISHED_SOUND = 16; 1737 public enum ubyte SPAWN_FIREWORK_EXPLOSION_EFFECT = 17; 1738 public enum ubyte SPAWN_LOVE_PARTICLES = 18; 1739 public enum ubyte RESET_SQUID_ROTATION = 19; 1740 public enum ubyte SPAWN_EXPLOSION_PARTICLES = 20; 1741 public enum ubyte PLAY_GUARDIAN_SOUND_EFFECT = 21; 1742 public enum ubyte ENABLE_REDUCED_DEBUG_SCREEN = 22; 1743 public enum ubyte DISABLE_REDUCED_DEBUG_SCREEN = 23; 1744 public enum ubyte SET_OP_PERMISSION_LEVEL_0 = 24; 1745 public enum ubyte SET_OP_PERMISSION_LEVEL_1 = 25; 1746 public enum ubyte SET_OP_PERMISSION_LEVEL_2 = 26; 1747 public enum ubyte SET_OP_PERMISSION_LEVEL_3 = 27; 1748 public enum ubyte SET_OP_PERMISSION_LEVEL_4 = 28; 1749 public enum ubyte PLAY_SHIELD_BLOCK_SOUND = 29; 1750 public enum ubyte PLAY_SHIELD_BREAK_SOUND = 30; 1751 public enum ubyte HOOK_KNOCKBACK = 31; 1752 public enum ubyte PLAY_HIT_SOUND = 32; 1753 public enum ubyte PLAY_THORNS_HURT_ANIMATION_AND_SOUND = 33; 1754 public enum ubyte REMOVE_POPPY = 34; 1755 public enum ubyte PLAY_TOTEM_UNDYING_ANIMATION = 35; 1756 1757 public enum string[] FIELDS = ["entityId", "status"]; 1758 1759 public uint entityId; 1760 public ubyte status; 1761 1762 public pure nothrow @safe @nogc this() {} 1763 1764 public pure nothrow @safe @nogc this(uint entityId, ubyte status=ubyte.init) { 1765 this.entityId = entityId; 1766 this.status = status; 1767 } 1768 1769 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1770 _buffer.length = 0; 1771 static if(writeId){ writeBytes(varuint.encode(ID)); } 1772 writeBigEndianUint(entityId); 1773 writeBigEndianUbyte(status); 1774 return _buffer; 1775 } 1776 1777 public pure nothrow @safe void decode(bool readId=true)() { 1778 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1779 entityId=readBigEndianUint(); 1780 status=readBigEndianUbyte(); 1781 } 1782 1783 public static pure nothrow @safe EntityStatus fromBuffer(bool readId=true)(ubyte[] buffer) { 1784 EntityStatus ret = new EntityStatus(); 1785 ret._buffer = buffer; 1786 ret.decode!readId(); 1787 return ret; 1788 } 1789 1790 public override string toString() { 1791 return "EntityStatus(entityId: " ~ std.conv.to!string(this.entityId) ~ ", status: " ~ std.conv.to!string(this.status) ~ ")"; 1792 } 1793 1794 } 1795 1796 class Explosion : Buffer { 1797 1798 public enum uint ID = 28; 1799 1800 public enum bool CLIENTBOUND = true; 1801 public enum bool SERVERBOUND = false; 1802 1803 public enum string[] FIELDS = ["position", "radius", "records", "motion"]; 1804 1805 public Tuple!(float, "x", float, "y", float, "z") position; 1806 public float radius; 1807 public Tuple!(byte, "x", byte, "y", byte, "z")[] records; 1808 public Tuple!(float, "x", float, "y", float, "z") motion; 1809 1810 public pure nothrow @safe @nogc this() {} 1811 1812 public pure nothrow @safe @nogc this(Tuple!(float, "x", float, "y", float, "z") position, float radius=float.init, Tuple!(byte, "x", byte, "y", byte, "z")[] records=(Tuple!(byte, "x", byte, "y", byte, "z")[]).init, Tuple!(float, "x", float, "y", float, "z") motion=Tuple!(float, "x", float, "y", float, "z").init) { 1813 this.position = position; 1814 this.radius = radius; 1815 this.records = records; 1816 this.motion = motion; 1817 } 1818 1819 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1820 _buffer.length = 0; 1821 static if(writeId){ writeBytes(varuint.encode(ID)); } 1822 writeBigEndianFloat(position.x); writeBigEndianFloat(position.y); writeBigEndianFloat(position.z); 1823 writeBigEndianFloat(radius); 1824 writeBigEndianUint(cast(uint)records.length); foreach(cvbjc;records){ writeBigEndianByte(cvbjc.x); writeBigEndianByte(cvbjc.y); writeBigEndianByte(cvbjc.z); } 1825 writeBigEndianFloat(motion.x); writeBigEndianFloat(motion.y); writeBigEndianFloat(motion.z); 1826 return _buffer; 1827 } 1828 1829 public pure nothrow @safe void decode(bool readId=true)() { 1830 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1831 position.x=readBigEndianFloat(); position.y=readBigEndianFloat(); position.z=readBigEndianFloat(); 1832 radius=readBigEndianFloat(); 1833 records.length=readBigEndianUint(); foreach(ref cvbjc;records){ cvbjc.x=readBigEndianByte(); cvbjc.y=readBigEndianByte(); cvbjc.z=readBigEndianByte(); } 1834 motion.x=readBigEndianFloat(); motion.y=readBigEndianFloat(); motion.z=readBigEndianFloat(); 1835 } 1836 1837 public static pure nothrow @safe Explosion fromBuffer(bool readId=true)(ubyte[] buffer) { 1838 Explosion ret = new Explosion(); 1839 ret._buffer = buffer; 1840 ret.decode!readId(); 1841 return ret; 1842 } 1843 1844 public override string toString() { 1845 return "Explosion(position: " ~ std.conv.to!string(this.position) ~ ", radius: " ~ std.conv.to!string(this.radius) ~ ", records: " ~ std.conv.to!string(this.records) ~ ", motion: " ~ std.conv.to!string(this.motion) ~ ")"; 1846 } 1847 1848 } 1849 1850 class UnloadChunk : Buffer { 1851 1852 public enum uint ID = 29; 1853 1854 public enum bool CLIENTBOUND = true; 1855 public enum bool SERVERBOUND = false; 1856 1857 public enum string[] FIELDS = ["position"]; 1858 1859 public Tuple!(int, "x", int, "z") position; 1860 1861 public pure nothrow @safe @nogc this() {} 1862 1863 public pure nothrow @safe @nogc this(Tuple!(int, "x", int, "z") position) { 1864 this.position = position; 1865 } 1866 1867 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1868 _buffer.length = 0; 1869 static if(writeId){ writeBytes(varuint.encode(ID)); } 1870 writeBigEndianInt(position.x); writeBigEndianInt(position.z); 1871 return _buffer; 1872 } 1873 1874 public pure nothrow @safe void decode(bool readId=true)() { 1875 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1876 position.x=readBigEndianInt(); position.z=readBigEndianInt(); 1877 } 1878 1879 public static pure nothrow @safe UnloadChunk fromBuffer(bool readId=true)(ubyte[] buffer) { 1880 UnloadChunk ret = new UnloadChunk(); 1881 ret._buffer = buffer; 1882 ret.decode!readId(); 1883 return ret; 1884 } 1885 1886 public override string toString() { 1887 return "UnloadChunk(position: " ~ std.conv.to!string(this.position) ~ ")"; 1888 } 1889 1890 } 1891 1892 class ChangeGameState : Buffer { 1893 1894 public enum uint ID = 30; 1895 1896 public enum bool CLIENTBOUND = true; 1897 public enum bool SERVERBOUND = false; 1898 1899 // reason 1900 public enum ubyte INVALID_BED = 0; 1901 public enum ubyte END_RAINING = 1; 1902 public enum ubyte BEGIN_RAINING = 2; 1903 public enum ubyte CHANGE_GAMEMODE = 3; 1904 public enum ubyte EXIT_END = 4; 1905 public enum ubyte DEMO_MESSAGE = 5; 1906 public enum ubyte ARROW_HITTING_PLAYER = 6; 1907 public enum ubyte FADE_VALUE = 7; 1908 public enum ubyte FADE_TIME = 8; 1909 public enum ubyte PLAY_ELDER_GUARDIAN_MOB_APPEARANCE = 10; 1910 1911 // value 1912 public enum float SURVIVAL = 0; 1913 public enum float CREATIVE = 1; 1914 public enum float ADVENTURE = 2; 1915 public enum float SPECTATOR = 3; 1916 public enum float RESPAWN_IMMEDIATELY = 0; 1917 public enum float RESPAWN_AFTER_CREDITS = 1; 1918 public enum float SHOW_DEMO_SCREEN = 0; 1919 public enum float TELL_MOVEMENT_CONTROLS = 101; 1920 public enum float TELL_JUMP_CONTROLS = 102; 1921 public enum float TELL_INVENTORY_CONTROLS = 103; 1922 public enum float BRIGHT = 0; 1923 public enum float DARK = 1; 1924 1925 public enum string[] FIELDS = ["reason", "value"]; 1926 1927 public ubyte reason; 1928 public float value; 1929 1930 public pure nothrow @safe @nogc this() {} 1931 1932 public pure nothrow @safe @nogc this(ubyte reason, float value=float.init) { 1933 this.reason = reason; 1934 this.value = value; 1935 } 1936 1937 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1938 _buffer.length = 0; 1939 static if(writeId){ writeBytes(varuint.encode(ID)); } 1940 writeBigEndianUbyte(reason); 1941 writeBigEndianFloat(value); 1942 return _buffer; 1943 } 1944 1945 public pure nothrow @safe void decode(bool readId=true)() { 1946 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1947 reason=readBigEndianUbyte(); 1948 value=readBigEndianFloat(); 1949 } 1950 1951 public static pure nothrow @safe ChangeGameState fromBuffer(bool readId=true)(ubyte[] buffer) { 1952 ChangeGameState ret = new ChangeGameState(); 1953 ret._buffer = buffer; 1954 ret.decode!readId(); 1955 return ret; 1956 } 1957 1958 public override string toString() { 1959 return "ChangeGameState(reason: " ~ std.conv.to!string(this.reason) ~ ", value: " ~ std.conv.to!string(this.value) ~ ")"; 1960 } 1961 1962 } 1963 1964 class KeepAlive : Buffer { 1965 1966 public enum uint ID = 31; 1967 1968 public enum bool CLIENTBOUND = true; 1969 public enum bool SERVERBOUND = false; 1970 1971 public enum string[] FIELDS = ["id"]; 1972 1973 public uint id; 1974 1975 public pure nothrow @safe @nogc this() {} 1976 1977 public pure nothrow @safe @nogc this(uint id) { 1978 this.id = id; 1979 } 1980 1981 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 1982 _buffer.length = 0; 1983 static if(writeId){ writeBytes(varuint.encode(ID)); } 1984 writeBytes(varuint.encode(id)); 1985 return _buffer; 1986 } 1987 1988 public pure nothrow @safe void decode(bool readId=true)() { 1989 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 1990 id=varuint.decode(_buffer, &_index); 1991 } 1992 1993 public static pure nothrow @safe KeepAlive fromBuffer(bool readId=true)(ubyte[] buffer) { 1994 KeepAlive ret = new KeepAlive(); 1995 ret._buffer = buffer; 1996 ret.decode!readId(); 1997 return ret; 1998 } 1999 2000 public override string toString() { 2001 return "KeepAlive(id: " ~ std.conv.to!string(this.id) ~ ")"; 2002 } 2003 2004 } 2005 2006 class ChunkData : Buffer { 2007 2008 public enum uint ID = 32; 2009 2010 public enum bool CLIENTBOUND = true; 2011 public enum bool SERVERBOUND = false; 2012 2013 public enum string[] FIELDS = ["position", "full", "sections", "data", "tilesCount", "tiles"]; 2014 2015 public Tuple!(int, "x", int, "z") position; 2016 public bool full; 2017 public uint sections; 2018 public ubyte[] data; 2019 public uint tilesCount; 2020 public ubyte[] tiles; 2021 2022 public pure nothrow @safe @nogc this() {} 2023 2024 public pure nothrow @safe @nogc this(Tuple!(int, "x", int, "z") position, bool full=bool.init, uint sections=uint.init, ubyte[] data=(ubyte[]).init, uint tilesCount=uint.init, ubyte[] tiles=(ubyte[]).init) { 2025 this.position = position; 2026 this.full = full; 2027 this.sections = sections; 2028 this.data = data; 2029 this.tilesCount = tilesCount; 2030 this.tiles = tiles; 2031 } 2032 2033 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2034 _buffer.length = 0; 2035 static if(writeId){ writeBytes(varuint.encode(ID)); } 2036 writeBigEndianInt(position.x); writeBigEndianInt(position.z); 2037 writeBigEndianBool(full); 2038 writeBytes(varuint.encode(sections)); 2039 writeBytes(varuint.encode(cast(uint)data.length)); writeBytes(data); 2040 writeBytes(varuint.encode(tilesCount)); 2041 writeBytes(tiles); 2042 return _buffer; 2043 } 2044 2045 public pure nothrow @safe void decode(bool readId=true)() { 2046 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2047 position.x=readBigEndianInt(); position.z=readBigEndianInt(); 2048 full=readBigEndianBool(); 2049 sections=varuint.decode(_buffer, &_index); 2050 data.length=varuint.decode(_buffer, &_index); if(_buffer.length>=_index+data.length){ data=_buffer[_index.._index+data.length].dup; _index+=data.length; } 2051 tilesCount=varuint.decode(_buffer, &_index); 2052 tiles=_buffer[_index..$].dup; _index=_buffer.length; 2053 } 2054 2055 public static pure nothrow @safe ChunkData fromBuffer(bool readId=true)(ubyte[] buffer) { 2056 ChunkData ret = new ChunkData(); 2057 ret._buffer = buffer; 2058 ret.decode!readId(); 2059 return ret; 2060 } 2061 2062 public override string toString() { 2063 return "ChunkData(position: " ~ std.conv.to!string(this.position) ~ ", full: " ~ std.conv.to!string(this.full) ~ ", sections: " ~ std.conv.to!string(this.sections) ~ ", data: " ~ std.conv.to!string(this.data) ~ ", tilesCount: " ~ std.conv.to!string(this.tilesCount) ~ ", tiles: " ~ std.conv.to!string(this.tiles) ~ ")"; 2064 } 2065 2066 } 2067 2068 class Effect : Buffer { 2069 2070 public enum uint ID = 33; 2071 2072 public enum bool CLIENTBOUND = true; 2073 public enum bool SERVERBOUND = false; 2074 2075 // effect id 2076 public enum uint DISPENSER_DISPENSE = 1000; 2077 public enum uint DISPENSER_FAIL_DISPENSE = 1001; 2078 public enum uint DISPENSER_SHOOT = 1002; 2079 public enum uint ENDER_EYE_LAUNCH = 1003; 2080 public enum uint FIREWORK_SHOT = 1004; 2081 public enum uint IRON_DOOR_OPEN = 1005; 2082 public enum uint WOODEN_DOOR_OPEN = 1006; 2083 public enum uint WOODEN_TRAPDOOR_OPEN = 1007; 2084 public enum uint FENCE_GATE_OPEN = 1008; 2085 public enum uint FIRE_EXTINGUISH = 1009; 2086 public enum uint PLAY_RECORD = 1010; 2087 public enum uint IRON_DOOR_CLOSE = 1011; 2088 public enum uint WOODEN_DOOR_CLOSE = 1012; 2089 public enum uint WOODEN_TRAPDOOR_CLOSE = 1013; 2090 public enum uint FENCE_GATE_CLOSE = 1014; 2091 public enum uint GHAST_WARN = 1015; 2092 public enum uint GHAST_SHOOT = 1016; 2093 public enum uint ENDERDRAGON_SHOOT = 1017; 2094 public enum uint BLAZE_SHOOT = 1018; 2095 public enum uint ZOMBIE_ATTACK_WOOD_DOOR = 1019; 2096 public enum uint ZOMBIE_ATTACK_IRON_DOOR = 1020; 2097 public enum uint ZOMBIE_BREAK_WOOD_DOOR = 1021; 2098 public enum uint WITHER_BREAK_BLOCK = 1022; 2099 public enum uint WITHER_SPAWN = 1023; 2100 public enum uint WITHER_SHOOT = 1024; 2101 public enum uint BAT_TAKE_OFF = 1025; 2102 public enum uint ZOMBIE_INFECT_VILLAGER = 1026; 2103 public enum uint ZOMBIE_VILLAGER_CONVERT = 1027; 2104 public enum uint ENDER_DRAGON_BREATH = 1028; 2105 public enum uint ANVIL_BREAK = 1029; 2106 public enum uint ANVIL_USE = 1030; 2107 public enum uint ANVIL_LAND = 1031; 2108 public enum uint PORTAL_TRAVEL = 1032; 2109 public enum uint CHORUS_FLOWER_GROW = 1033; 2110 public enum uint CHORUS_FLOWER_DIE = 1034; 2111 public enum uint BREWING_STAND_BREW = 1035; 2112 public enum uint IRON_TRAPDOOR_OPEN = 1036; 2113 public enum uint IRON_TRAPDOOR_CLOSE = 1037; 2114 public enum uint SPAWN_10_SMOKE_PARTICLES = 2000; 2115 public enum uint BREAK_BREAK_PARTICLES_AND_SOUND = 2001; 2116 public enum uint SPLASH_POTION_PARTICLES_AND_SOUND = 2002; 2117 public enum uint ENDER_EYE_BREAK_PARTICLES_AND_SOUND = 2003; 2118 public enum uint MOB_SPAWN_PARTICLES = 2004; 2119 public enum uint BONEMEAL_PARTICLES = 2005; 2120 public enum uint DRAGON_BREATH = 2006; 2121 public enum uint END_GATEWAY_SPAWN = 3000; 2122 public enum uint ENDERDRAGON_GROWL = 3001; 2123 2124 public enum string[] FIELDS = ["effectId", "position", "data", "disableVolume"]; 2125 2126 public uint effectId; 2127 public ulong position; 2128 public uint data; 2129 public bool disableVolume; 2130 2131 public pure nothrow @safe @nogc this() {} 2132 2133 public pure nothrow @safe @nogc this(uint effectId, ulong position=ulong.init, uint data=uint.init, bool disableVolume=bool.init) { 2134 this.effectId = effectId; 2135 this.position = position; 2136 this.data = data; 2137 this.disableVolume = disableVolume; 2138 } 2139 2140 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2141 _buffer.length = 0; 2142 static if(writeId){ writeBytes(varuint.encode(ID)); } 2143 writeBigEndianUint(effectId); 2144 writeBigEndianUlong(position); 2145 writeBigEndianUint(data); 2146 writeBigEndianBool(disableVolume); 2147 return _buffer; 2148 } 2149 2150 public pure nothrow @safe void decode(bool readId=true)() { 2151 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2152 effectId=readBigEndianUint(); 2153 position=readBigEndianUlong(); 2154 data=readBigEndianUint(); 2155 disableVolume=readBigEndianBool(); 2156 } 2157 2158 public static pure nothrow @safe Effect fromBuffer(bool readId=true)(ubyte[] buffer) { 2159 Effect ret = new Effect(); 2160 ret._buffer = buffer; 2161 ret.decode!readId(); 2162 return ret; 2163 } 2164 2165 public override string toString() { 2166 return "Effect(effectId: " ~ std.conv.to!string(this.effectId) ~ ", position: " ~ std.conv.to!string(this.position) ~ ", data: " ~ std.conv.to!string(this.data) ~ ", disableVolume: " ~ std.conv.to!string(this.disableVolume) ~ ")"; 2167 } 2168 2169 } 2170 2171 class Particle : Buffer { 2172 2173 public enum uint ID = 34; 2174 2175 public enum bool CLIENTBOUND = true; 2176 public enum bool SERVERBOUND = false; 2177 2178 // particle id 2179 public enum uint EXPLODE = 0; 2180 public enum uint LARGE_EXPLOSION = 1; 2181 public enum uint HUGE_EXPLOSION = 2; 2182 public enum uint FIREWORK_SPARK = 3; 2183 public enum uint BUBBLE = 4; 2184 public enum uint SPLASH = 5; 2185 public enum uint WAKE = 6; 2186 public enum uint SUSPENDED = 7; 2187 public enum uint DEPTH_SUSPEND = 8; 2188 public enum uint CRIT = 9; 2189 public enum uint MAGIC_CRIT = 10; 2190 public enum uint SMOKE = 11; 2191 public enum uint LARGE_SMOKE = 12; 2192 public enum uint SPELL = 13; 2193 public enum uint INSTANT_SPELL = 14; 2194 public enum uint MOB_SPELL = 15; 2195 public enum uint MOB_SPELL_AMBIENT = 16; 2196 public enum uint WITCH_MAGIC = 17; 2197 public enum uint DRIP_WATER = 18; 2198 public enum uint DRIP_LAVA = 19; 2199 public enum uint ANGRY_VILLAGER = 20; 2200 public enum uint HAPPY_VILLAGER = 21; 2201 public enum uint TOWN_AURA = 22; 2202 public enum uint NOTE = 23; 2203 public enum uint PORTAL = 24; 2204 public enum uint ENCHANTMENT_TABLE = 25; 2205 public enum uint FLAME = 26; 2206 public enum uint LAVA = 27; 2207 public enum uint FOOTSTEP = 28; 2208 public enum uint CLOUD = 29; 2209 public enum uint RED_DUST = 30; 2210 public enum uint SNOWBALL_POOF = 31; 2211 public enum uint SNOW_SHOVEL = 32; 2212 public enum uint SLIME = 33; 2213 public enum uint HEART = 34; 2214 public enum uint BARRIER = 35; 2215 public enum uint ITEM_CRACK = 36; 2216 public enum uint BLOCK_CRACK = 37; 2217 public enum uint BLOCK_DUST = 38; 2218 public enum uint DROPLET = 39; 2219 public enum uint TAKE = 40; 2220 public enum uint MOB_APPEARANCE = 41; 2221 public enum uint DRAGON_BREATH = 42; 2222 public enum uint ENDROD = 43; 2223 public enum uint DAMAGE_INDICATOR = 44; 2224 public enum uint SWEEP_ATTACK = 45; 2225 public enum uint FALLING_DUST = 46; 2226 2227 public enum string[] FIELDS = ["particleId", "longDistance", "position", "offset", "data", "count", "additionalData"]; 2228 2229 public uint particleId; 2230 public bool longDistance; 2231 public Tuple!(float, "x", float, "y", float, "z") position; 2232 public Tuple!(float, "x", float, "y", float, "z") offset; 2233 public float data; 2234 public uint count; 2235 public uint[2] additionalData; 2236 2237 public pure nothrow @safe @nogc this() {} 2238 2239 public pure nothrow @safe @nogc this(uint particleId, bool longDistance=bool.init, Tuple!(float, "x", float, "y", float, "z") position=Tuple!(float, "x", float, "y", float, "z").init, Tuple!(float, "x", float, "y", float, "z") offset=Tuple!(float, "x", float, "y", float, "z").init, float data=float.init, uint count=uint.init, uint[2] additionalData=(uint[2]).init) { 2240 this.particleId = particleId; 2241 this.longDistance = longDistance; 2242 this.position = position; 2243 this.offset = offset; 2244 this.data = data; 2245 this.count = count; 2246 this.additionalData = additionalData; 2247 } 2248 2249 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2250 _buffer.length = 0; 2251 static if(writeId){ writeBytes(varuint.encode(ID)); } 2252 writeBigEndianUint(particleId); 2253 writeBigEndianBool(longDistance); 2254 writeBigEndianFloat(position.x); writeBigEndianFloat(position.y); writeBigEndianFloat(position.z); 2255 writeBigEndianFloat(offset.x); writeBigEndianFloat(offset.y); writeBigEndianFloat(offset.z); 2256 writeBigEndianFloat(data); 2257 writeBigEndianUint(count); 2258 foreach(yrarb5br;additionalData){ writeBytes(varuint.encode(yrarb5br)); } 2259 return _buffer; 2260 } 2261 2262 public pure nothrow @safe void decode(bool readId=true)() { 2263 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2264 particleId=readBigEndianUint(); 2265 longDistance=readBigEndianBool(); 2266 position.x=readBigEndianFloat(); position.y=readBigEndianFloat(); position.z=readBigEndianFloat(); 2267 offset.x=readBigEndianFloat(); offset.y=readBigEndianFloat(); offset.z=readBigEndianFloat(); 2268 data=readBigEndianFloat(); 2269 count=readBigEndianUint(); 2270 foreach(ref yrarb5br;additionalData){ yrarb5br=varuint.decode(_buffer, &_index); } 2271 } 2272 2273 public static pure nothrow @safe Particle fromBuffer(bool readId=true)(ubyte[] buffer) { 2274 Particle ret = new Particle(); 2275 ret._buffer = buffer; 2276 ret.decode!readId(); 2277 return ret; 2278 } 2279 2280 public override string toString() { 2281 return "Particle(particleId: " ~ std.conv.to!string(this.particleId) ~ ", longDistance: " ~ std.conv.to!string(this.longDistance) ~ ", position: " ~ std.conv.to!string(this.position) ~ ", offset: " ~ std.conv.to!string(this.offset) ~ ", data: " ~ std.conv.to!string(this.data) ~ ", count: " ~ std.conv.to!string(this.count) ~ ", additionalData: " ~ std.conv.to!string(this.additionalData) ~ ")"; 2282 } 2283 2284 } 2285 2286 class JoinGame : Buffer { 2287 2288 public enum uint ID = 35; 2289 2290 public enum bool CLIENTBOUND = true; 2291 public enum bool SERVERBOUND = false; 2292 2293 // gamemode 2294 public enum ubyte SURVIVAL = 0; 2295 public enum ubyte CREATIVE = 1; 2296 public enum ubyte ADVENTURE = 2; 2297 public enum ubyte SPECTATOR = 3; 2298 2299 // dimension 2300 public enum int NETHER = -1; 2301 public enum int OVERWORLD = 0; 2302 public enum int END = 1; 2303 2304 // difficulty 2305 public enum ubyte PEACEFUL = 0; 2306 public enum ubyte EASY = 1; 2307 public enum ubyte NORMAL = 2; 2308 public enum ubyte HARD = 3; 2309 2310 // level type 2311 public enum string INFINITY = "default"; 2312 public enum string FLAT = "flat"; 2313 public enum string AMPLIFIED = "amplified"; 2314 public enum string LARGE_BIOMES = "largeBiomes"; 2315 2316 public enum string[] FIELDS = ["entityId", "gamemode", "dimension", "difficulty", "maxPlayers", "levelType", "reducedDebug"]; 2317 2318 public uint entityId; 2319 public ubyte gamemode; 2320 public int dimension; 2321 public ubyte difficulty; 2322 public ubyte maxPlayers; 2323 public string levelType; 2324 public bool reducedDebug; 2325 2326 public pure nothrow @safe @nogc this() {} 2327 2328 public pure nothrow @safe @nogc this(uint entityId, ubyte gamemode=ubyte.init, int dimension=int.init, ubyte difficulty=ubyte.init, ubyte maxPlayers=ubyte.init, string levelType=string.init, bool reducedDebug=bool.init) { 2329 this.entityId = entityId; 2330 this.gamemode = gamemode; 2331 this.dimension = dimension; 2332 this.difficulty = difficulty; 2333 this.maxPlayers = maxPlayers; 2334 this.levelType = levelType; 2335 this.reducedDebug = reducedDebug; 2336 } 2337 2338 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2339 _buffer.length = 0; 2340 static if(writeId){ writeBytes(varuint.encode(ID)); } 2341 writeBigEndianUint(entityId); 2342 writeBigEndianUbyte(gamemode); 2343 writeBigEndianInt(dimension); 2344 writeBigEndianUbyte(difficulty); 2345 writeBigEndianUbyte(maxPlayers); 2346 writeBytes(varuint.encode(cast(uint)levelType.length)); writeString(levelType); 2347 writeBigEndianBool(reducedDebug); 2348 return _buffer; 2349 } 2350 2351 public pure nothrow @safe void decode(bool readId=true)() { 2352 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2353 entityId=readBigEndianUint(); 2354 gamemode=readBigEndianUbyte(); 2355 dimension=readBigEndianInt(); 2356 difficulty=readBigEndianUbyte(); 2357 maxPlayers=readBigEndianUbyte(); 2358 uint bvzxeb=varuint.decode(_buffer, &_index); levelType=readString(bvzxeb); 2359 reducedDebug=readBigEndianBool(); 2360 } 2361 2362 public static pure nothrow @safe JoinGame fromBuffer(bool readId=true)(ubyte[] buffer) { 2363 JoinGame ret = new JoinGame(); 2364 ret._buffer = buffer; 2365 ret.decode!readId(); 2366 return ret; 2367 } 2368 2369 public override string toString() { 2370 return "JoinGame(entityId: " ~ std.conv.to!string(this.entityId) ~ ", gamemode: " ~ std.conv.to!string(this.gamemode) ~ ", dimension: " ~ std.conv.to!string(this.dimension) ~ ", difficulty: " ~ std.conv.to!string(this.difficulty) ~ ", maxPlayers: " ~ std.conv.to!string(this.maxPlayers) ~ ", levelType: " ~ std.conv.to!string(this.levelType) ~ ", reducedDebug: " ~ std.conv.to!string(this.reducedDebug) ~ ")"; 2371 } 2372 2373 } 2374 2375 class Map : Buffer { 2376 2377 public enum uint ID = 36; 2378 2379 public enum bool CLIENTBOUND = true; 2380 public enum bool SERVERBOUND = false; 2381 2382 public enum string[] FIELDS = ["mapId", "scale", "showIcons", "icons", "colums", "rows", "offset", "data"]; 2383 2384 public uint mapId; 2385 public ubyte scale; 2386 public bool showIcons; 2387 public sul.protocol.java335.types.Icon[] icons; 2388 public ubyte colums; 2389 public ubyte rows; 2390 public Tuple!(ubyte, "x", ubyte, "z") offset; 2391 public ubyte[] data; 2392 2393 public pure nothrow @safe @nogc this() {} 2394 2395 public pure nothrow @safe @nogc this(uint mapId, ubyte scale=ubyte.init, bool showIcons=bool.init, sul.protocol.java335.types.Icon[] icons=(sul.protocol.java335.types.Icon[]).init, ubyte colums=ubyte.init, ubyte rows=ubyte.init, Tuple!(ubyte, "x", ubyte, "z") offset=Tuple!(ubyte, "x", ubyte, "z").init, ubyte[] data=(ubyte[]).init) { 2396 this.mapId = mapId; 2397 this.scale = scale; 2398 this.showIcons = showIcons; 2399 this.icons = icons; 2400 this.colums = colums; 2401 this.rows = rows; 2402 this.offset = offset; 2403 this.data = data; 2404 } 2405 2406 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2407 _buffer.length = 0; 2408 static if(writeId){ writeBytes(varuint.encode(ID)); } 2409 writeBytes(varuint.encode(mapId)); 2410 writeBigEndianUbyte(scale); 2411 writeBigEndianBool(showIcons); 2412 writeBytes(varuint.encode(cast(uint)icons.length)); foreach(anbm;icons){ anbm.encode(bufferInstance); } 2413 writeBigEndianUbyte(colums); 2414 writeBigEndianUbyte(rows); 2415 writeBigEndianUbyte(offset.x); writeBigEndianUbyte(offset.z); 2416 writeBytes(varuint.encode(cast(uint)data.length)); writeBytes(data); 2417 return _buffer; 2418 } 2419 2420 public pure nothrow @safe void decode(bool readId=true)() { 2421 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2422 mapId=varuint.decode(_buffer, &_index); 2423 scale=readBigEndianUbyte(); 2424 showIcons=readBigEndianBool(); 2425 icons.length=varuint.decode(_buffer, &_index); foreach(ref anbm;icons){ anbm.decode(bufferInstance); } 2426 colums=readBigEndianUbyte(); 2427 rows=readBigEndianUbyte(); 2428 offset.x=readBigEndianUbyte(); offset.z=readBigEndianUbyte(); 2429 data.length=varuint.decode(_buffer, &_index); if(_buffer.length>=_index+data.length){ data=_buffer[_index.._index+data.length].dup; _index+=data.length; } 2430 } 2431 2432 public static pure nothrow @safe Map fromBuffer(bool readId=true)(ubyte[] buffer) { 2433 Map ret = new Map(); 2434 ret._buffer = buffer; 2435 ret.decode!readId(); 2436 return ret; 2437 } 2438 2439 public override string toString() { 2440 return "Map(mapId: " ~ std.conv.to!string(this.mapId) ~ ", scale: " ~ std.conv.to!string(this.scale) ~ ", showIcons: " ~ std.conv.to!string(this.showIcons) ~ ", icons: " ~ std.conv.to!string(this.icons) ~ ", colums: " ~ std.conv.to!string(this.colums) ~ ", rows: " ~ std.conv.to!string(this.rows) ~ ", offset: " ~ std.conv.to!string(this.offset) ~ ", data: " ~ std.conv.to!string(this.data) ~ ")"; 2441 } 2442 2443 } 2444 2445 class Entity : Buffer { 2446 2447 public enum uint ID = 37; 2448 2449 public enum bool CLIENTBOUND = true; 2450 public enum bool SERVERBOUND = false; 2451 2452 public enum string[] FIELDS = ["entityId"]; 2453 2454 public uint entityId; 2455 2456 public pure nothrow @safe @nogc this() {} 2457 2458 public pure nothrow @safe @nogc this(uint entityId) { 2459 this.entityId = entityId; 2460 } 2461 2462 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2463 _buffer.length = 0; 2464 static if(writeId){ writeBytes(varuint.encode(ID)); } 2465 writeBytes(varuint.encode(entityId)); 2466 return _buffer; 2467 } 2468 2469 public pure nothrow @safe void decode(bool readId=true)() { 2470 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2471 entityId=varuint.decode(_buffer, &_index); 2472 } 2473 2474 public static pure nothrow @safe Entity fromBuffer(bool readId=true)(ubyte[] buffer) { 2475 Entity ret = new Entity(); 2476 ret._buffer = buffer; 2477 ret.decode!readId(); 2478 return ret; 2479 } 2480 2481 public override string toString() { 2482 return "Entity(entityId: " ~ std.conv.to!string(this.entityId) ~ ")"; 2483 } 2484 2485 } 2486 2487 class EntityRelativeMove : Buffer { 2488 2489 public enum uint ID = 38; 2490 2491 public enum bool CLIENTBOUND = true; 2492 public enum bool SERVERBOUND = false; 2493 2494 public enum string[] FIELDS = ["entityId", "delta", "onGround"]; 2495 2496 public uint entityId; 2497 public Tuple!(short, "x", short, "y", short, "z") delta; 2498 public bool onGround; 2499 2500 public pure nothrow @safe @nogc this() {} 2501 2502 public pure nothrow @safe @nogc this(uint entityId, Tuple!(short, "x", short, "y", short, "z") delta=Tuple!(short, "x", short, "y", short, "z").init, bool onGround=bool.init) { 2503 this.entityId = entityId; 2504 this.delta = delta; 2505 this.onGround = onGround; 2506 } 2507 2508 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2509 _buffer.length = 0; 2510 static if(writeId){ writeBytes(varuint.encode(ID)); } 2511 writeBytes(varuint.encode(entityId)); 2512 writeBigEndianShort(delta.x); writeBigEndianShort(delta.y); writeBigEndianShort(delta.z); 2513 writeBigEndianBool(onGround); 2514 return _buffer; 2515 } 2516 2517 public pure nothrow @safe void decode(bool readId=true)() { 2518 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2519 entityId=varuint.decode(_buffer, &_index); 2520 delta.x=readBigEndianShort(); delta.y=readBigEndianShort(); delta.z=readBigEndianShort(); 2521 onGround=readBigEndianBool(); 2522 } 2523 2524 public static pure nothrow @safe EntityRelativeMove fromBuffer(bool readId=true)(ubyte[] buffer) { 2525 EntityRelativeMove ret = new EntityRelativeMove(); 2526 ret._buffer = buffer; 2527 ret.decode!readId(); 2528 return ret; 2529 } 2530 2531 public override string toString() { 2532 return "EntityRelativeMove(entityId: " ~ std.conv.to!string(this.entityId) ~ ", delta: " ~ std.conv.to!string(this.delta) ~ ", onGround: " ~ std.conv.to!string(this.onGround) ~ ")"; 2533 } 2534 2535 } 2536 2537 class EntityLookAndRelativeMove : Buffer { 2538 2539 public enum uint ID = 39; 2540 2541 public enum bool CLIENTBOUND = true; 2542 public enum bool SERVERBOUND = false; 2543 2544 public enum string[] FIELDS = ["entityId", "delta", "yaw", "pitch", "onGround"]; 2545 2546 public uint entityId; 2547 public Tuple!(short, "x", short, "y", short, "z") delta; 2548 public ubyte yaw; 2549 public ubyte pitch; 2550 public bool onGround; 2551 2552 public pure nothrow @safe @nogc this() {} 2553 2554 public pure nothrow @safe @nogc this(uint entityId, Tuple!(short, "x", short, "y", short, "z") delta=Tuple!(short, "x", short, "y", short, "z").init, ubyte yaw=ubyte.init, ubyte pitch=ubyte.init, bool onGround=bool.init) { 2555 this.entityId = entityId; 2556 this.delta = delta; 2557 this.yaw = yaw; 2558 this.pitch = pitch; 2559 this.onGround = onGround; 2560 } 2561 2562 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2563 _buffer.length = 0; 2564 static if(writeId){ writeBytes(varuint.encode(ID)); } 2565 writeBytes(varuint.encode(entityId)); 2566 writeBigEndianShort(delta.x); writeBigEndianShort(delta.y); writeBigEndianShort(delta.z); 2567 writeBigEndianUbyte(yaw); 2568 writeBigEndianUbyte(pitch); 2569 writeBigEndianBool(onGround); 2570 return _buffer; 2571 } 2572 2573 public pure nothrow @safe void decode(bool readId=true)() { 2574 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2575 entityId=varuint.decode(_buffer, &_index); 2576 delta.x=readBigEndianShort(); delta.y=readBigEndianShort(); delta.z=readBigEndianShort(); 2577 yaw=readBigEndianUbyte(); 2578 pitch=readBigEndianUbyte(); 2579 onGround=readBigEndianBool(); 2580 } 2581 2582 public static pure nothrow @safe EntityLookAndRelativeMove fromBuffer(bool readId=true)(ubyte[] buffer) { 2583 EntityLookAndRelativeMove ret = new EntityLookAndRelativeMove(); 2584 ret._buffer = buffer; 2585 ret.decode!readId(); 2586 return ret; 2587 } 2588 2589 public override string toString() { 2590 return "EntityLookAndRelativeMove(entityId: " ~ std.conv.to!string(this.entityId) ~ ", delta: " ~ std.conv.to!string(this.delta) ~ ", yaw: " ~ std.conv.to!string(this.yaw) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ", onGround: " ~ std.conv.to!string(this.onGround) ~ ")"; 2591 } 2592 2593 } 2594 2595 class EntityLook : Buffer { 2596 2597 public enum uint ID = 40; 2598 2599 public enum bool CLIENTBOUND = true; 2600 public enum bool SERVERBOUND = false; 2601 2602 public enum string[] FIELDS = ["entityId", "yaw", "pitch", "onGround"]; 2603 2604 public uint entityId; 2605 public ubyte yaw; 2606 public ubyte pitch; 2607 public bool onGround; 2608 2609 public pure nothrow @safe @nogc this() {} 2610 2611 public pure nothrow @safe @nogc this(uint entityId, ubyte yaw=ubyte.init, ubyte pitch=ubyte.init, bool onGround=bool.init) { 2612 this.entityId = entityId; 2613 this.yaw = yaw; 2614 this.pitch = pitch; 2615 this.onGround = onGround; 2616 } 2617 2618 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2619 _buffer.length = 0; 2620 static if(writeId){ writeBytes(varuint.encode(ID)); } 2621 writeBytes(varuint.encode(entityId)); 2622 writeBigEndianUbyte(yaw); 2623 writeBigEndianUbyte(pitch); 2624 writeBigEndianBool(onGround); 2625 return _buffer; 2626 } 2627 2628 public pure nothrow @safe void decode(bool readId=true)() { 2629 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2630 entityId=varuint.decode(_buffer, &_index); 2631 yaw=readBigEndianUbyte(); 2632 pitch=readBigEndianUbyte(); 2633 onGround=readBigEndianBool(); 2634 } 2635 2636 public static pure nothrow @safe EntityLook fromBuffer(bool readId=true)(ubyte[] buffer) { 2637 EntityLook ret = new EntityLook(); 2638 ret._buffer = buffer; 2639 ret.decode!readId(); 2640 return ret; 2641 } 2642 2643 public override string toString() { 2644 return "EntityLook(entityId: " ~ std.conv.to!string(this.entityId) ~ ", yaw: " ~ std.conv.to!string(this.yaw) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ", onGround: " ~ std.conv.to!string(this.onGround) ~ ")"; 2645 } 2646 2647 } 2648 2649 class VehicleMove : Buffer { 2650 2651 public enum uint ID = 41; 2652 2653 public enum bool CLIENTBOUND = true; 2654 public enum bool SERVERBOUND = false; 2655 2656 public enum string[] FIELDS = ["position", "yaw", "pitch"]; 2657 2658 public Tuple!(double, "x", double, "y", double, "z") position; 2659 public float yaw; 2660 public float pitch; 2661 2662 public pure nothrow @safe @nogc this() {} 2663 2664 public pure nothrow @safe @nogc this(Tuple!(double, "x", double, "y", double, "z") position, float yaw=float.init, float pitch=float.init) { 2665 this.position = position; 2666 this.yaw = yaw; 2667 this.pitch = pitch; 2668 } 2669 2670 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2671 _buffer.length = 0; 2672 static if(writeId){ writeBytes(varuint.encode(ID)); } 2673 writeBigEndianDouble(position.x); writeBigEndianDouble(position.y); writeBigEndianDouble(position.z); 2674 writeBigEndianFloat(yaw); 2675 writeBigEndianFloat(pitch); 2676 return _buffer; 2677 } 2678 2679 public pure nothrow @safe void decode(bool readId=true)() { 2680 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2681 position.x=readBigEndianDouble(); position.y=readBigEndianDouble(); position.z=readBigEndianDouble(); 2682 yaw=readBigEndianFloat(); 2683 pitch=readBigEndianFloat(); 2684 } 2685 2686 public static pure nothrow @safe VehicleMove fromBuffer(bool readId=true)(ubyte[] buffer) { 2687 VehicleMove ret = new VehicleMove(); 2688 ret._buffer = buffer; 2689 ret.decode!readId(); 2690 return ret; 2691 } 2692 2693 public override string toString() { 2694 return "VehicleMove(position: " ~ std.conv.to!string(this.position) ~ ", yaw: " ~ std.conv.to!string(this.yaw) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ")"; 2695 } 2696 2697 } 2698 2699 class OpenSignEditor : Buffer { 2700 2701 public enum uint ID = 42; 2702 2703 public enum bool CLIENTBOUND = true; 2704 public enum bool SERVERBOUND = false; 2705 2706 public enum string[] FIELDS = ["position"]; 2707 2708 public ulong position; 2709 2710 public pure nothrow @safe @nogc this() {} 2711 2712 public pure nothrow @safe @nogc this(ulong position) { 2713 this.position = position; 2714 } 2715 2716 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2717 _buffer.length = 0; 2718 static if(writeId){ writeBytes(varuint.encode(ID)); } 2719 writeBigEndianUlong(position); 2720 return _buffer; 2721 } 2722 2723 public pure nothrow @safe void decode(bool readId=true)() { 2724 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2725 position=readBigEndianUlong(); 2726 } 2727 2728 public static pure nothrow @safe OpenSignEditor fromBuffer(bool readId=true)(ubyte[] buffer) { 2729 OpenSignEditor ret = new OpenSignEditor(); 2730 ret._buffer = buffer; 2731 ret.decode!readId(); 2732 return ret; 2733 } 2734 2735 public override string toString() { 2736 return "OpenSignEditor(position: " ~ std.conv.to!string(this.position) ~ ")"; 2737 } 2738 2739 } 2740 2741 class PlayerAbilities : Buffer { 2742 2743 public enum uint ID = 43; 2744 2745 public enum bool CLIENTBOUND = true; 2746 public enum bool SERVERBOUND = false; 2747 2748 // flags 2749 public enum ubyte INVULNERABLE = 1; 2750 public enum ubyte FLYING = 2; 2751 public enum ubyte ALLOW_FLYING = 4; 2752 public enum ubyte CREATIVE_MODE = 8; 2753 2754 public enum string[] FIELDS = ["flags", "flyingSpeed", "fovModifier"]; 2755 2756 public ubyte flags; 2757 public float flyingSpeed; 2758 public float fovModifier; 2759 2760 public pure nothrow @safe @nogc this() {} 2761 2762 public pure nothrow @safe @nogc this(ubyte flags, float flyingSpeed=float.init, float fovModifier=float.init) { 2763 this.flags = flags; 2764 this.flyingSpeed = flyingSpeed; 2765 this.fovModifier = fovModifier; 2766 } 2767 2768 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2769 _buffer.length = 0; 2770 static if(writeId){ writeBytes(varuint.encode(ID)); } 2771 writeBigEndianUbyte(flags); 2772 writeBigEndianFloat(flyingSpeed); 2773 writeBigEndianFloat(fovModifier); 2774 return _buffer; 2775 } 2776 2777 public pure nothrow @safe void decode(bool readId=true)() { 2778 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2779 flags=readBigEndianUbyte(); 2780 flyingSpeed=readBigEndianFloat(); 2781 fovModifier=readBigEndianFloat(); 2782 } 2783 2784 public static pure nothrow @safe PlayerAbilities fromBuffer(bool readId=true)(ubyte[] buffer) { 2785 PlayerAbilities ret = new PlayerAbilities(); 2786 ret._buffer = buffer; 2787 ret.decode!readId(); 2788 return ret; 2789 } 2790 2791 public override string toString() { 2792 return "PlayerAbilities(flags: " ~ std.conv.to!string(this.flags) ~ ", flyingSpeed: " ~ std.conv.to!string(this.flyingSpeed) ~ ", fovModifier: " ~ std.conv.to!string(this.fovModifier) ~ ")"; 2793 } 2794 2795 } 2796 2797 class CombatEvent : Buffer { 2798 2799 public enum uint ID = 44; 2800 2801 public enum bool CLIENTBOUND = true; 2802 public enum bool SERVERBOUND = false; 2803 2804 public enum string[] FIELDS = ["eventId"]; 2805 2806 public ubyte eventId; 2807 2808 public pure nothrow @safe @nogc this() {} 2809 2810 public pure nothrow @safe @nogc this(ubyte eventId) { 2811 this.eventId = eventId; 2812 } 2813 2814 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2815 _buffer.length = 0; 2816 static if(writeId){ writeBytes(varuint.encode(ID)); } 2817 writeBigEndianUbyte(eventId); 2818 return _buffer; 2819 } 2820 2821 public pure nothrow @safe void decode(bool readId=true)() { 2822 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2823 eventId=readBigEndianUbyte(); 2824 } 2825 2826 public static pure nothrow @safe CombatEvent fromBuffer(bool readId=true)(ubyte[] buffer) { 2827 CombatEvent ret = new CombatEvent(); 2828 ret._buffer = buffer; 2829 ret.decode!readId(); 2830 return ret; 2831 } 2832 2833 public override string toString() { 2834 return "CombatEvent(eventId: " ~ std.conv.to!string(this.eventId) ~ ")"; 2835 } 2836 2837 alias _encode = encode; 2838 2839 enum string variantField = "eventId"; 2840 2841 alias Variants = TypeTuple!(EnterCombat, EndCombat, EntityDead); 2842 2843 public class EnterCombat { 2844 2845 public enum typeof(eventId) EVENT_ID = 0; 2846 2847 public enum string[] FIELDS = []; 2848 2849 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2850 eventId = 0; 2851 _encode!writeId(); 2852 return _buffer; 2853 } 2854 2855 public pure nothrow @safe void decode() { 2856 } 2857 2858 public override string toString() { 2859 return "CombatEvent.EnterCombat()"; 2860 } 2861 2862 } 2863 2864 public class EndCombat { 2865 2866 public enum typeof(eventId) EVENT_ID = 1; 2867 2868 public enum string[] FIELDS = ["duration", "entityId"]; 2869 2870 public uint duration; 2871 public uint entityId; 2872 2873 public pure nothrow @safe @nogc this() {} 2874 2875 public pure nothrow @safe @nogc this(uint duration, uint entityId=uint.init) { 2876 this.duration = duration; 2877 this.entityId = entityId; 2878 } 2879 2880 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2881 eventId = 1; 2882 _encode!writeId(); 2883 writeBytes(varuint.encode(duration)); 2884 writeBigEndianUint(entityId); 2885 return _buffer; 2886 } 2887 2888 public pure nothrow @safe void decode() { 2889 duration=varuint.decode(_buffer, &_index); 2890 entityId=readBigEndianUint(); 2891 } 2892 2893 public override string toString() { 2894 return "CombatEvent.EndCombat(duration: " ~ std.conv.to!string(this.duration) ~ ", entityId: " ~ std.conv.to!string(this.entityId) ~ ")"; 2895 } 2896 2897 } 2898 2899 public class EntityDead { 2900 2901 public enum typeof(eventId) EVENT_ID = 2; 2902 2903 public enum string[] FIELDS = ["playerId", "entityId", "message"]; 2904 2905 public uint playerId; 2906 public uint entityId; 2907 public string message; 2908 2909 public pure nothrow @safe @nogc this() {} 2910 2911 public pure nothrow @safe @nogc this(uint playerId, uint entityId=uint.init, string message=string.init) { 2912 this.playerId = playerId; 2913 this.entityId = entityId; 2914 this.message = message; 2915 } 2916 2917 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2918 eventId = 2; 2919 _encode!writeId(); 2920 writeBytes(varuint.encode(playerId)); 2921 writeBigEndianUint(entityId); 2922 writeBytes(varuint.encode(cast(uint)message.length)); writeString(message); 2923 return _buffer; 2924 } 2925 2926 public pure nothrow @safe void decode() { 2927 playerId=varuint.decode(_buffer, &_index); 2928 entityId=readBigEndianUint(); 2929 uint bvcfz=varuint.decode(_buffer, &_index); message=readString(bvcfz); 2930 } 2931 2932 public override string toString() { 2933 return "CombatEvent.EntityDead(playerId: " ~ std.conv.to!string(this.playerId) ~ ", entityId: " ~ std.conv.to!string(this.entityId) ~ ", message: " ~ std.conv.to!string(this.message) ~ ")"; 2934 } 2935 2936 } 2937 2938 } 2939 2940 class PlayerListItem : Buffer { 2941 2942 public enum uint ID = 45; 2943 2944 public enum bool CLIENTBOUND = true; 2945 public enum bool SERVERBOUND = false; 2946 2947 public enum string[] FIELDS = ["action"]; 2948 2949 public uint action; 2950 2951 public pure nothrow @safe @nogc this() {} 2952 2953 public pure nothrow @safe @nogc this(uint action) { 2954 this.action = action; 2955 } 2956 2957 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 2958 _buffer.length = 0; 2959 static if(writeId){ writeBytes(varuint.encode(ID)); } 2960 writeBytes(varuint.encode(action)); 2961 return _buffer; 2962 } 2963 2964 public pure nothrow @safe void decode(bool readId=true)() { 2965 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 2966 action=varuint.decode(_buffer, &_index); 2967 } 2968 2969 public static pure nothrow @safe PlayerListItem fromBuffer(bool readId=true)(ubyte[] buffer) { 2970 PlayerListItem ret = new PlayerListItem(); 2971 ret._buffer = buffer; 2972 ret.decode!readId(); 2973 return ret; 2974 } 2975 2976 public override string toString() { 2977 return "PlayerListItem(action: " ~ std.conv.to!string(this.action) ~ ")"; 2978 } 2979 2980 alias _encode = encode; 2981 2982 enum string variantField = "action"; 2983 2984 alias Variants = TypeTuple!(AddPlayer, UpdateGamemode, UpdateLatency, UpdateDisplayName, RemovePlayer); 2985 2986 public class AddPlayer { 2987 2988 public enum typeof(action) ACTION = 0; 2989 2990 public enum string[] FIELDS = ["players"]; 2991 2992 public sul.protocol.java335.types.ListAddPlayer[] players; 2993 2994 public pure nothrow @safe @nogc this() {} 2995 2996 public pure nothrow @safe @nogc this(sul.protocol.java335.types.ListAddPlayer[] players) { 2997 this.players = players; 2998 } 2999 3000 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3001 action = 0; 3002 _encode!writeId(); 3003 writeBytes(varuint.encode(cast(uint)players.length)); foreach(cxevc;players){ cxevc.encode(bufferInstance); } 3004 return _buffer; 3005 } 3006 3007 public pure nothrow @safe void decode() { 3008 players.length=varuint.decode(_buffer, &_index); foreach(ref cxevc;players){ cxevc.decode(bufferInstance); } 3009 } 3010 3011 public override string toString() { 3012 return "PlayerListItem.AddPlayer(players: " ~ std.conv.to!string(this.players) ~ ")"; 3013 } 3014 3015 } 3016 3017 public class UpdateGamemode { 3018 3019 public enum typeof(action) ACTION = 1; 3020 3021 public enum string[] FIELDS = ["players"]; 3022 3023 public sul.protocol.java335.types.ListUpdateGamemode[] players; 3024 3025 public pure nothrow @safe @nogc this() {} 3026 3027 public pure nothrow @safe @nogc this(sul.protocol.java335.types.ListUpdateGamemode[] players) { 3028 this.players = players; 3029 } 3030 3031 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3032 action = 1; 3033 _encode!writeId(); 3034 writeBytes(varuint.encode(cast(uint)players.length)); foreach(cxevc;players){ cxevc.encode(bufferInstance); } 3035 return _buffer; 3036 } 3037 3038 public pure nothrow @safe void decode() { 3039 players.length=varuint.decode(_buffer, &_index); foreach(ref cxevc;players){ cxevc.decode(bufferInstance); } 3040 } 3041 3042 public override string toString() { 3043 return "PlayerListItem.UpdateGamemode(players: " ~ std.conv.to!string(this.players) ~ ")"; 3044 } 3045 3046 } 3047 3048 public class UpdateLatency { 3049 3050 public enum typeof(action) ACTION = 2; 3051 3052 public enum string[] FIELDS = ["players"]; 3053 3054 public sul.protocol.java335.types.ListUpdateLatency[] players; 3055 3056 public pure nothrow @safe @nogc this() {} 3057 3058 public pure nothrow @safe @nogc this(sul.protocol.java335.types.ListUpdateLatency[] players) { 3059 this.players = players; 3060 } 3061 3062 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3063 action = 2; 3064 _encode!writeId(); 3065 writeBytes(varuint.encode(cast(uint)players.length)); foreach(cxevc;players){ cxevc.encode(bufferInstance); } 3066 return _buffer; 3067 } 3068 3069 public pure nothrow @safe void decode() { 3070 players.length=varuint.decode(_buffer, &_index); foreach(ref cxevc;players){ cxevc.decode(bufferInstance); } 3071 } 3072 3073 public override string toString() { 3074 return "PlayerListItem.UpdateLatency(players: " ~ std.conv.to!string(this.players) ~ ")"; 3075 } 3076 3077 } 3078 3079 public class UpdateDisplayName { 3080 3081 public enum typeof(action) ACTION = 3; 3082 3083 public enum string[] FIELDS = ["players"]; 3084 3085 public sul.protocol.java335.types.ListUpdateDisplayName[] players; 3086 3087 public pure nothrow @safe @nogc this() {} 3088 3089 public pure nothrow @safe @nogc this(sul.protocol.java335.types.ListUpdateDisplayName[] players) { 3090 this.players = players; 3091 } 3092 3093 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3094 action = 3; 3095 _encode!writeId(); 3096 writeBytes(varuint.encode(cast(uint)players.length)); foreach(cxevc;players){ cxevc.encode(bufferInstance); } 3097 return _buffer; 3098 } 3099 3100 public pure nothrow @safe void decode() { 3101 players.length=varuint.decode(_buffer, &_index); foreach(ref cxevc;players){ cxevc.decode(bufferInstance); } 3102 } 3103 3104 public override string toString() { 3105 return "PlayerListItem.UpdateDisplayName(players: " ~ std.conv.to!string(this.players) ~ ")"; 3106 } 3107 3108 } 3109 3110 public class RemovePlayer { 3111 3112 public enum typeof(action) ACTION = 4; 3113 3114 public enum string[] FIELDS = ["players"]; 3115 3116 public UUID[] players; 3117 3118 public pure nothrow @safe @nogc this() {} 3119 3120 public pure nothrow @safe @nogc this(UUID[] players) { 3121 this.players = players; 3122 } 3123 3124 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3125 action = 4; 3126 _encode!writeId(); 3127 writeBytes(varuint.encode(cast(uint)players.length)); foreach(cxevc;players){ writeBytes(cxevc.data); } 3128 return _buffer; 3129 } 3130 3131 public pure nothrow @safe void decode() { 3132 players.length=varuint.decode(_buffer, &_index); foreach(ref cxevc;players){ if(_buffer.length>=_index+16){ ubyte[16] yhdm=_buffer[_index.._index+16].dup; _index+=16; cxevc=UUID(yhdm); } } 3133 } 3134 3135 public override string toString() { 3136 return "PlayerListItem.RemovePlayer(players: " ~ std.conv.to!string(this.players) ~ ")"; 3137 } 3138 3139 } 3140 3141 } 3142 3143 class PlayerPositionAndLook : Buffer { 3144 3145 public enum uint ID = 46; 3146 3147 public enum bool CLIENTBOUND = true; 3148 public enum bool SERVERBOUND = false; 3149 3150 // flags 3151 public enum ubyte X = 1; 3152 public enum ubyte Y = 2; 3153 public enum ubyte Z = 4; 3154 public enum ubyte Y_ROTATION = 8; 3155 public enum ubyte X_ROTATION = 16; 3156 3157 public enum string[] FIELDS = ["position", "yaw", "pitch", "flags", "teleportId"]; 3158 3159 public Tuple!(double, "x", double, "y", double, "z") position; 3160 public float yaw; 3161 public float pitch; 3162 public ubyte flags; 3163 public uint teleportId; 3164 3165 public pure nothrow @safe @nogc this() {} 3166 3167 public pure nothrow @safe @nogc this(Tuple!(double, "x", double, "y", double, "z") position, float yaw=float.init, float pitch=float.init, ubyte flags=ubyte.init, uint teleportId=uint.init) { 3168 this.position = position; 3169 this.yaw = yaw; 3170 this.pitch = pitch; 3171 this.flags = flags; 3172 this.teleportId = teleportId; 3173 } 3174 3175 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3176 _buffer.length = 0; 3177 static if(writeId){ writeBytes(varuint.encode(ID)); } 3178 writeBigEndianDouble(position.x); writeBigEndianDouble(position.y); writeBigEndianDouble(position.z); 3179 writeBigEndianFloat(yaw); 3180 writeBigEndianFloat(pitch); 3181 writeBigEndianUbyte(flags); 3182 writeBytes(varuint.encode(teleportId)); 3183 return _buffer; 3184 } 3185 3186 public pure nothrow @safe void decode(bool readId=true)() { 3187 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 3188 position.x=readBigEndianDouble(); position.y=readBigEndianDouble(); position.z=readBigEndianDouble(); 3189 yaw=readBigEndianFloat(); 3190 pitch=readBigEndianFloat(); 3191 flags=readBigEndianUbyte(); 3192 teleportId=varuint.decode(_buffer, &_index); 3193 } 3194 3195 public static pure nothrow @safe PlayerPositionAndLook fromBuffer(bool readId=true)(ubyte[] buffer) { 3196 PlayerPositionAndLook ret = new PlayerPositionAndLook(); 3197 ret._buffer = buffer; 3198 ret.decode!readId(); 3199 return ret; 3200 } 3201 3202 public override string toString() { 3203 return "PlayerPositionAndLook(position: " ~ std.conv.to!string(this.position) ~ ", yaw: " ~ std.conv.to!string(this.yaw) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ", flags: " ~ std.conv.to!string(this.flags) ~ ", teleportId: " ~ std.conv.to!string(this.teleportId) ~ ")"; 3204 } 3205 3206 } 3207 3208 class UseBed : Buffer { 3209 3210 public enum uint ID = 47; 3211 3212 public enum bool CLIENTBOUND = true; 3213 public enum bool SERVERBOUND = false; 3214 3215 public enum string[] FIELDS = ["entityId", "position"]; 3216 3217 public uint entityId; 3218 public ulong position; 3219 3220 public pure nothrow @safe @nogc this() {} 3221 3222 public pure nothrow @safe @nogc this(uint entityId, ulong position=ulong.init) { 3223 this.entityId = entityId; 3224 this.position = position; 3225 } 3226 3227 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3228 _buffer.length = 0; 3229 static if(writeId){ writeBytes(varuint.encode(ID)); } 3230 writeBytes(varuint.encode(entityId)); 3231 writeBigEndianUlong(position); 3232 return _buffer; 3233 } 3234 3235 public pure nothrow @safe void decode(bool readId=true)() { 3236 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 3237 entityId=varuint.decode(_buffer, &_index); 3238 position=readBigEndianUlong(); 3239 } 3240 3241 public static pure nothrow @safe UseBed fromBuffer(bool readId=true)(ubyte[] buffer) { 3242 UseBed ret = new UseBed(); 3243 ret._buffer = buffer; 3244 ret.decode!readId(); 3245 return ret; 3246 } 3247 3248 public override string toString() { 3249 return "UseBed(entityId: " ~ std.conv.to!string(this.entityId) ~ ", position: " ~ std.conv.to!string(this.position) ~ ")"; 3250 } 3251 3252 } 3253 3254 class UnlockRecipes : Buffer { 3255 3256 public enum uint ID = 48; 3257 3258 public enum bool CLIENTBOUND = true; 3259 public enum bool SERVERBOUND = false; 3260 3261 // action 3262 public enum uint ADD = 1; 3263 public enum uint REMOVE = 2; 3264 public enum uint ADD_WITHOUT_NOTIFICATION = 3; 3265 3266 public enum string[] FIELDS = ["action", "openBook", "filtering", "recipes", "bookRecipes"]; 3267 3268 public uint action; 3269 public bool openBook; 3270 public bool filtering; 3271 public uint[] recipes; 3272 public uint[] bookRecipes; 3273 3274 public pure nothrow @safe @nogc this() {} 3275 3276 public pure nothrow @safe @nogc this(uint action, bool openBook=bool.init, bool filtering=bool.init, uint[] recipes=(uint[]).init, uint[] bookRecipes=(uint[]).init) { 3277 this.action = action; 3278 this.openBook = openBook; 3279 this.filtering = filtering; 3280 this.recipes = recipes; 3281 this.bookRecipes = bookRecipes; 3282 } 3283 3284 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3285 _buffer.length = 0; 3286 static if(writeId){ writeBytes(varuint.encode(ID)); } 3287 writeBytes(varuint.encode(action)); 3288 writeBigEndianBool(openBook); 3289 writeBigEndianBool(filtering); 3290 writeBytes(varuint.encode(cast(uint)recipes.length)); foreach(cvabc;recipes){ writeBytes(varuint.encode(cvabc)); } 3291 if(action==1||action==3){ writeBytes(varuint.encode(cast(uint)bookRecipes.length)); foreach(y9ajylzm;bookRecipes){ writeBytes(varuint.encode(y9ajylzm)); } } 3292 return _buffer; 3293 } 3294 3295 public pure nothrow @safe void decode(bool readId=true)() { 3296 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 3297 action=varuint.decode(_buffer, &_index); 3298 openBook=readBigEndianBool(); 3299 filtering=readBigEndianBool(); 3300 recipes.length=varuint.decode(_buffer, &_index); foreach(ref cvabc;recipes){ cvabc=varuint.decode(_buffer, &_index); } 3301 if(action==1||action==3){ bookRecipes.length=varuint.decode(_buffer, &_index); foreach(ref y9ajylzm;bookRecipes){ y9ajylzm=varuint.decode(_buffer, &_index); } } 3302 } 3303 3304 public static pure nothrow @safe UnlockRecipes fromBuffer(bool readId=true)(ubyte[] buffer) { 3305 UnlockRecipes ret = new UnlockRecipes(); 3306 ret._buffer = buffer; 3307 ret.decode!readId(); 3308 return ret; 3309 } 3310 3311 public override string toString() { 3312 return "UnlockRecipes(action: " ~ std.conv.to!string(this.action) ~ ", openBook: " ~ std.conv.to!string(this.openBook) ~ ", filtering: " ~ std.conv.to!string(this.filtering) ~ ", recipes: " ~ std.conv.to!string(this.recipes) ~ ", bookRecipes: " ~ std.conv.to!string(this.bookRecipes) ~ ")"; 3313 } 3314 3315 } 3316 3317 class DestroyEntities : Buffer { 3318 3319 public enum uint ID = 49; 3320 3321 public enum bool CLIENTBOUND = true; 3322 public enum bool SERVERBOUND = false; 3323 3324 public enum string[] FIELDS = ["entityIds"]; 3325 3326 public uint[] entityIds; 3327 3328 public pure nothrow @safe @nogc this() {} 3329 3330 public pure nothrow @safe @nogc this(uint[] entityIds) { 3331 this.entityIds = entityIds; 3332 } 3333 3334 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3335 _buffer.length = 0; 3336 static if(writeId){ writeBytes(varuint.encode(ID)); } 3337 writeBytes(varuint.encode(cast(uint)entityIds.length)); foreach(z5arsr;entityIds){ writeBytes(varuint.encode(z5arsr)); } 3338 return _buffer; 3339 } 3340 3341 public pure nothrow @safe void decode(bool readId=true)() { 3342 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 3343 entityIds.length=varuint.decode(_buffer, &_index); foreach(ref z5arsr;entityIds){ z5arsr=varuint.decode(_buffer, &_index); } 3344 } 3345 3346 public static pure nothrow @safe DestroyEntities fromBuffer(bool readId=true)(ubyte[] buffer) { 3347 DestroyEntities ret = new DestroyEntities(); 3348 ret._buffer = buffer; 3349 ret.decode!readId(); 3350 return ret; 3351 } 3352 3353 public override string toString() { 3354 return "DestroyEntities(entityIds: " ~ std.conv.to!string(this.entityIds) ~ ")"; 3355 } 3356 3357 } 3358 3359 class RemoveEntityEffect : Buffer { 3360 3361 public enum uint ID = 50; 3362 3363 public enum bool CLIENTBOUND = true; 3364 public enum bool SERVERBOUND = false; 3365 3366 public enum string[] FIELDS = ["entityId", "effectId"]; 3367 3368 public uint entityId; 3369 public ubyte effectId; 3370 3371 public pure nothrow @safe @nogc this() {} 3372 3373 public pure nothrow @safe @nogc this(uint entityId, ubyte effectId=ubyte.init) { 3374 this.entityId = entityId; 3375 this.effectId = effectId; 3376 } 3377 3378 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3379 _buffer.length = 0; 3380 static if(writeId){ writeBytes(varuint.encode(ID)); } 3381 writeBytes(varuint.encode(entityId)); 3382 writeBigEndianUbyte(effectId); 3383 return _buffer; 3384 } 3385 3386 public pure nothrow @safe void decode(bool readId=true)() { 3387 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 3388 entityId=varuint.decode(_buffer, &_index); 3389 effectId=readBigEndianUbyte(); 3390 } 3391 3392 public static pure nothrow @safe RemoveEntityEffect fromBuffer(bool readId=true)(ubyte[] buffer) { 3393 RemoveEntityEffect ret = new RemoveEntityEffect(); 3394 ret._buffer = buffer; 3395 ret.decode!readId(); 3396 return ret; 3397 } 3398 3399 public override string toString() { 3400 return "RemoveEntityEffect(entityId: " ~ std.conv.to!string(this.entityId) ~ ", effectId: " ~ std.conv.to!string(this.effectId) ~ ")"; 3401 } 3402 3403 } 3404 3405 class ResourcePackSend : Buffer { 3406 3407 public enum uint ID = 51; 3408 3409 public enum bool CLIENTBOUND = true; 3410 public enum bool SERVERBOUND = false; 3411 3412 public enum string[] FIELDS = ["url", "hash"]; 3413 3414 public string url; 3415 public string hash; 3416 3417 public pure nothrow @safe @nogc this() {} 3418 3419 public pure nothrow @safe @nogc this(string url, string hash=string.init) { 3420 this.url = url; 3421 this.hash = hash; 3422 } 3423 3424 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3425 _buffer.length = 0; 3426 static if(writeId){ writeBytes(varuint.encode(ID)); } 3427 writeBytes(varuint.encode(cast(uint)url.length)); writeString(url); 3428 writeBytes(varuint.encode(cast(uint)hash.length)); writeString(hash); 3429 return _buffer; 3430 } 3431 3432 public pure nothrow @safe void decode(bool readId=true)() { 3433 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 3434 uint dj=varuint.decode(_buffer, &_index); url=readString(dj); 3435 uint afa=varuint.decode(_buffer, &_index); hash=readString(afa); 3436 } 3437 3438 public static pure nothrow @safe ResourcePackSend fromBuffer(bool readId=true)(ubyte[] buffer) { 3439 ResourcePackSend ret = new ResourcePackSend(); 3440 ret._buffer = buffer; 3441 ret.decode!readId(); 3442 return ret; 3443 } 3444 3445 public override string toString() { 3446 return "ResourcePackSend(url: " ~ std.conv.to!string(this.url) ~ ", hash: " ~ std.conv.to!string(this.hash) ~ ")"; 3447 } 3448 3449 } 3450 3451 class Respawn : Buffer { 3452 3453 public enum uint ID = 52; 3454 3455 public enum bool CLIENTBOUND = true; 3456 public enum bool SERVERBOUND = false; 3457 3458 // dimension 3459 public enum int NETHER = -1; 3460 public enum int OVERWORLD = 0; 3461 public enum int END = 1; 3462 3463 // difficulty 3464 public enum ubyte PEACEFUL = 0; 3465 public enum ubyte EASY = 1; 3466 public enum ubyte NORMAL = 2; 3467 public enum ubyte HARD = 3; 3468 3469 // gamemode 3470 public enum ubyte SURVIVAL = 0; 3471 public enum ubyte CREATIVE = 1; 3472 public enum ubyte ADVENTURE = 2; 3473 public enum ubyte SPECTATOR = 3; 3474 3475 // level type 3476 public enum string INFINITY = "default"; 3477 public enum string FLAT = "flat"; 3478 public enum string AMPLIFIED = "amplified"; 3479 public enum string LARGE_BIOMES = "largeBiomes"; 3480 3481 public enum string[] FIELDS = ["dimension", "difficulty", "gamemode", "levelType"]; 3482 3483 public int dimension; 3484 public ubyte difficulty; 3485 public ubyte gamemode; 3486 public string levelType; 3487 3488 public pure nothrow @safe @nogc this() {} 3489 3490 public pure nothrow @safe @nogc this(int dimension, ubyte difficulty=ubyte.init, ubyte gamemode=ubyte.init, string levelType=string.init) { 3491 this.dimension = dimension; 3492 this.difficulty = difficulty; 3493 this.gamemode = gamemode; 3494 this.levelType = levelType; 3495 } 3496 3497 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3498 _buffer.length = 0; 3499 static if(writeId){ writeBytes(varuint.encode(ID)); } 3500 writeBigEndianInt(dimension); 3501 writeBigEndianUbyte(difficulty); 3502 writeBigEndianUbyte(gamemode); 3503 writeBytes(varuint.encode(cast(uint)levelType.length)); writeString(levelType); 3504 return _buffer; 3505 } 3506 3507 public pure nothrow @safe void decode(bool readId=true)() { 3508 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 3509 dimension=readBigEndianInt(); 3510 difficulty=readBigEndianUbyte(); 3511 gamemode=readBigEndianUbyte(); 3512 uint bvzxeb=varuint.decode(_buffer, &_index); levelType=readString(bvzxeb); 3513 } 3514 3515 public static pure nothrow @safe Respawn fromBuffer(bool readId=true)(ubyte[] buffer) { 3516 Respawn ret = new Respawn(); 3517 ret._buffer = buffer; 3518 ret.decode!readId(); 3519 return ret; 3520 } 3521 3522 public override string toString() { 3523 return "Respawn(dimension: " ~ std.conv.to!string(this.dimension) ~ ", difficulty: " ~ std.conv.to!string(this.difficulty) ~ ", gamemode: " ~ std.conv.to!string(this.gamemode) ~ ", levelType: " ~ std.conv.to!string(this.levelType) ~ ")"; 3524 } 3525 3526 } 3527 3528 class EntityHeadLook : Buffer { 3529 3530 public enum uint ID = 53; 3531 3532 public enum bool CLIENTBOUND = true; 3533 public enum bool SERVERBOUND = false; 3534 3535 public enum string[] FIELDS = ["entityId", "headYaw"]; 3536 3537 public uint entityId; 3538 public ubyte headYaw; 3539 3540 public pure nothrow @safe @nogc this() {} 3541 3542 public pure nothrow @safe @nogc this(uint entityId, ubyte headYaw=ubyte.init) { 3543 this.entityId = entityId; 3544 this.headYaw = headYaw; 3545 } 3546 3547 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3548 _buffer.length = 0; 3549 static if(writeId){ writeBytes(varuint.encode(ID)); } 3550 writeBytes(varuint.encode(entityId)); 3551 writeBigEndianUbyte(headYaw); 3552 return _buffer; 3553 } 3554 3555 public pure nothrow @safe void decode(bool readId=true)() { 3556 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 3557 entityId=varuint.decode(_buffer, &_index); 3558 headYaw=readBigEndianUbyte(); 3559 } 3560 3561 public static pure nothrow @safe EntityHeadLook fromBuffer(bool readId=true)(ubyte[] buffer) { 3562 EntityHeadLook ret = new EntityHeadLook(); 3563 ret._buffer = buffer; 3564 ret.decode!readId(); 3565 return ret; 3566 } 3567 3568 public override string toString() { 3569 return "EntityHeadLook(entityId: " ~ std.conv.to!string(this.entityId) ~ ", headYaw: " ~ std.conv.to!string(this.headYaw) ~ ")"; 3570 } 3571 3572 } 3573 3574 class AdvancementProgress : Buffer { 3575 3576 public enum uint ID = 54; 3577 3578 public enum bool CLIENTBOUND = true; 3579 public enum bool SERVERBOUND = false; 3580 3581 public enum string[] FIELDS = ["notEmpty", "identifier"]; 3582 3583 public bool notEmpty; 3584 public string identifier; 3585 3586 public pure nothrow @safe @nogc this() {} 3587 3588 public pure nothrow @safe @nogc this(bool notEmpty, string identifier=string.init) { 3589 this.notEmpty = notEmpty; 3590 this.identifier = identifier; 3591 } 3592 3593 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3594 _buffer.length = 0; 3595 static if(writeId){ writeBytes(varuint.encode(ID)); } 3596 writeBigEndianBool(notEmpty); 3597 if(notEmpty==true){ writeBytes(varuint.encode(cast(uint)identifier.length)); writeString(identifier); } 3598 return _buffer; 3599 } 3600 3601 public pure nothrow @safe void decode(bool readId=true)() { 3602 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 3603 notEmpty=readBigEndianBool(); 3604 if(notEmpty==true){ uint arbrzlc=varuint.decode(_buffer, &_index); identifier=readString(arbrzlc); } 3605 } 3606 3607 public static pure nothrow @safe AdvancementProgress fromBuffer(bool readId=true)(ubyte[] buffer) { 3608 AdvancementProgress ret = new AdvancementProgress(); 3609 ret._buffer = buffer; 3610 ret.decode!readId(); 3611 return ret; 3612 } 3613 3614 public override string toString() { 3615 return "AdvancementProgress(notEmpty: " ~ std.conv.to!string(this.notEmpty) ~ ", identifier: " ~ std.conv.to!string(this.identifier) ~ ")"; 3616 } 3617 3618 } 3619 3620 class WorldBorder : Buffer { 3621 3622 public enum uint ID = 55; 3623 3624 public enum bool CLIENTBOUND = true; 3625 public enum bool SERVERBOUND = false; 3626 3627 public enum string[] FIELDS = ["action"]; 3628 3629 public uint action; 3630 3631 public pure nothrow @safe @nogc this() {} 3632 3633 public pure nothrow @safe @nogc this(uint action) { 3634 this.action = action; 3635 } 3636 3637 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3638 _buffer.length = 0; 3639 static if(writeId){ writeBytes(varuint.encode(ID)); } 3640 writeBytes(varuint.encode(action)); 3641 return _buffer; 3642 } 3643 3644 public pure nothrow @safe void decode(bool readId=true)() { 3645 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 3646 action=varuint.decode(_buffer, &_index); 3647 } 3648 3649 public static pure nothrow @safe WorldBorder fromBuffer(bool readId=true)(ubyte[] buffer) { 3650 WorldBorder ret = new WorldBorder(); 3651 ret._buffer = buffer; 3652 ret.decode!readId(); 3653 return ret; 3654 } 3655 3656 public override string toString() { 3657 return "WorldBorder(action: " ~ std.conv.to!string(this.action) ~ ")"; 3658 } 3659 3660 alias _encode = encode; 3661 3662 enum string variantField = "action"; 3663 3664 alias Variants = TypeTuple!(SetSize, LerpSize, SetCenter, Initialize, SetWarningTime, SetWarningBlocks); 3665 3666 public class SetSize { 3667 3668 public enum typeof(action) ACTION = 0; 3669 3670 public enum string[] FIELDS = ["diameter"]; 3671 3672 public double diameter; 3673 3674 public pure nothrow @safe @nogc this() {} 3675 3676 public pure nothrow @safe @nogc this(double diameter) { 3677 this.diameter = diameter; 3678 } 3679 3680 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3681 action = 0; 3682 _encode!writeId(); 3683 writeBigEndianDouble(diameter); 3684 return _buffer; 3685 } 3686 3687 public pure nothrow @safe void decode() { 3688 diameter=readBigEndianDouble(); 3689 } 3690 3691 public override string toString() { 3692 return "WorldBorder.SetSize(diameter: " ~ std.conv.to!string(this.diameter) ~ ")"; 3693 } 3694 3695 } 3696 3697 public class LerpSize { 3698 3699 public enum typeof(action) ACTION = 1; 3700 3701 public enum string[] FIELDS = ["oldDiameter", "newDiameter", "speed"]; 3702 3703 public double oldDiameter; 3704 public double newDiameter; 3705 public ulong speed; 3706 3707 public pure nothrow @safe @nogc this() {} 3708 3709 public pure nothrow @safe @nogc this(double oldDiameter, double newDiameter=double.init, ulong speed=ulong.init) { 3710 this.oldDiameter = oldDiameter; 3711 this.newDiameter = newDiameter; 3712 this.speed = speed; 3713 } 3714 3715 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3716 action = 1; 3717 _encode!writeId(); 3718 writeBigEndianDouble(oldDiameter); 3719 writeBigEndianDouble(newDiameter); 3720 writeBytes(varulong.encode(speed)); 3721 return _buffer; 3722 } 3723 3724 public pure nothrow @safe void decode() { 3725 oldDiameter=readBigEndianDouble(); 3726 newDiameter=readBigEndianDouble(); 3727 speed=varulong.decode(_buffer, &_index); 3728 } 3729 3730 public override string toString() { 3731 return "WorldBorder.LerpSize(oldDiameter: " ~ std.conv.to!string(this.oldDiameter) ~ ", newDiameter: " ~ std.conv.to!string(this.newDiameter) ~ ", speed: " ~ std.conv.to!string(this.speed) ~ ")"; 3732 } 3733 3734 } 3735 3736 public class SetCenter { 3737 3738 public enum typeof(action) ACTION = 2; 3739 3740 public enum string[] FIELDS = ["center"]; 3741 3742 public Tuple!(double, "x", double, "y", double, "z") center; 3743 3744 public pure nothrow @safe @nogc this() {} 3745 3746 public pure nothrow @safe @nogc this(Tuple!(double, "x", double, "y", double, "z") center) { 3747 this.center = center; 3748 } 3749 3750 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3751 action = 2; 3752 _encode!writeId(); 3753 writeBigEndianDouble(center.x); writeBigEndianDouble(center.y); writeBigEndianDouble(center.z); 3754 return _buffer; 3755 } 3756 3757 public pure nothrow @safe void decode() { 3758 center.x=readBigEndianDouble(); center.y=readBigEndianDouble(); center.z=readBigEndianDouble(); 3759 } 3760 3761 public override string toString() { 3762 return "WorldBorder.SetCenter(center: " ~ std.conv.to!string(this.center) ~ ")"; 3763 } 3764 3765 } 3766 3767 public class Initialize { 3768 3769 public enum typeof(action) ACTION = 3; 3770 3771 public enum string[] FIELDS = ["center", "oldDiameter", "newDiameter", "speed", "portalTeleportBoundary", "warningTime", "warningBlocks"]; 3772 3773 public Tuple!(double, "x", double, "y", double, "z") center; 3774 public double oldDiameter; 3775 public double newDiameter; 3776 public ulong speed; 3777 public uint portalTeleportBoundary; 3778 public uint warningTime; 3779 public uint warningBlocks; 3780 3781 public pure nothrow @safe @nogc this() {} 3782 3783 public pure nothrow @safe @nogc this(Tuple!(double, "x", double, "y", double, "z") center, double oldDiameter=double.init, double newDiameter=double.init, ulong speed=ulong.init, uint portalTeleportBoundary=uint.init, uint warningTime=uint.init, uint warningBlocks=uint.init) { 3784 this.center = center; 3785 this.oldDiameter = oldDiameter; 3786 this.newDiameter = newDiameter; 3787 this.speed = speed; 3788 this.portalTeleportBoundary = portalTeleportBoundary; 3789 this.warningTime = warningTime; 3790 this.warningBlocks = warningBlocks; 3791 } 3792 3793 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3794 action = 3; 3795 _encode!writeId(); 3796 writeBigEndianDouble(center.x); writeBigEndianDouble(center.y); writeBigEndianDouble(center.z); 3797 writeBigEndianDouble(oldDiameter); 3798 writeBigEndianDouble(newDiameter); 3799 writeBytes(varulong.encode(speed)); 3800 writeBytes(varuint.encode(portalTeleportBoundary)); 3801 writeBytes(varuint.encode(warningTime)); 3802 writeBytes(varuint.encode(warningBlocks)); 3803 return _buffer; 3804 } 3805 3806 public pure nothrow @safe void decode() { 3807 center.x=readBigEndianDouble(); center.y=readBigEndianDouble(); center.z=readBigEndianDouble(); 3808 oldDiameter=readBigEndianDouble(); 3809 newDiameter=readBigEndianDouble(); 3810 speed=varulong.decode(_buffer, &_index); 3811 portalTeleportBoundary=varuint.decode(_buffer, &_index); 3812 warningTime=varuint.decode(_buffer, &_index); 3813 warningBlocks=varuint.decode(_buffer, &_index); 3814 } 3815 3816 public override string toString() { 3817 return "WorldBorder.Initialize(center: " ~ std.conv.to!string(this.center) ~ ", oldDiameter: " ~ std.conv.to!string(this.oldDiameter) ~ ", newDiameter: " ~ std.conv.to!string(this.newDiameter) ~ ", speed: " ~ std.conv.to!string(this.speed) ~ ", portalTeleportBoundary: " ~ std.conv.to!string(this.portalTeleportBoundary) ~ ", warningTime: " ~ std.conv.to!string(this.warningTime) ~ ", warningBlocks: " ~ std.conv.to!string(this.warningBlocks) ~ ")"; 3818 } 3819 3820 } 3821 3822 public class SetWarningTime { 3823 3824 public enum typeof(action) ACTION = 4; 3825 3826 public enum string[] FIELDS = ["warningTime"]; 3827 3828 public uint warningTime; 3829 3830 public pure nothrow @safe @nogc this() {} 3831 3832 public pure nothrow @safe @nogc this(uint warningTime) { 3833 this.warningTime = warningTime; 3834 } 3835 3836 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3837 action = 4; 3838 _encode!writeId(); 3839 writeBytes(varuint.encode(warningTime)); 3840 return _buffer; 3841 } 3842 3843 public pure nothrow @safe void decode() { 3844 warningTime=varuint.decode(_buffer, &_index); 3845 } 3846 3847 public override string toString() { 3848 return "WorldBorder.SetWarningTime(warningTime: " ~ std.conv.to!string(this.warningTime) ~ ")"; 3849 } 3850 3851 } 3852 3853 public class SetWarningBlocks { 3854 3855 public enum typeof(action) ACTION = 5; 3856 3857 public enum string[] FIELDS = ["warningBlocks"]; 3858 3859 public uint warningBlocks; 3860 3861 public pure nothrow @safe @nogc this() {} 3862 3863 public pure nothrow @safe @nogc this(uint warningBlocks) { 3864 this.warningBlocks = warningBlocks; 3865 } 3866 3867 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3868 action = 5; 3869 _encode!writeId(); 3870 writeBytes(varuint.encode(warningBlocks)); 3871 return _buffer; 3872 } 3873 3874 public pure nothrow @safe void decode() { 3875 warningBlocks=varuint.decode(_buffer, &_index); 3876 } 3877 3878 public override string toString() { 3879 return "WorldBorder.SetWarningBlocks(warningBlocks: " ~ std.conv.to!string(this.warningBlocks) ~ ")"; 3880 } 3881 3882 } 3883 3884 } 3885 3886 class Camera : Buffer { 3887 3888 public enum uint ID = 56; 3889 3890 public enum bool CLIENTBOUND = true; 3891 public enum bool SERVERBOUND = false; 3892 3893 public enum string[] FIELDS = ["entityId"]; 3894 3895 public uint entityId; 3896 3897 public pure nothrow @safe @nogc this() {} 3898 3899 public pure nothrow @safe @nogc this(uint entityId) { 3900 this.entityId = entityId; 3901 } 3902 3903 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3904 _buffer.length = 0; 3905 static if(writeId){ writeBytes(varuint.encode(ID)); } 3906 writeBytes(varuint.encode(entityId)); 3907 return _buffer; 3908 } 3909 3910 public pure nothrow @safe void decode(bool readId=true)() { 3911 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 3912 entityId=varuint.decode(_buffer, &_index); 3913 } 3914 3915 public static pure nothrow @safe Camera fromBuffer(bool readId=true)(ubyte[] buffer) { 3916 Camera ret = new Camera(); 3917 ret._buffer = buffer; 3918 ret.decode!readId(); 3919 return ret; 3920 } 3921 3922 public override string toString() { 3923 return "Camera(entityId: " ~ std.conv.to!string(this.entityId) ~ ")"; 3924 } 3925 3926 } 3927 3928 class HeldItemChange : Buffer { 3929 3930 public enum uint ID = 57; 3931 3932 public enum bool CLIENTBOUND = true; 3933 public enum bool SERVERBOUND = false; 3934 3935 public enum string[] FIELDS = ["slot"]; 3936 3937 public ubyte slot; 3938 3939 public pure nothrow @safe @nogc this() {} 3940 3941 public pure nothrow @safe @nogc this(ubyte slot) { 3942 this.slot = slot; 3943 } 3944 3945 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3946 _buffer.length = 0; 3947 static if(writeId){ writeBytes(varuint.encode(ID)); } 3948 writeBigEndianUbyte(slot); 3949 return _buffer; 3950 } 3951 3952 public pure nothrow @safe void decode(bool readId=true)() { 3953 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 3954 slot=readBigEndianUbyte(); 3955 } 3956 3957 public static pure nothrow @safe HeldItemChange fromBuffer(bool readId=true)(ubyte[] buffer) { 3958 HeldItemChange ret = new HeldItemChange(); 3959 ret._buffer = buffer; 3960 ret.decode!readId(); 3961 return ret; 3962 } 3963 3964 public override string toString() { 3965 return "HeldItemChange(slot: " ~ std.conv.to!string(this.slot) ~ ")"; 3966 } 3967 3968 } 3969 3970 class DisplayScoreboard : Buffer { 3971 3972 public enum uint ID = 58; 3973 3974 public enum bool CLIENTBOUND = true; 3975 public enum bool SERVERBOUND = false; 3976 3977 // position 3978 public enum ubyte LIST = 0; 3979 public enum ubyte SIDEBAR = 1; 3980 public enum ubyte BELOW_NAME = 2; 3981 3982 public enum string[] FIELDS = ["position", "scoreName"]; 3983 3984 public ubyte position; 3985 public string scoreName; 3986 3987 public pure nothrow @safe @nogc this() {} 3988 3989 public pure nothrow @safe @nogc this(ubyte position, string scoreName=string.init) { 3990 this.position = position; 3991 this.scoreName = scoreName; 3992 } 3993 3994 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 3995 _buffer.length = 0; 3996 static if(writeId){ writeBytes(varuint.encode(ID)); } 3997 writeBigEndianUbyte(position); 3998 writeBytes(varuint.encode(cast(uint)scoreName.length)); writeString(scoreName); 3999 return _buffer; 4000 } 4001 4002 public pure nothrow @safe void decode(bool readId=true)() { 4003 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4004 position=readBigEndianUbyte(); 4005 uint cncvy1=varuint.decode(_buffer, &_index); scoreName=readString(cncvy1); 4006 } 4007 4008 public static pure nothrow @safe DisplayScoreboard fromBuffer(bool readId=true)(ubyte[] buffer) { 4009 DisplayScoreboard ret = new DisplayScoreboard(); 4010 ret._buffer = buffer; 4011 ret.decode!readId(); 4012 return ret; 4013 } 4014 4015 public override string toString() { 4016 return "DisplayScoreboard(position: " ~ std.conv.to!string(this.position) ~ ", scoreName: " ~ std.conv.to!string(this.scoreName) ~ ")"; 4017 } 4018 4019 } 4020 4021 class EntityMetadata : Buffer { 4022 4023 public enum uint ID = 59; 4024 4025 public enum bool CLIENTBOUND = true; 4026 public enum bool SERVERBOUND = false; 4027 4028 public enum string[] FIELDS = ["entityId", "metadata"]; 4029 4030 public uint entityId; 4031 public Metadata metadata; 4032 4033 public pure nothrow @safe @nogc this() {} 4034 4035 public pure nothrow @safe @nogc this(uint entityId, Metadata metadata=Metadata.init) { 4036 this.entityId = entityId; 4037 this.metadata = metadata; 4038 } 4039 4040 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4041 _buffer.length = 0; 4042 static if(writeId){ writeBytes(varuint.encode(ID)); } 4043 writeBytes(varuint.encode(entityId)); 4044 metadata.encode(bufferInstance); 4045 return _buffer; 4046 } 4047 4048 public pure nothrow @safe void decode(bool readId=true)() { 4049 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4050 entityId=varuint.decode(_buffer, &_index); 4051 metadata=Metadata.decode(bufferInstance); 4052 } 4053 4054 public static pure nothrow @safe EntityMetadata fromBuffer(bool readId=true)(ubyte[] buffer) { 4055 EntityMetadata ret = new EntityMetadata(); 4056 ret._buffer = buffer; 4057 ret.decode!readId(); 4058 return ret; 4059 } 4060 4061 public override string toString() { 4062 return "EntityMetadata(entityId: " ~ std.conv.to!string(this.entityId) ~ ", metadata: " ~ std.conv.to!string(this.metadata) ~ ")"; 4063 } 4064 4065 } 4066 4067 class AttachEntity : Buffer { 4068 4069 public enum uint ID = 60; 4070 4071 public enum bool CLIENTBOUND = true; 4072 public enum bool SERVERBOUND = false; 4073 4074 public enum string[] FIELDS = ["target", "holder"]; 4075 4076 public uint target; 4077 public uint holder; 4078 4079 public pure nothrow @safe @nogc this() {} 4080 4081 public pure nothrow @safe @nogc this(uint target, uint holder=uint.init) { 4082 this.target = target; 4083 this.holder = holder; 4084 } 4085 4086 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4087 _buffer.length = 0; 4088 static if(writeId){ writeBytes(varuint.encode(ID)); } 4089 writeBigEndianUint(target); 4090 writeBigEndianUint(holder); 4091 return _buffer; 4092 } 4093 4094 public pure nothrow @safe void decode(bool readId=true)() { 4095 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4096 target=readBigEndianUint(); 4097 holder=readBigEndianUint(); 4098 } 4099 4100 public static pure nothrow @safe AttachEntity fromBuffer(bool readId=true)(ubyte[] buffer) { 4101 AttachEntity ret = new AttachEntity(); 4102 ret._buffer = buffer; 4103 ret.decode!readId(); 4104 return ret; 4105 } 4106 4107 public override string toString() { 4108 return "AttachEntity(target: " ~ std.conv.to!string(this.target) ~ ", holder: " ~ std.conv.to!string(this.holder) ~ ")"; 4109 } 4110 4111 } 4112 4113 class EntityVelocity : Buffer { 4114 4115 public enum uint ID = 61; 4116 4117 public enum bool CLIENTBOUND = true; 4118 public enum bool SERVERBOUND = false; 4119 4120 public enum string[] FIELDS = ["entityId", "velocity"]; 4121 4122 public uint entityId; 4123 public Tuple!(short, "x", short, "y", short, "z") velocity; 4124 4125 public pure nothrow @safe @nogc this() {} 4126 4127 public pure nothrow @safe @nogc this(uint entityId, Tuple!(short, "x", short, "y", short, "z") velocity=Tuple!(short, "x", short, "y", short, "z").init) { 4128 this.entityId = entityId; 4129 this.velocity = velocity; 4130 } 4131 4132 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4133 _buffer.length = 0; 4134 static if(writeId){ writeBytes(varuint.encode(ID)); } 4135 writeBytes(varuint.encode(entityId)); 4136 writeBigEndianShort(velocity.x); writeBigEndianShort(velocity.y); writeBigEndianShort(velocity.z); 4137 return _buffer; 4138 } 4139 4140 public pure nothrow @safe void decode(bool readId=true)() { 4141 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4142 entityId=varuint.decode(_buffer, &_index); 4143 velocity.x=readBigEndianShort(); velocity.y=readBigEndianShort(); velocity.z=readBigEndianShort(); 4144 } 4145 4146 public static pure nothrow @safe EntityVelocity fromBuffer(bool readId=true)(ubyte[] buffer) { 4147 EntityVelocity ret = new EntityVelocity(); 4148 ret._buffer = buffer; 4149 ret.decode!readId(); 4150 return ret; 4151 } 4152 4153 public override string toString() { 4154 return "EntityVelocity(entityId: " ~ std.conv.to!string(this.entityId) ~ ", velocity: " ~ std.conv.to!string(this.velocity) ~ ")"; 4155 } 4156 4157 } 4158 4159 class EntityEquipment : Buffer { 4160 4161 public enum uint ID = 62; 4162 4163 public enum bool CLIENTBOUND = true; 4164 public enum bool SERVERBOUND = false; 4165 4166 public enum string[] FIELDS = ["entityId", "slot", "item"]; 4167 4168 public uint entityId; 4169 public uint slot; 4170 public sul.protocol.java335.types.Slot item; 4171 4172 public pure nothrow @safe @nogc this() {} 4173 4174 public pure nothrow @safe @nogc this(uint entityId, uint slot=uint.init, sul.protocol.java335.types.Slot item=sul.protocol.java335.types.Slot.init) { 4175 this.entityId = entityId; 4176 this.slot = slot; 4177 this.item = item; 4178 } 4179 4180 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4181 _buffer.length = 0; 4182 static if(writeId){ writeBytes(varuint.encode(ID)); } 4183 writeBytes(varuint.encode(entityId)); 4184 writeBytes(varuint.encode(slot)); 4185 item.encode(bufferInstance); 4186 return _buffer; 4187 } 4188 4189 public pure nothrow @safe void decode(bool readId=true)() { 4190 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4191 entityId=varuint.decode(_buffer, &_index); 4192 slot=varuint.decode(_buffer, &_index); 4193 item.decode(bufferInstance); 4194 } 4195 4196 public static pure nothrow @safe EntityEquipment fromBuffer(bool readId=true)(ubyte[] buffer) { 4197 EntityEquipment ret = new EntityEquipment(); 4198 ret._buffer = buffer; 4199 ret.decode!readId(); 4200 return ret; 4201 } 4202 4203 public override string toString() { 4204 return "EntityEquipment(entityId: " ~ std.conv.to!string(this.entityId) ~ ", slot: " ~ std.conv.to!string(this.slot) ~ ", item: " ~ std.conv.to!string(this.item) ~ ")"; 4205 } 4206 4207 } 4208 4209 class SetExperience : Buffer { 4210 4211 public enum uint ID = 63; 4212 4213 public enum bool CLIENTBOUND = true; 4214 public enum bool SERVERBOUND = false; 4215 4216 public enum string[] FIELDS = ["experience", "level", "totalExperience"]; 4217 4218 public float experience; 4219 public uint level; 4220 public uint totalExperience; 4221 4222 public pure nothrow @safe @nogc this() {} 4223 4224 public pure nothrow @safe @nogc this(float experience, uint level=uint.init, uint totalExperience=uint.init) { 4225 this.experience = experience; 4226 this.level = level; 4227 this.totalExperience = totalExperience; 4228 } 4229 4230 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4231 _buffer.length = 0; 4232 static if(writeId){ writeBytes(varuint.encode(ID)); } 4233 writeBigEndianFloat(experience); 4234 writeBytes(varuint.encode(level)); 4235 writeBytes(varuint.encode(totalExperience)); 4236 return _buffer; 4237 } 4238 4239 public pure nothrow @safe void decode(bool readId=true)() { 4240 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4241 experience=readBigEndianFloat(); 4242 level=varuint.decode(_buffer, &_index); 4243 totalExperience=varuint.decode(_buffer, &_index); 4244 } 4245 4246 public static pure nothrow @safe SetExperience fromBuffer(bool readId=true)(ubyte[] buffer) { 4247 SetExperience ret = new SetExperience(); 4248 ret._buffer = buffer; 4249 ret.decode!readId(); 4250 return ret; 4251 } 4252 4253 public override string toString() { 4254 return "SetExperience(experience: " ~ std.conv.to!string(this.experience) ~ ", level: " ~ std.conv.to!string(this.level) ~ ", totalExperience: " ~ std.conv.to!string(this.totalExperience) ~ ")"; 4255 } 4256 4257 } 4258 4259 class UpdateHealth : Buffer { 4260 4261 public enum uint ID = 64; 4262 4263 public enum bool CLIENTBOUND = true; 4264 public enum bool SERVERBOUND = false; 4265 4266 public enum string[] FIELDS = ["health", "hunger", "saturation"]; 4267 4268 public float health; 4269 public uint hunger; 4270 public float saturation; 4271 4272 public pure nothrow @safe @nogc this() {} 4273 4274 public pure nothrow @safe @nogc this(float health, uint hunger=uint.init, float saturation=float.init) { 4275 this.health = health; 4276 this.hunger = hunger; 4277 this.saturation = saturation; 4278 } 4279 4280 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4281 _buffer.length = 0; 4282 static if(writeId){ writeBytes(varuint.encode(ID)); } 4283 writeBigEndianFloat(health); 4284 writeBytes(varuint.encode(hunger)); 4285 writeBigEndianFloat(saturation); 4286 return _buffer; 4287 } 4288 4289 public pure nothrow @safe void decode(bool readId=true)() { 4290 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4291 health=readBigEndianFloat(); 4292 hunger=varuint.decode(_buffer, &_index); 4293 saturation=readBigEndianFloat(); 4294 } 4295 4296 public static pure nothrow @safe UpdateHealth fromBuffer(bool readId=true)(ubyte[] buffer) { 4297 UpdateHealth ret = new UpdateHealth(); 4298 ret._buffer = buffer; 4299 ret.decode!readId(); 4300 return ret; 4301 } 4302 4303 public override string toString() { 4304 return "UpdateHealth(health: " ~ std.conv.to!string(this.health) ~ ", hunger: " ~ std.conv.to!string(this.hunger) ~ ", saturation: " ~ std.conv.to!string(this.saturation) ~ ")"; 4305 } 4306 4307 } 4308 4309 class ScoreboardObjective : Buffer { 4310 4311 public enum uint ID = 65; 4312 4313 public enum bool CLIENTBOUND = true; 4314 public enum bool SERVERBOUND = false; 4315 4316 // mode 4317 public enum ubyte CREATE = 0; 4318 public enum ubyte REMOVE = 1; 4319 public enum ubyte UPDATE = 2; 4320 4321 // type 4322 public enum string NUMERIC = "integer"; 4323 public enum string GRAPHIC = "hearts"; 4324 4325 public enum string[] FIELDS = ["name", "mode", "value", "type"]; 4326 4327 public string name; 4328 public ubyte mode; 4329 public string value; 4330 public string type; 4331 4332 public pure nothrow @safe @nogc this() {} 4333 4334 public pure nothrow @safe @nogc this(string name, ubyte mode=ubyte.init, string value=string.init, string type=string.init) { 4335 this.name = name; 4336 this.mode = mode; 4337 this.value = value; 4338 this.type = type; 4339 } 4340 4341 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4342 _buffer.length = 0; 4343 static if(writeId){ writeBytes(varuint.encode(ID)); } 4344 writeBytes(varuint.encode(cast(uint)name.length)); writeString(name); 4345 writeBigEndianUbyte(mode); 4346 if(mode!=1){ writeBytes(varuint.encode(cast(uint)value.length)); writeString(value); } 4347 if(mode!=1){ writeBytes(varuint.encode(cast(uint)type.length)); writeString(type); } 4348 return _buffer; 4349 } 4350 4351 public pure nothrow @safe void decode(bool readId=true)() { 4352 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4353 uint bfz=varuint.decode(_buffer, &_index); name=readString(bfz); 4354 mode=readBigEndianUbyte(); 4355 if(mode!=1){ uint dfdu=varuint.decode(_buffer, &_index); value=readString(dfdu); } 4356 if(mode!=1){ uint dlz=varuint.decode(_buffer, &_index); type=readString(dlz); } 4357 } 4358 4359 public static pure nothrow @safe ScoreboardObjective fromBuffer(bool readId=true)(ubyte[] buffer) { 4360 ScoreboardObjective ret = new ScoreboardObjective(); 4361 ret._buffer = buffer; 4362 ret.decode!readId(); 4363 return ret; 4364 } 4365 4366 public override string toString() { 4367 return "ScoreboardObjective(name: " ~ std.conv.to!string(this.name) ~ ", mode: " ~ std.conv.to!string(this.mode) ~ ", value: " ~ std.conv.to!string(this.value) ~ ", type: " ~ std.conv.to!string(this.type) ~ ")"; 4368 } 4369 4370 } 4371 4372 class SetPassengers : Buffer { 4373 4374 public enum uint ID = 66; 4375 4376 public enum bool CLIENTBOUND = true; 4377 public enum bool SERVERBOUND = false; 4378 4379 public enum string[] FIELDS = ["entityId", "passengers"]; 4380 4381 public uint entityId; 4382 public uint[] passengers; 4383 4384 public pure nothrow @safe @nogc this() {} 4385 4386 public pure nothrow @safe @nogc this(uint entityId, uint[] passengers=(uint[]).init) { 4387 this.entityId = entityId; 4388 this.passengers = passengers; 4389 } 4390 4391 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4392 _buffer.length = 0; 4393 static if(writeId){ writeBytes(varuint.encode(ID)); } 4394 writeBytes(varuint.encode(entityId)); 4395 writeBytes(varuint.encode(cast(uint)passengers.length)); foreach(cfcvzvc;passengers){ writeBytes(varuint.encode(cfcvzvc)); } 4396 return _buffer; 4397 } 4398 4399 public pure nothrow @safe void decode(bool readId=true)() { 4400 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4401 entityId=varuint.decode(_buffer, &_index); 4402 passengers.length=varuint.decode(_buffer, &_index); foreach(ref cfcvzvc;passengers){ cfcvzvc=varuint.decode(_buffer, &_index); } 4403 } 4404 4405 public static pure nothrow @safe SetPassengers fromBuffer(bool readId=true)(ubyte[] buffer) { 4406 SetPassengers ret = new SetPassengers(); 4407 ret._buffer = buffer; 4408 ret.decode!readId(); 4409 return ret; 4410 } 4411 4412 public override string toString() { 4413 return "SetPassengers(entityId: " ~ std.conv.to!string(this.entityId) ~ ", passengers: " ~ std.conv.to!string(this.passengers) ~ ")"; 4414 } 4415 4416 } 4417 4418 class Teams : Buffer { 4419 4420 public enum uint ID = 67; 4421 4422 public enum bool CLIENTBOUND = true; 4423 public enum bool SERVERBOUND = false; 4424 4425 public enum string[] FIELDS = ["name", "mode"]; 4426 4427 public string name; 4428 public ubyte mode; 4429 4430 public pure nothrow @safe @nogc this() {} 4431 4432 public pure nothrow @safe @nogc this(string name, ubyte mode=ubyte.init) { 4433 this.name = name; 4434 this.mode = mode; 4435 } 4436 4437 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4438 _buffer.length = 0; 4439 static if(writeId){ writeBytes(varuint.encode(ID)); } 4440 writeBytes(varuint.encode(cast(uint)name.length)); writeString(name); 4441 writeBigEndianUbyte(mode); 4442 return _buffer; 4443 } 4444 4445 public pure nothrow @safe void decode(bool readId=true)() { 4446 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4447 uint bfz=varuint.decode(_buffer, &_index); name=readString(bfz); 4448 mode=readBigEndianUbyte(); 4449 } 4450 4451 public static pure nothrow @safe Teams fromBuffer(bool readId=true)(ubyte[] buffer) { 4452 Teams ret = new Teams(); 4453 ret._buffer = buffer; 4454 ret.decode!readId(); 4455 return ret; 4456 } 4457 4458 public override string toString() { 4459 return "Teams(name: " ~ std.conv.to!string(this.name) ~ ", mode: " ~ std.conv.to!string(this.mode) ~ ")"; 4460 } 4461 4462 alias _encode = encode; 4463 4464 enum string variantField = "mode"; 4465 4466 alias Variants = TypeTuple!(CreateTeam, RemoveTeam, UpdateTeamInfo, AddPlayers, RemovePlayers); 4467 4468 public class CreateTeam { 4469 4470 public enum typeof(mode) MODE = 0; 4471 4472 // friendly flags 4473 public enum ubyte FRIENDLY_FIRE = 1; 4474 public enum ubyte SEE_TEAM_INVISIBLE_PLAYERS = 2; 4475 4476 // nametag visibility 4477 public enum string ALWAYS_HIDE = "always"; 4478 public enum string HIDE_OTHER_TEAMS = "hideOtherTeams"; 4479 public enum string HIDE_OWN_TEAM = "hideOwnTeam"; 4480 public enum string NEVER_HIDE = "never"; 4481 4482 // collision rule 4483 public enum string ALWAYS_PUSH = "always"; 4484 public enum string PUSH_OTHER_TEAMS = "pushOtherTeams"; 4485 public enum string PUSH_OWN_TEAM = "pushOwnTeam"; 4486 public enum string NEVER_PUSH = "never"; 4487 4488 public enum string[] FIELDS = ["displayName", "prefix", "suffix", "friendlyFlags", "nametagVisibility", "collisionRule", "color", "players"]; 4489 4490 public string displayName; 4491 public string prefix; 4492 public string suffix; 4493 public ubyte friendlyFlags; 4494 public string nametagVisibility; 4495 public string collisionRule; 4496 public ubyte color; 4497 public string[] players; 4498 4499 public pure nothrow @safe @nogc this() {} 4500 4501 public pure nothrow @safe @nogc this(string displayName, string prefix=string.init, string suffix=string.init, ubyte friendlyFlags=ubyte.init, string nametagVisibility=string.init, string collisionRule=string.init, ubyte color=ubyte.init, string[] players=(string[]).init) { 4502 this.displayName = displayName; 4503 this.prefix = prefix; 4504 this.suffix = suffix; 4505 this.friendlyFlags = friendlyFlags; 4506 this.nametagVisibility = nametagVisibility; 4507 this.collisionRule = collisionRule; 4508 this.color = color; 4509 this.players = players; 4510 } 4511 4512 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4513 mode = 0; 4514 _encode!writeId(); 4515 writeBytes(varuint.encode(cast(uint)displayName.length)); writeString(displayName); 4516 writeBytes(varuint.encode(cast(uint)prefix.length)); writeString(prefix); 4517 writeBytes(varuint.encode(cast(uint)suffix.length)); writeString(suffix); 4518 writeBigEndianUbyte(friendlyFlags); 4519 writeBytes(varuint.encode(cast(uint)nametagVisibility.length)); writeString(nametagVisibility); 4520 writeBytes(varuint.encode(cast(uint)collisionRule.length)); writeString(collisionRule); 4521 writeBigEndianUbyte(color); 4522 writeBytes(varuint.encode(cast(uint)players.length)); foreach(cxevc;players){ writeBytes(varuint.encode(cast(uint)cxevc.length)); writeString(cxevc); } 4523 return _buffer; 4524 } 4525 4526 public pure nothrow @safe void decode() { 4527 uint zlcxe5bu=varuint.decode(_buffer, &_index); displayName=readString(zlcxe5bu); 4528 uint cjzl=varuint.decode(_buffer, &_index); prefix=readString(cjzl); 4529 uint cvzl=varuint.decode(_buffer, &_index); suffix=readString(cvzl); 4530 friendlyFlags=readBigEndianUbyte(); 4531 uint bfzrzzcl=varuint.decode(_buffer, &_index); nametagVisibility=readString(bfzrzzcl); 4532 uint y9bla9uv=varuint.decode(_buffer, &_index); collisionRule=readString(y9bla9uv); 4533 color=readBigEndianUbyte(); 4534 players.length=varuint.decode(_buffer, &_index); foreach(ref cxevc;players){ uint yhdm=varuint.decode(_buffer, &_index); cxevc=readString(yhdm); } 4535 } 4536 4537 public override string toString() { 4538 return "Teams.CreateTeam(displayName: " ~ std.conv.to!string(this.displayName) ~ ", prefix: " ~ std.conv.to!string(this.prefix) ~ ", suffix: " ~ std.conv.to!string(this.suffix) ~ ", friendlyFlags: " ~ std.conv.to!string(this.friendlyFlags) ~ ", nametagVisibility: " ~ std.conv.to!string(this.nametagVisibility) ~ ", collisionRule: " ~ std.conv.to!string(this.collisionRule) ~ ", color: " ~ std.conv.to!string(this.color) ~ ", players: " ~ std.conv.to!string(this.players) ~ ")"; 4539 } 4540 4541 } 4542 4543 public class RemoveTeam { 4544 4545 public enum typeof(mode) MODE = 1; 4546 4547 public enum string[] FIELDS = []; 4548 4549 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4550 mode = 1; 4551 _encode!writeId(); 4552 return _buffer; 4553 } 4554 4555 public pure nothrow @safe void decode() { 4556 } 4557 4558 public override string toString() { 4559 return "Teams.RemoveTeam()"; 4560 } 4561 4562 } 4563 4564 public class UpdateTeamInfo { 4565 4566 public enum typeof(mode) MODE = 2; 4567 4568 // friendly flags 4569 public enum ubyte FRIENDLY_FIRE = 1; 4570 public enum ubyte SEE_TEAM_INVISIBLE_PLAYERS = 2; 4571 4572 // nametag visibility 4573 public enum string ALWAYS_HIDE = "always"; 4574 public enum string HIDE_OTHER_TEAMS = "hideOtherTeams"; 4575 public enum string HIDE_OWN_TEAM = "hideOwnTeam"; 4576 public enum string NEVER_HIDE = "never"; 4577 4578 // collision rule 4579 public enum string ALWAYS_PUSH = "always"; 4580 public enum string PUSH_OTHER_TEAMS = "pushOtherTeams"; 4581 public enum string PUSH_OWN_TEAM = "pushOwnTeam"; 4582 public enum string NEVER_PUSH = "never"; 4583 4584 public enum string[] FIELDS = ["displayName", "prefix", "suffix", "friendlyFlags", "nametagVisibility", "collisionRule", "color"]; 4585 4586 public string displayName; 4587 public string prefix; 4588 public string suffix; 4589 public ubyte friendlyFlags; 4590 public string nametagVisibility; 4591 public string collisionRule; 4592 public ubyte color; 4593 4594 public pure nothrow @safe @nogc this() {} 4595 4596 public pure nothrow @safe @nogc this(string displayName, string prefix=string.init, string suffix=string.init, ubyte friendlyFlags=ubyte.init, string nametagVisibility=string.init, string collisionRule=string.init, ubyte color=ubyte.init) { 4597 this.displayName = displayName; 4598 this.prefix = prefix; 4599 this.suffix = suffix; 4600 this.friendlyFlags = friendlyFlags; 4601 this.nametagVisibility = nametagVisibility; 4602 this.collisionRule = collisionRule; 4603 this.color = color; 4604 } 4605 4606 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4607 mode = 2; 4608 _encode!writeId(); 4609 writeBytes(varuint.encode(cast(uint)displayName.length)); writeString(displayName); 4610 writeBytes(varuint.encode(cast(uint)prefix.length)); writeString(prefix); 4611 writeBytes(varuint.encode(cast(uint)suffix.length)); writeString(suffix); 4612 writeBigEndianUbyte(friendlyFlags); 4613 writeBytes(varuint.encode(cast(uint)nametagVisibility.length)); writeString(nametagVisibility); 4614 writeBytes(varuint.encode(cast(uint)collisionRule.length)); writeString(collisionRule); 4615 writeBigEndianUbyte(color); 4616 return _buffer; 4617 } 4618 4619 public pure nothrow @safe void decode() { 4620 uint zlcxe5bu=varuint.decode(_buffer, &_index); displayName=readString(zlcxe5bu); 4621 uint cjzl=varuint.decode(_buffer, &_index); prefix=readString(cjzl); 4622 uint cvzl=varuint.decode(_buffer, &_index); suffix=readString(cvzl); 4623 friendlyFlags=readBigEndianUbyte(); 4624 uint bfzrzzcl=varuint.decode(_buffer, &_index); nametagVisibility=readString(bfzrzzcl); 4625 uint y9bla9uv=varuint.decode(_buffer, &_index); collisionRule=readString(y9bla9uv); 4626 color=readBigEndianUbyte(); 4627 } 4628 4629 public override string toString() { 4630 return "Teams.UpdateTeamInfo(displayName: " ~ std.conv.to!string(this.displayName) ~ ", prefix: " ~ std.conv.to!string(this.prefix) ~ ", suffix: " ~ std.conv.to!string(this.suffix) ~ ", friendlyFlags: " ~ std.conv.to!string(this.friendlyFlags) ~ ", nametagVisibility: " ~ std.conv.to!string(this.nametagVisibility) ~ ", collisionRule: " ~ std.conv.to!string(this.collisionRule) ~ ", color: " ~ std.conv.to!string(this.color) ~ ")"; 4631 } 4632 4633 } 4634 4635 public class AddPlayers { 4636 4637 public enum typeof(mode) MODE = 3; 4638 4639 public enum string[] FIELDS = ["players"]; 4640 4641 public string[] players; 4642 4643 public pure nothrow @safe @nogc this() {} 4644 4645 public pure nothrow @safe @nogc this(string[] players) { 4646 this.players = players; 4647 } 4648 4649 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4650 mode = 3; 4651 _encode!writeId(); 4652 writeBytes(varuint.encode(cast(uint)players.length)); foreach(cxevc;players){ writeBytes(varuint.encode(cast(uint)cxevc.length)); writeString(cxevc); } 4653 return _buffer; 4654 } 4655 4656 public pure nothrow @safe void decode() { 4657 players.length=varuint.decode(_buffer, &_index); foreach(ref cxevc;players){ uint yhdm=varuint.decode(_buffer, &_index); cxevc=readString(yhdm); } 4658 } 4659 4660 public override string toString() { 4661 return "Teams.AddPlayers(players: " ~ std.conv.to!string(this.players) ~ ")"; 4662 } 4663 4664 } 4665 4666 public class RemovePlayers { 4667 4668 public enum typeof(mode) MODE = 4; 4669 4670 public enum string[] FIELDS = ["players"]; 4671 4672 public string[] players; 4673 4674 public pure nothrow @safe @nogc this() {} 4675 4676 public pure nothrow @safe @nogc this(string[] players) { 4677 this.players = players; 4678 } 4679 4680 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4681 mode = 4; 4682 _encode!writeId(); 4683 writeBytes(varuint.encode(cast(uint)players.length)); foreach(cxevc;players){ writeBytes(varuint.encode(cast(uint)cxevc.length)); writeString(cxevc); } 4684 return _buffer; 4685 } 4686 4687 public pure nothrow @safe void decode() { 4688 players.length=varuint.decode(_buffer, &_index); foreach(ref cxevc;players){ uint yhdm=varuint.decode(_buffer, &_index); cxevc=readString(yhdm); } 4689 } 4690 4691 public override string toString() { 4692 return "Teams.RemovePlayers(players: " ~ std.conv.to!string(this.players) ~ ")"; 4693 } 4694 4695 } 4696 4697 } 4698 4699 class UpdateScore : Buffer { 4700 4701 public enum uint ID = 68; 4702 4703 public enum bool CLIENTBOUND = true; 4704 public enum bool SERVERBOUND = false; 4705 4706 // action 4707 public enum ubyte UPDATE = 0; 4708 public enum ubyte REMOVE = 1; 4709 4710 public enum string[] FIELDS = ["scoreName", "action", "objectiveName", "value"]; 4711 4712 public string scoreName; 4713 public ubyte action; 4714 public string objectiveName; 4715 public uint value; 4716 4717 public pure nothrow @safe @nogc this() {} 4718 4719 public pure nothrow @safe @nogc this(string scoreName, ubyte action=ubyte.init, string objectiveName=string.init, uint value=uint.init) { 4720 this.scoreName = scoreName; 4721 this.action = action; 4722 this.objectiveName = objectiveName; 4723 this.value = value; 4724 } 4725 4726 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4727 _buffer.length = 0; 4728 static if(writeId){ writeBytes(varuint.encode(ID)); } 4729 writeBytes(varuint.encode(cast(uint)scoreName.length)); writeString(scoreName); 4730 writeBigEndianUbyte(action); 4731 writeBytes(varuint.encode(cast(uint)objectiveName.length)); writeString(objectiveName); 4732 if(action==0){ writeBytes(varuint.encode(value)); } 4733 return _buffer; 4734 } 4735 4736 public pure nothrow @safe void decode(bool readId=true)() { 4737 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4738 uint cncvy1=varuint.decode(_buffer, &_index); scoreName=readString(cncvy1); 4739 action=readBigEndianUbyte(); 4740 uint bjznaztf=varuint.decode(_buffer, &_index); objectiveName=readString(bjznaztf); 4741 if(action==0){ value=varuint.decode(_buffer, &_index); } 4742 } 4743 4744 public static pure nothrow @safe UpdateScore fromBuffer(bool readId=true)(ubyte[] buffer) { 4745 UpdateScore ret = new UpdateScore(); 4746 ret._buffer = buffer; 4747 ret.decode!readId(); 4748 return ret; 4749 } 4750 4751 public override string toString() { 4752 return "UpdateScore(scoreName: " ~ std.conv.to!string(this.scoreName) ~ ", action: " ~ std.conv.to!string(this.action) ~ ", objectiveName: " ~ std.conv.to!string(this.objectiveName) ~ ", value: " ~ std.conv.to!string(this.value) ~ ")"; 4753 } 4754 4755 } 4756 4757 class SpawnPosition : Buffer { 4758 4759 public enum uint ID = 69; 4760 4761 public enum bool CLIENTBOUND = true; 4762 public enum bool SERVERBOUND = false; 4763 4764 public enum string[] FIELDS = ["position"]; 4765 4766 public ulong position; 4767 4768 public pure nothrow @safe @nogc this() {} 4769 4770 public pure nothrow @safe @nogc this(ulong position) { 4771 this.position = position; 4772 } 4773 4774 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4775 _buffer.length = 0; 4776 static if(writeId){ writeBytes(varuint.encode(ID)); } 4777 writeBigEndianUlong(position); 4778 return _buffer; 4779 } 4780 4781 public pure nothrow @safe void decode(bool readId=true)() { 4782 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4783 position=readBigEndianUlong(); 4784 } 4785 4786 public static pure nothrow @safe SpawnPosition fromBuffer(bool readId=true)(ubyte[] buffer) { 4787 SpawnPosition ret = new SpawnPosition(); 4788 ret._buffer = buffer; 4789 ret.decode!readId(); 4790 return ret; 4791 } 4792 4793 public override string toString() { 4794 return "SpawnPosition(position: " ~ std.conv.to!string(this.position) ~ ")"; 4795 } 4796 4797 } 4798 4799 class TimeUpdate : Buffer { 4800 4801 public enum uint ID = 70; 4802 4803 public enum bool CLIENTBOUND = true; 4804 public enum bool SERVERBOUND = false; 4805 4806 public enum string[] FIELDS = ["worldAge", "time"]; 4807 4808 public ulong worldAge; 4809 public long time; 4810 4811 public pure nothrow @safe @nogc this() {} 4812 4813 public pure nothrow @safe @nogc this(ulong worldAge, long time=long.init) { 4814 this.worldAge = worldAge; 4815 this.time = time; 4816 } 4817 4818 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4819 _buffer.length = 0; 4820 static if(writeId){ writeBytes(varuint.encode(ID)); } 4821 writeBigEndianUlong(worldAge); 4822 writeBigEndianLong(time); 4823 return _buffer; 4824 } 4825 4826 public pure nothrow @safe void decode(bool readId=true)() { 4827 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4828 worldAge=readBigEndianUlong(); 4829 time=readBigEndianLong(); 4830 } 4831 4832 public static pure nothrow @safe TimeUpdate fromBuffer(bool readId=true)(ubyte[] buffer) { 4833 TimeUpdate ret = new TimeUpdate(); 4834 ret._buffer = buffer; 4835 ret.decode!readId(); 4836 return ret; 4837 } 4838 4839 public override string toString() { 4840 return "TimeUpdate(worldAge: " ~ std.conv.to!string(this.worldAge) ~ ", time: " ~ std.conv.to!string(this.time) ~ ")"; 4841 } 4842 4843 } 4844 4845 class Title : Buffer { 4846 4847 public enum uint ID = 71; 4848 4849 public enum bool CLIENTBOUND = true; 4850 public enum bool SERVERBOUND = false; 4851 4852 public enum string[] FIELDS = ["action"]; 4853 4854 public uint action; 4855 4856 public pure nothrow @safe @nogc this() {} 4857 4858 public pure nothrow @safe @nogc this(uint action) { 4859 this.action = action; 4860 } 4861 4862 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4863 _buffer.length = 0; 4864 static if(writeId){ writeBytes(varuint.encode(ID)); } 4865 writeBytes(varuint.encode(action)); 4866 return _buffer; 4867 } 4868 4869 public pure nothrow @safe void decode(bool readId=true)() { 4870 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 4871 action=varuint.decode(_buffer, &_index); 4872 } 4873 4874 public static pure nothrow @safe Title fromBuffer(bool readId=true)(ubyte[] buffer) { 4875 Title ret = new Title(); 4876 ret._buffer = buffer; 4877 ret.decode!readId(); 4878 return ret; 4879 } 4880 4881 public override string toString() { 4882 return "Title(action: " ~ std.conv.to!string(this.action) ~ ")"; 4883 } 4884 4885 alias _encode = encode; 4886 4887 enum string variantField = "action"; 4888 4889 alias Variants = TypeTuple!(SetTitle, SetSubtitle, SetActionBar, SetTimings, Hide, Reset); 4890 4891 public class SetTitle { 4892 4893 public enum typeof(action) ACTION = 0; 4894 4895 public enum string[] FIELDS = ["text"]; 4896 4897 public string text; 4898 4899 public pure nothrow @safe @nogc this() {} 4900 4901 public pure nothrow @safe @nogc this(string text) { 4902 this.text = text; 4903 } 4904 4905 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4906 action = 0; 4907 _encode!writeId(); 4908 writeBytes(varuint.encode(cast(uint)text.length)); writeString(text); 4909 return _buffer; 4910 } 4911 4912 public pure nothrow @safe void decode() { 4913 uint dvd=varuint.decode(_buffer, &_index); text=readString(dvd); 4914 } 4915 4916 public override string toString() { 4917 return "Title.SetTitle(text: " ~ std.conv.to!string(this.text) ~ ")"; 4918 } 4919 4920 } 4921 4922 public class SetSubtitle { 4923 4924 public enum typeof(action) ACTION = 1; 4925 4926 public enum string[] FIELDS = ["text"]; 4927 4928 public string text; 4929 4930 public pure nothrow @safe @nogc this() {} 4931 4932 public pure nothrow @safe @nogc this(string text) { 4933 this.text = text; 4934 } 4935 4936 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4937 action = 1; 4938 _encode!writeId(); 4939 writeBytes(varuint.encode(cast(uint)text.length)); writeString(text); 4940 return _buffer; 4941 } 4942 4943 public pure nothrow @safe void decode() { 4944 uint dvd=varuint.decode(_buffer, &_index); text=readString(dvd); 4945 } 4946 4947 public override string toString() { 4948 return "Title.SetSubtitle(text: " ~ std.conv.to!string(this.text) ~ ")"; 4949 } 4950 4951 } 4952 4953 public class SetActionBar { 4954 4955 public enum typeof(action) ACTION = 2; 4956 4957 public enum string[] FIELDS = ["text"]; 4958 4959 public string text; 4960 4961 public pure nothrow @safe @nogc this() {} 4962 4963 public pure nothrow @safe @nogc this(string text) { 4964 this.text = text; 4965 } 4966 4967 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 4968 action = 2; 4969 _encode!writeId(); 4970 writeBytes(varuint.encode(cast(uint)text.length)); writeString(text); 4971 return _buffer; 4972 } 4973 4974 public pure nothrow @safe void decode() { 4975 uint dvd=varuint.decode(_buffer, &_index); text=readString(dvd); 4976 } 4977 4978 public override string toString() { 4979 return "Title.SetActionBar(text: " ~ std.conv.to!string(this.text) ~ ")"; 4980 } 4981 4982 } 4983 4984 public class SetTimings { 4985 4986 public enum typeof(action) ACTION = 3; 4987 4988 public enum string[] FIELDS = ["fadeIn", "stay", "fadeOut"]; 4989 4990 public uint fadeIn; 4991 public uint stay; 4992 public uint fadeOut; 4993 4994 public pure nothrow @safe @nogc this() {} 4995 4996 public pure nothrow @safe @nogc this(uint fadeIn, uint stay=uint.init, uint fadeOut=uint.init) { 4997 this.fadeIn = fadeIn; 4998 this.stay = stay; 4999 this.fadeOut = fadeOut; 5000 } 5001 5002 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 5003 action = 3; 5004 _encode!writeId(); 5005 writeBigEndianUint(fadeIn); 5006 writeBigEndianUint(stay); 5007 writeBigEndianUint(fadeOut); 5008 return _buffer; 5009 } 5010 5011 public pure nothrow @safe void decode() { 5012 fadeIn=readBigEndianUint(); 5013 stay=readBigEndianUint(); 5014 fadeOut=readBigEndianUint(); 5015 } 5016 5017 public override string toString() { 5018 return "Title.SetTimings(fadeIn: " ~ std.conv.to!string(this.fadeIn) ~ ", stay: " ~ std.conv.to!string(this.stay) ~ ", fadeOut: " ~ std.conv.to!string(this.fadeOut) ~ ")"; 5019 } 5020 5021 } 5022 5023 public class Hide { 5024 5025 public enum typeof(action) ACTION = 4; 5026 5027 public enum string[] FIELDS = []; 5028 5029 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 5030 action = 4; 5031 _encode!writeId(); 5032 return _buffer; 5033 } 5034 5035 public pure nothrow @safe void decode() { 5036 } 5037 5038 public override string toString() { 5039 return "Title.Hide()"; 5040 } 5041 5042 } 5043 5044 public class Reset { 5045 5046 public enum typeof(action) ACTION = 5; 5047 5048 public enum string[] FIELDS = []; 5049 5050 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 5051 action = 5; 5052 _encode!writeId(); 5053 return _buffer; 5054 } 5055 5056 public pure nothrow @safe void decode() { 5057 } 5058 5059 public override string toString() { 5060 return "Title.Reset()"; 5061 } 5062 5063 } 5064 5065 } 5066 5067 class SoundEffect : Buffer { 5068 5069 public enum uint ID = 72; 5070 5071 public enum bool CLIENTBOUND = true; 5072 public enum bool SERVERBOUND = false; 5073 5074 public enum string[] FIELDS = ["soundId", "category", "position", "volume", "pitch"]; 5075 5076 public uint soundId; 5077 public uint category; 5078 public Tuple!(int, "x", int, "y", int, "z") position; 5079 public float volume; 5080 public float pitch; 5081 5082 public pure nothrow @safe @nogc this() {} 5083 5084 public pure nothrow @safe @nogc this(uint soundId, uint category=uint.init, Tuple!(int, "x", int, "y", int, "z") position=Tuple!(int, "x", int, "y", int, "z").init, float volume=float.init, float pitch=float.init) { 5085 this.soundId = soundId; 5086 this.category = category; 5087 this.position = position; 5088 this.volume = volume; 5089 this.pitch = pitch; 5090 } 5091 5092 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 5093 _buffer.length = 0; 5094 static if(writeId){ writeBytes(varuint.encode(ID)); } 5095 writeBytes(varuint.encode(soundId)); 5096 writeBytes(varuint.encode(category)); 5097 writeBigEndianInt(position.x); writeBigEndianInt(position.y); writeBigEndianInt(position.z); 5098 writeBigEndianFloat(volume); 5099 writeBigEndianFloat(pitch); 5100 return _buffer; 5101 } 5102 5103 public pure nothrow @safe void decode(bool readId=true)() { 5104 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 5105 soundId=varuint.decode(_buffer, &_index); 5106 category=varuint.decode(_buffer, &_index); 5107 position.x=readBigEndianInt(); position.y=readBigEndianInt(); position.z=readBigEndianInt(); 5108 volume=readBigEndianFloat(); 5109 pitch=readBigEndianFloat(); 5110 } 5111 5112 public static pure nothrow @safe SoundEffect fromBuffer(bool readId=true)(ubyte[] buffer) { 5113 SoundEffect ret = new SoundEffect(); 5114 ret._buffer = buffer; 5115 ret.decode!readId(); 5116 return ret; 5117 } 5118 5119 public override string toString() { 5120 return "SoundEffect(soundId: " ~ std.conv.to!string(this.soundId) ~ ", category: " ~ std.conv.to!string(this.category) ~ ", position: " ~ std.conv.to!string(this.position) ~ ", volume: " ~ std.conv.to!string(this.volume) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ")"; 5121 } 5122 5123 } 5124 5125 class PlayerListHeaderAndFooter : Buffer { 5126 5127 public enum uint ID = 73; 5128 5129 public enum bool CLIENTBOUND = true; 5130 public enum bool SERVERBOUND = false; 5131 5132 public enum string[] FIELDS = ["header", "footer"]; 5133 5134 public string header; 5135 public string footer; 5136 5137 public pure nothrow @safe @nogc this() {} 5138 5139 public pure nothrow @safe @nogc this(string header, string footer=string.init) { 5140 this.header = header; 5141 this.footer = footer; 5142 } 5143 5144 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 5145 _buffer.length = 0; 5146 static if(writeId){ writeBytes(varuint.encode(ID)); } 5147 writeBytes(varuint.encode(cast(uint)header.length)); writeString(header); 5148 writeBytes(varuint.encode(cast(uint)footer.length)); writeString(footer); 5149 return _buffer; 5150 } 5151 5152 public pure nothrow @safe void decode(bool readId=true)() { 5153 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 5154 uint avzv=varuint.decode(_buffer, &_index); header=readString(avzv); 5155 uint z9dv=varuint.decode(_buffer, &_index); footer=readString(z9dv); 5156 } 5157 5158 public static pure nothrow @safe PlayerListHeaderAndFooter fromBuffer(bool readId=true)(ubyte[] buffer) { 5159 PlayerListHeaderAndFooter ret = new PlayerListHeaderAndFooter(); 5160 ret._buffer = buffer; 5161 ret.decode!readId(); 5162 return ret; 5163 } 5164 5165 public override string toString() { 5166 return "PlayerListHeaderAndFooter(header: " ~ std.conv.to!string(this.header) ~ ", footer: " ~ std.conv.to!string(this.footer) ~ ")"; 5167 } 5168 5169 } 5170 5171 class CollectItem : Buffer { 5172 5173 public enum uint ID = 74; 5174 5175 public enum bool CLIENTBOUND = true; 5176 public enum bool SERVERBOUND = false; 5177 5178 public enum string[] FIELDS = ["collected", "collector", "count"]; 5179 5180 public uint collected; 5181 public uint collector; 5182 public uint count; 5183 5184 public pure nothrow @safe @nogc this() {} 5185 5186 public pure nothrow @safe @nogc this(uint collected, uint collector=uint.init, uint count=uint.init) { 5187 this.collected = collected; 5188 this.collector = collector; 5189 this.count = count; 5190 } 5191 5192 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 5193 _buffer.length = 0; 5194 static if(writeId){ writeBytes(varuint.encode(ID)); } 5195 writeBytes(varuint.encode(collected)); 5196 writeBytes(varuint.encode(collector)); 5197 writeBytes(varuint.encode(count)); 5198 return _buffer; 5199 } 5200 5201 public pure nothrow @safe void decode(bool readId=true)() { 5202 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 5203 collected=varuint.decode(_buffer, &_index); 5204 collector=varuint.decode(_buffer, &_index); 5205 count=varuint.decode(_buffer, &_index); 5206 } 5207 5208 public static pure nothrow @safe CollectItem fromBuffer(bool readId=true)(ubyte[] buffer) { 5209 CollectItem ret = new CollectItem(); 5210 ret._buffer = buffer; 5211 ret.decode!readId(); 5212 return ret; 5213 } 5214 5215 public override string toString() { 5216 return "CollectItem(collected: " ~ std.conv.to!string(this.collected) ~ ", collector: " ~ std.conv.to!string(this.collector) ~ ", count: " ~ std.conv.to!string(this.count) ~ ")"; 5217 } 5218 5219 } 5220 5221 class EntityTeleport : Buffer { 5222 5223 public enum uint ID = 75; 5224 5225 public enum bool CLIENTBOUND = true; 5226 public enum bool SERVERBOUND = false; 5227 5228 public enum string[] FIELDS = ["entityId", "position", "yaw", "pitch", "onGround"]; 5229 5230 public uint entityId; 5231 public Tuple!(double, "x", double, "y", double, "z") position; 5232 public ubyte yaw; 5233 public ubyte pitch; 5234 public bool onGround; 5235 5236 public pure nothrow @safe @nogc this() {} 5237 5238 public pure nothrow @safe @nogc this(uint entityId, Tuple!(double, "x", double, "y", double, "z") position=Tuple!(double, "x", double, "y", double, "z").init, ubyte yaw=ubyte.init, ubyte pitch=ubyte.init, bool onGround=bool.init) { 5239 this.entityId = entityId; 5240 this.position = position; 5241 this.yaw = yaw; 5242 this.pitch = pitch; 5243 this.onGround = onGround; 5244 } 5245 5246 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 5247 _buffer.length = 0; 5248 static if(writeId){ writeBytes(varuint.encode(ID)); } 5249 writeBytes(varuint.encode(entityId)); 5250 writeBigEndianDouble(position.x); writeBigEndianDouble(position.y); writeBigEndianDouble(position.z); 5251 writeBigEndianUbyte(yaw); 5252 writeBigEndianUbyte(pitch); 5253 writeBigEndianBool(onGround); 5254 return _buffer; 5255 } 5256 5257 public pure nothrow @safe void decode(bool readId=true)() { 5258 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 5259 entityId=varuint.decode(_buffer, &_index); 5260 position.x=readBigEndianDouble(); position.y=readBigEndianDouble(); position.z=readBigEndianDouble(); 5261 yaw=readBigEndianUbyte(); 5262 pitch=readBigEndianUbyte(); 5263 onGround=readBigEndianBool(); 5264 } 5265 5266 public static pure nothrow @safe EntityTeleport fromBuffer(bool readId=true)(ubyte[] buffer) { 5267 EntityTeleport ret = new EntityTeleport(); 5268 ret._buffer = buffer; 5269 ret.decode!readId(); 5270 return ret; 5271 } 5272 5273 public override string toString() { 5274 return "EntityTeleport(entityId: " ~ std.conv.to!string(this.entityId) ~ ", 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) ~ ")"; 5275 } 5276 5277 } 5278 5279 class Advencements : Buffer { 5280 5281 public enum uint ID = 76; 5282 5283 public enum bool CLIENTBOUND = true; 5284 public enum bool SERVERBOUND = false; 5285 5286 public enum string[] FIELDS = []; 5287 5288 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 5289 _buffer.length = 0; 5290 static if(writeId){ writeBytes(varuint.encode(ID)); } 5291 return _buffer; 5292 } 5293 5294 public pure nothrow @safe void decode(bool readId=true)() { 5295 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 5296 } 5297 5298 public static pure nothrow @safe Advencements fromBuffer(bool readId=true)(ubyte[] buffer) { 5299 Advencements ret = new Advencements(); 5300 ret._buffer = buffer; 5301 ret.decode!readId(); 5302 return ret; 5303 } 5304 5305 public override string toString() { 5306 return "Advencements()"; 5307 } 5308 5309 } 5310 5311 class EntityProperties : Buffer { 5312 5313 public enum uint ID = 77; 5314 5315 public enum bool CLIENTBOUND = true; 5316 public enum bool SERVERBOUND = false; 5317 5318 public enum string[] FIELDS = ["entityId", "attributes"]; 5319 5320 public uint entityId; 5321 public sul.protocol.java335.types.Attribute[] attributes; 5322 5323 public pure nothrow @safe @nogc this() {} 5324 5325 public pure nothrow @safe @nogc this(uint entityId, sul.protocol.java335.types.Attribute[] attributes=(sul.protocol.java335.types.Attribute[]).init) { 5326 this.entityId = entityId; 5327 this.attributes = attributes; 5328 } 5329 5330 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 5331 _buffer.length = 0; 5332 static if(writeId){ writeBytes(varuint.encode(ID)); } 5333 writeBytes(varuint.encode(entityId)); 5334 writeBigEndianUint(cast(uint)attributes.length); foreach(yrcldrc;attributes){ yrcldrc.encode(bufferInstance); } 5335 return _buffer; 5336 } 5337 5338 public pure nothrow @safe void decode(bool readId=true)() { 5339 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 5340 entityId=varuint.decode(_buffer, &_index); 5341 attributes.length=readBigEndianUint(); foreach(ref yrcldrc;attributes){ yrcldrc.decode(bufferInstance); } 5342 } 5343 5344 public static pure nothrow @safe EntityProperties fromBuffer(bool readId=true)(ubyte[] buffer) { 5345 EntityProperties ret = new EntityProperties(); 5346 ret._buffer = buffer; 5347 ret.decode!readId(); 5348 return ret; 5349 } 5350 5351 public override string toString() { 5352 return "EntityProperties(entityId: " ~ std.conv.to!string(this.entityId) ~ ", attributes: " ~ std.conv.to!string(this.attributes) ~ ")"; 5353 } 5354 5355 } 5356 5357 class EntityEffect : Buffer { 5358 5359 public enum uint ID = 78; 5360 5361 public enum bool CLIENTBOUND = true; 5362 public enum bool SERVERBOUND = false; 5363 5364 // flags 5365 public enum ubyte AMBIENT = 1; 5366 public enum ubyte SHOW_PARTICLES = 2; 5367 5368 public enum string[] FIELDS = ["entityId", "effectId", "amplifier", "duration", "flags"]; 5369 5370 public uint entityId; 5371 public ubyte effectId; 5372 public ubyte amplifier; 5373 public uint duration; 5374 public ubyte flags; 5375 5376 public pure nothrow @safe @nogc this() {} 5377 5378 public pure nothrow @safe @nogc this(uint entityId, ubyte effectId=ubyte.init, ubyte amplifier=ubyte.init, uint duration=uint.init, ubyte flags=ubyte.init) { 5379 this.entityId = entityId; 5380 this.effectId = effectId; 5381 this.amplifier = amplifier; 5382 this.duration = duration; 5383 this.flags = flags; 5384 } 5385 5386 public pure nothrow @safe ubyte[] encode(bool writeId=true)() { 5387 _buffer.length = 0; 5388 static if(writeId){ writeBytes(varuint.encode(ID)); } 5389 writeBytes(varuint.encode(entityId)); 5390 writeBigEndianUbyte(effectId); 5391 writeBigEndianUbyte(amplifier); 5392 writeBytes(varuint.encode(duration)); 5393 writeBigEndianUbyte(flags); 5394 return _buffer; 5395 } 5396 5397 public pure nothrow @safe void decode(bool readId=true)() { 5398 static if(readId){ uint _id; _id=varuint.decode(_buffer, &_index); } 5399 entityId=varuint.decode(_buffer, &_index); 5400 effectId=readBigEndianUbyte(); 5401 amplifier=readBigEndianUbyte(); 5402 duration=varuint.decode(_buffer, &_index); 5403 flags=readBigEndianUbyte(); 5404 } 5405 5406 public static pure nothrow @safe EntityEffect fromBuffer(bool readId=true)(ubyte[] buffer) { 5407 EntityEffect ret = new EntityEffect(); 5408 ret._buffer = buffer; 5409 ret.decode!readId(); 5410 return ret; 5411 } 5412 5413 public override string toString() { 5414 return "EntityEffect(entityId: " ~ std.conv.to!string(this.entityId) ~ ", effectId: " ~ std.conv.to!string(this.effectId) ~ ", amplifier: " ~ std.conv.to!string(this.amplifier) ~ ", duration: " ~ std.conv.to!string(this.duration) ~ ", flags: " ~ std.conv.to!string(this.flags) ~ ")"; 5415 } 5416 5417 } 5418