Commit Graph

14 Commits

Author SHA1 Message Date
iceiix cfcc7d2a1f
1.17.1 (756) protocol (#605)
https://wiki.vg/index.php?title=Protocol&oldid=16918

New and changed packets:
* 1.17.1 packet id shifts, new clientbound packets
* Add WindowPong new packet serverbound
* Add Tags_Nested packet variant
* Add TeleportPlayer_WithDismount packet variant
* Add ChunkData_Biomes3D_Bitmasks packet variant 
* Add WindowItems_StateCarry variant, split WindowItems_i16
* Add WindowSetSlot_State packet variant
* Add Explosion_VarInt packet variant
* Add UpdateLight_Arrays variant
* Add ResourcePackSend_Prompt variant
* Add SpawnPosition_Angle variant
* Add EntityProperties_VarIntVarInt variant, using VarInts in both fields 
* Add ClientSettings_Filtering variant
* Add ClickWindow_State variant
* Add EditBook packet variant 
* Fix many Particle packet variant definitions

* server: handle TeleportPlayer_WithDismount
* server: handle ChunkData_Biomes3D_Bitmasks

* world: add num_sections to self.load_chunk19_or_115
* world: load_chunk19_to_117: accept 64-bit mask

* metadata: add PoseData::LongJumping 

* protocol: update Cargo.lock for serde_json 1.0.130
* build: pin to wasm-pack 0.10.0
2021-09-05 13:30:32 -07:00
ice_iix 028ab1cbe3 1.16.4-19w02a: fix Maps packet missing locked, closes #454 2020-12-28 14:02:05 -08:00
ice_iix 0626888197 1.16.1 protocol support (736) (#345)
* Update shifted packet ids

* Add new smithing recipe type

* Also support 1.16 (735), same packets as 1.16.1 (736)

New packets:

* GenerateStructure

New packet variants:

* UseEntity_Sneakflag, split from UseEntity_Hand

* ClientAbilities_u8, split from ClientAbilities_f32

* UpdateJigsawBlock_Joint, split from UpdateJigsawBlock_Type

* ServerMessage_Sender, split from ServerMessage_Position

* ChunkData_Biomes3D_bool, split from ChunkData_Biomes3D

* JoinGame_WorldNames, split from JoinGame_HashedSeed_Respawn

* Respawn_WorldName, split from Respawn_Gamemode

* EntityEquipment_VarInt renamed

* UpdateLight_WithTrust, split from UpdateLight_NoTrust

* LoginSuccess_UUID, split from LoginSuccess_String
2020-06-27 18:39:59 -07:00
iceiix 518b6a07f8
Reformat all source with cargo fmt (#335) 2020-06-21 12:17:24 -07:00
ice_iix dd2fb32df1 1.15.1 protocol support (575) (#252)
* Add v1_15_1 for protocol 575

* Update for shifted packet IDs

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=15213#Packets
https://wiki.vg/Pre-release_protocol

* Add SpawnMob packet variant, no metadata

* Add SpawnPlayer packet variant, no metadata

* Add block update actions comments, including beehive

* Add particle packet variant with 64-bit floats

* Add and handle join game and respawn packet variants, with hashed seeds

* Add chunk data packet variant with 3D biomes

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=15213#Chunk_Data
"1024 biome IDs, ordered by x then z then d, in 4×4×4 blocks. Not
present if full chunk is false."

This is a fixed-size array of integers, but Rust doesn't yet support
generics over integers, so the 1024-element array doesn't support
fmt::Debug, hence we wrap it and implement fmt::Debug ourselves.

* Add load_chunk115 to not read chunk data structure biomes

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=15213#Data_structure
2019-12-29 15:55:19 -08:00
iceiix 57da39bb79 Fix SpawnPainting parsing 1.13.2-1.14.4, closes #212 (#213)
The packet changed in 1.13.2 but wasn't updated, so we split the packet
variants into SpawnPainting_String for the old version and
SpawnPainting_VarInt for the new version with a 'motive' VarInt field
instead of a String title.

1.9-1.12.2 SpawnPainting_String: https://wiki.vg/index.php?title=Protocol&oldid=14204#Spawn_Painting
1.13.2-1.14.4 SpawnPainting_VarInt: https://wiki.vg/index.php?title=Protocol&oldid=14889#Spawn_Painting
2019-08-17 13:36:07 -07:00
iceiix 40c7a64c45 1.13+: Fix parsing Teams packet. Closes #205 (#208)
* Add Teams_VarInt packet variant for 1.13+

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14150#Teams

* Rename the variant for 1.9-1.12.2 to Teams_u8
2019-08-11 17:46:34 -07:00
ice_iix ed10ca43b8 Add 1.13.2+ protocol parsing Particle packet variant. Fixes #104
Pre-1.13.2 particle packet: https://wiki.vg/index.php?title=Protocol&oldid=14204#Particle_2
1.13.2 and later: https://wiki.vg/Protocol#Particle_2 + https://wiki.vg/Protocol#Particle

Split into Particle_Data (1.13.2+) and Particle_VarIntArray (pre-1.13.2)

Fixes crash when landing when dropping from creative flight, among other
crashes when a particle packet is sent.
2019-01-26 13:41:54 -08:00
iceiix 26568190d0 1.13.2 (404) multiprotocol support (#67)
Adds support for 1.13.2 protocol (404)
Expands https://github.com/iceiix/steven/issues/18 Enhance protocol support

Metadata:

* Support 1.13.2 slot data format, bool and varint item id, optional damage (moved to NBT)

https://wiki.vg/index.php?title=Slot_Data&type=revision&diff=14363&oldid=7835

Packets:

* Add 1.13.2 packets, and implement all the command data parsers

https://wiki.vg/Command_Data#Parsers

* Send new plugin channel minecraft:brand

https://wiki.vg/Plugin_channels#minecraft:brand

* Add 1.13.2 metadata format, with shifted IDs

https://wiki.vg/Entity_metadata#Entity_Metadata_Format

* Implement particle entity metadata

* Add structures for 16 new packets

Blocks: The Flattening:

* Assign flattened IDs in correct order using new 'offset' macro token

* Assign hierarchical (pre-flattening) block IDs sequentially by counting Some data

* Split VANILLA_ID_MAP into flat/hier struct, to support before and after the flattening

* Extend travis build time to 20 minutes because the blocks macro takes a long time

* Support both flat/hier blocks by passing protocol_version to by_vanilla_id

Add block states and offsets for all blocks, replacing metadata for 1.13+:

* Add stripped logs and what was Log2 to Log
* Add the Wood blocks, should be called bark, previously Axis::None Log
* Add leaves distance and offset
* Add jungle/acacia to Leaves moved from Leaves2
* Add dispenser offsets, direction
* Add note block states
* Add offset None to Missing253 and Missing254, no holes in block states of 1.13.2
* Add bed colors
* Add seagrass, tall seagrass, remove redundant deadgrass, and piston offset
* Add torch, TNT, fire offsets, remove slabs
* Add furnance offset, merges lit into a property
* Add pressure plate offsets, new pressure plates, redstone ore/lit merged
* Add lever offsets, new directions from ceiling/floor, rename LeverDirections
* Add redstone torch offsets, new blocks since lit/unlit is now merged, and standing/wall is split
* Change lever to split face/facing, rm LeverDirection, add AttachedFace
* Add stone button offsets, face/facing similar to lever
* Move face/facing data and variant to AttachedFace, reuse for lever/stonebutton
* Add data_with_facing_and_powered() to AttachedFace, for lever/stonebutton
* Add wooden button offsets each wood
* Add pumpkin without a face
* Add carved pumpkin, portal offsets
* Add lit pumpkin (as jack-o-lantern) offsets after carved pumpkin
* Add repeater offsets, merged into Repeater
* Change brown mushroom block to booleans instead of MushroomVariant
* Add mushroom block offsets, red/brown mushroom blocks, and a new mushroom stem block
* Add command block, cobblestone walls, and flower pot offsets
Empty flower pot, and potted plants including saplings. Rename
variant DarkOak to DarkOakSaplings because it is a sapling, and
remove the duplicate Dandelion variant which causes duplicate blocks.
* Increase recursion limit in steven_blocks
* Add colored banner offsets
* Add wooden slab including double slab, in a different position for pre-1.13 and 1.13
* StoneSlabVariant::Wood -> StoneSlabVariant::PetrifiedWood
* Add fence_gate_offset() for wooden fence gates
* Add frosted ice age, offset
* Add new blocks: kelp, turtle egg, coral, coral fans, sea pickle, blue ice, smooth stone
* Add new blocks: conduit, void air, cave aid, bubble column, last of the 1.13 blocks
2018-12-28 21:22:58 -08:00
iceiix 4d127c55fe 1.7.10 (5) multiprotocol support (#64)
Adds 1.7.10 protocol version 5 support, a major update with significant changes.
Expands https://github.com/iceiix/steven/issues/18 Enhance protocol support

* Add v1_7_10 protocol packet structures and IDs

* EncryptionRequest/Response i16 variant in login protocol

* 1.7.10 slot NBT data parsing

* Support both 1.7/1.8+ item::Stack in read_from, using if protocol_verson

* 1.7.10 chunk format support, ChunkDataBulk_17 and ChunkData_17

* Extract dirty_chunks_by_bitmask from load_chunks17/18/19

* Implement keepalive i32 handler

* Send PlayerPositionLook_HeadY

* Send PlayerBlockPlacement_u8_Item_u8y

* Handle JoinGame_i8_NoDebug

* Handle SpawnPlayer_i32_HeldItem_String

* BlockChange_u8, MultiBlockChange_i16, UpdateBlockEntity_Data, EntityMove_i8_i32_NoGround, EntityLook_i32_NoGround, EntityLookAndMove_i8_i32_NoGround

* UpdateSign_u16, PlayerInfo_String, EntityDestroy_u8, EntityTeleport_i32_i32_NoGround

* Send feet_y = head_y - 1.62, fixes Illegal stance

https://wiki.vg/index.php?title=Protocol&oldid=6003#Player_Position

> Updates the players XYZ position on the server. If HeadY - FeetY is less than 0.1 or greater than 1.65, the stance is illegal and the client will be kicked with the message “Illegal Stance”.

> Absolute feet position, normally HeadY - 1.62. Used to modify the players bounding box when going up stairs, crouching, etc…

* Set on_ground = true in entity teleport, fixes bouncing

* Implement block change, fix metadata/id packing, bounce _u8 through on_block_change

* Implement on_multi_block_change_u16, used with explosions
2018-12-17 15:59:17 -08:00
iceiix 7a8f9b2375 Add 15w39c (74) multiprotocol support (#56)
Closes https://github.com/iceiix/steven/pull/17
This is the biggest multi-protocol change yet, adding many new packet variants and implementing the most, necessitating a respectable amount of refactoring. The last of the "easy" protocols (already implemented, and cribbed from Steven commit history).
For https://github.com/iceiix/steven/issues/18 Enhance protocol support

* Add 15w39c packet IDs

* Add 15w39c packet changes

* Implement EntityMove i16 and i8 packet variants

* Implement EntityLookAndMove i16 and i8 packet variants

* Implement TeleportPlayer no confirm / with confirm packet variants

* Implement EntityTeleport f64 and i32 packet variants

* Implement SpawnPlayer f64 and i32 packet variants
2018-12-03 19:29:02 -08:00
ice_iix 9a15a90af8 Add 1.9 (107) multiprotocol support
Closes https://github.com/iceiix/steven/pull/16
Enhances https://github.com/iceiix/steven/issues/18
2018-12-03 16:06:20 -08:00
ice_iix 556ea1849f Add 1.10.2 (210) multiprotocol support
Closes https://github.com/iceiix/steven/pull/14
Enhances https://github.com/iceiix/steven/issues/18
2018-12-03 15:04:39 -08:00
iceiix c64304b98f Multiprotocol support: 1.12.2 and 1.11.2 (#54)
Adds support for connecting to both 1.12.2 and 1.11.2 (protocols 340 and 316) servers

https://github.com/iceiix/steven/issues/18 Enhance protocol support
Closes https://github.com/iceiix/steven/pull/48 1.11.2 protocol support (316)

* Restore create_ids!() macro in packet identifiers

* Add translate_packet_id() function to map external 1.12.2 packet ids to internal sequential ids

* Implement translate_internal_packet_id() from a new protocol_packet_ids! macro

* Move packet IDs to separate file, v1_12_2.rs

* Change supported protocols constant to an array

* Add v1_11_2 protocol packet IDs (from https://github.com/iceiix/steven/pull/48)

* Add keep alive packet variants: _i64 (>=1.12.2) and _VarInt (<=1.11.2)

* Abstract protocol versions, can now connect to both 1.12.2 and 1.11.2

* Send protocol version in handshake packet

* Restore 1.11 (315) protocol support as in original (https://github.com/thinkofname/steven) Steven
2018-12-03 14:22:47 -08:00