Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance protocol support #18

Closed
iceiix opened this issue Nov 5, 2018 · 11 comments
Closed

Enhance protocol support #18

iceiix opened this issue Nov 5, 2018 · 11 comments

Comments

@iceiix
Copy link
Owner

iceiix commented Nov 5, 2018

Support multiple protocols:

https://wiki.vg/Protocol_History
https://wiki.vg/Protocol_version_numbers#Versions_after_the_Netty_rewrite

Game version Protocol version Code Supported?
1.16.4, .3, .2 754, 753, 751 #390
1.16.1 736 #345
1.15.2 578 #338
1.15.1 575 #252
1.14.4 498 #207
1.14.3 490 #194
1.14.2 485 #170
1.14.1 480 #151
1.14 477 #132
19w02a 452 iceiix/steven#82
18w50a 451 iceiix/steven#79
1.13.2 404 iceiix/steven#67
1.12.2 340 iceiix/steven#40, iceiix/steven#54
1.11.2 316 iceiix/steven#38, iceiix/steven#48, iceiix/steven#54
1.11 315 iceiix/steven#54 *
1.10.2 210 iceiix/steven#14
1.9.2 109 iceiix/steven#15
1.9 107 iceiix/steven#16
15w39c 74 iceiix/steven#17, iceiix/steven#56
1.8.9 47 iceiix/steven#37, iceiix/steven#57
1.7.10 5 iceiix/steven#64
@iceiix
Copy link
Owner Author

iceiix commented Nov 5, 2018

Backported earlier protocol support from commit history, on branches:

Tested these against older servers and they work, but, only one protocol version is supported at a time, i.e., these revert newer protocol support.

There is earlier protocol support in history, but while the project was in its infancy:

The initial commit used 15w36c (69), but steven-rust's predecessor, steven-go, goes back further (changing SupportedProtocolVersion instead of SUPPORTED_PROTOCOL), lots of snapshots:

1.8.3 (47) was added in Thinkofname/steven-go@d3ff0a2 all: more work, the second commit after initial commit.

https://wiki.vg/Protocol_History lists protocol versions (but oddly, seems to be missing 47 = 1.8.3?), and https://wiki.vg/Protocol_version_numbers#Versions_after_the_Netty_rewrite to last known documentation. https://minecraft.gamepedia.com/Java_Edition_version_history is also a useful reference. The latest version at the time of this writing is 1.13.2 (404, released October 22nd, 2018) so Steven is a few years behind, only supporting 1.11 (315, released November 14th, 2016).

Supporting newer versions is of course desirable, but should older version support just be dropped? It could be nice to have it around to support servers that haven't upgraded. Not every version, but some more common or useful ones. 1.7.6 up to 1.7.10 use protocol version 5, before then there was a "large protocol rework". Cuberite, the C++ server, does this: https://github.com/cuberite/cuberite/tree/master/src/Protocol - classes for major versions 1.9, 1.8, 1.10, 1.11, 1.12 and they are working on 1.13. https://github.com/cuberite/cuberite/blob/master/src/Protocol/ProtocolRecognizer.h#L20

#define MCS_CLIENT_VERSIONS "1.8.x, 1.9.x, 1.10.x, 1.11.x, 1.12.x"
#define MCS_PROTOCOL_VERSIONS "47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340"
#define MCS_LATEST_PROTOCOL_VERSION 340

@iceiix
Copy link
Owner Author

iceiix commented Nov 5, 2018

src/protocol/packet.rs defines packets using state_packets! macro, defined in src/protocol/mod.rs with macro_rules!, then numbered incrementally in src/macros.rs with create_ids!:

macro_rules! create_ids {
    ($t:ty, ) => ();
    ($t:ty, prev($prev:ident), $name:ident) => (
        #[allow(non_upper_case_globals)]
        pub const $name: $t = $prev + 1;
    );

so the packet identifiers are assigned from the order of definition. But the IDs changed over protocol versions, especially for the next major release after the currently supported version (1.11 to 1.12), and again in 1.13, so it could be worthwhile to factor out the IDs from the order in the code. Add a layer of indirection? Map (protocol version, packet id) to each packet? src/protocol/mod.rs:

                pub mod internal_ids {
                    create_ids!(i32, $($name),*);
                }

                $(
                    #[derive(Default, Debug)]
                    $(#[$attr])* pub struct $name {
                        $($(#[$fattr])* pub $field: $field_type),+,
                    }

                    impl PacketType for $name {

                        fn packet_id(&self) -> i32 { internal_ids::$name }

adds symbols in internal_ids:: which map to the id

@iceiix
Copy link
Owner Author

iceiix commented Nov 5, 2018

Expand the create_ids! macro to start, then change it per version? Using trace_macros: https://gist.github.com/iceiix/fc3941d7bc0c639f7eae9d90eacc1212

@iceiix
Copy link
Owner Author

iceiix commented Nov 5, 2018

Packet IDs are also available at, for example: https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.11/protocol.json

iceiix referenced this issue in iceiix/steven Nov 5, 2018
https://github.com/iceiix/steven/issues/18#issuecomment-435730991
Expanded the macro using trace_macros!() and some scripts:

https://gist.github.com/iceiix/fc3941d7bc0c639f7eae9d90eacc1212
pbpaste|grep pub\ const|perl -pe's/.*] //g'>/tmp/e
i=0
for line in file("/tmp/e").readlines():
    line = line.strip()
    if "=" in line:
        var, value = line.split("=")
    else:
        var = line
        value=""
    if "0" in value:
        i = 0
    else:
        i += 1
    var = var.strip().split(":")[0].strip()
    print "%s: i32 = 0x%.2x;" % (var, i)
iceiix referenced this issue in iceiix/steven Dec 1, 2018
The first step of https://github.com/iceiix/steven/issues/18 Enhance protocol support,
instead of hardcoding a fixed version, the client now matches whatever the server sent.

* Get the protocol version to send from the ping packet

* Save/load server protocol versions to disk, server_versions.json

* Fallback to default SUPPORTED_PROTOCOL if no ping response
iceiix referenced this issue in iceiix/steven Dec 1, 2018
https://github.com/iceiix/steven/issues/18#issuecomment-435730991
Expanded the macro using trace_macros!() and some scripts:

https://gist.github.com/iceiix/fc3941d7bc0c639f7eae9d90eacc1212
pbpaste|grep pub\ const|perl -pe's/.*] //g'>/tmp/e
i=0
for line in file("/tmp/e").readlines():
    line = line.strip()
    if "=" in line:
        var, value = line.split("=")
    else:
        var = line
        value=""
    if "0" in value:
        i = 0
    else:
        i += 1
    var = var.strip().split(":")[0].strip()
    print "%s: i32 = 0x%.2x;" % (var, i)
iceiix referenced this issue in iceiix/steven Dec 1, 2018
…code) (#19)

The packet IDs were assigned by the `create_ids!` macro, in the order they are in
the source code. This reduces flexibility for adopting new protocols, since the
packets can be reordered arbitrarily. Part of https://github.com/iceiix/steven/issues/18
@iceiix
Copy link
Owner Author

iceiix commented Dec 1, 2018

Merged version_from_ping and flexible packet_ids branches. Note, dropped this commit which was the beginning of supporting 1.10.2, maybe use macros instead to avoid more redundant duplication? iceiix/steven@8f488d9

iceiix referenced this issue in iceiix/steven Dec 1, 2018
Only a minor update, -1 now indicates no color, so changed u8 to i8:

https://wiki.vg/Protocol_History#16w50a
https://wiki.vg/index.php?title=Protocol&diff=8543&oldid=8405
https://wiki.vg/index.php?title=Protocol&oldid=8543

and updated version numbers. 1.11.2 uses the same 1.11 assets, which can
be found by looking up 1.11.2 in:

https://launchermeta.mojang.com/mc/game/version_manifest.json
https://launchermeta.mojang.com/v1/packages/6bd228727ed48bd7ac7bdc0088587dad0fb7c02b/1.11.2.json

1.11.2/1.11 is compatible except for the version number, which is now sent matching the server (#20), so no backwards-compatible branch for 1.11 (315) is needed.

https://github.com/iceiix/steven/issues/18 Enhance protocol support
@iceiix
Copy link
Owner Author

iceiix commented Dec 2, 2018

A few observations from developing protocol support on branches, there are a several kinds of protocol changes: Additive, purely adding new content in a backwards-compatible way. This is of course the easiest to support multi-protocol, since the code for e.g. new packets or enum fields can remain in the application but not be used. Shifting IDs, this occurs fairly frequently during major protocol updates, when new packets are added others are commonly renumbered. Explicitly assigned packet IDs make this easier to support: need to expand self::$state::$dir::internal_ids::$name to also include protocol version, different lists for each. Implementation changes are the most difficult to support, examples include changing a protocol field value or behavior. However, maybe this could be in many cases be recast as adding new packets and changing IDs, i.e., if incompatibly-changed packets are added as new packets, only used for that protocol. For example, 1.12.2+'s keep-alives with i64 ids would be a different packet than pre-1.12.2 keep-alives with varints, mapped accordingly in the respective protocols. Some changes may require special-casing different paths in the code, especially if the incompatible packet is sent from us (serverbound, client-to-server). But not always, this particular change, keep-alives, could be handled something like this:

// fn entity_tick(&mut self, renderer: &mut render::Renderer, delta: f64) {
                       self pck {

                            KeepAliveClientbound_i64 => on_keep_alive_i64,
                            KeepAliveClientbound_varint => on_keep_alive_varint,
// impl Server {
    fn on_keep_alive_i64(&mut self, keep_alive: packet::play::clientbound::KeepAliveClientbound_i64) {
        self.write_packet(packet::play::serverbound::KeepAliveServerbound_i64 {
            id: keep_alive.id,
        });
    }

    fn on_keep_alive_varint(&mut self, keep_alive: packet::play::clientbound::KeepAliveClientbound_varint) {
        self.write_packet(packet::play::serverbound::KeepAliveServerbound_varint {
            id: keep_alive.id,
        });
    }

@iceiix
Copy link
Owner Author

iceiix commented Dec 3, 2018

Merged in the 1.12.2 update (#40) to the main branch, so now the other version branches (#14 #15 #16 #17 #37) have conflicts, would need to rebase on top of 1.11.2 (#48) to resolve, but maybe reopen each against the preceding version? Anyways these branches are only for reference until implement multi-protocol support. Next up 1.13.2 (404), latest stable at the time of this writing: https://wiki.vg/Protocol, lots of changes: https://wiki.vg/Protocol_History#1.13.2

iceiix referenced this issue in iceiix/steven Dec 3, 2018
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 #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 #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
iceiix referenced this issue in iceiix/steven Dec 4, 2018
Closes #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
@iceiix
Copy link
Owner Author

iceiix commented Dec 4, 2018

Implemented all the working branches into multi-protocol, so 7 versions are now supported: 1.12.2, 1.11.2, 1.11, 1.10.2, 1.9.2, 1.9, 15w39c. The snapshot protocol had the biggest changes, so although it is kind of unusual to support snapshots, it was good to get out of the way, since older release versions will encompass many of its changes, and it helped inform how to refactor the code, the basic design described above. Now to expand the protocol support slightly, in both directions, only a few more to add.

@iceiix
Copy link
Owner Author

iceiix commented Dec 4, 2018

Although Steven is already far down the path of its own protocol serialization implementations, this project is worth mentioning: http://protodef.io https://github.com/ProtoDef-io ProtoDef. There are a bunch of protocol definitions in ProtoDef at https://github.com/PrismarineJS/minecraft-data, and there are wrappers for JavaScript, Python, Elixir, Java, and Haskell, with the possibility to create more, PrismarineJS/minecraft-data#35 mentions Rust. They have a few generators, node-protodef written in JS, elixir-protodef in Elixir (leverages the Erlang VM) and the new one (at least there is talk about prismarine-chunk switching to it: PrismarineJS/prismarine-chunk#45) seems to be protodefc, "Compiler for protodef written in Rust", it supports Javascript and Python but they also have Java and Rust listed in the readme. On one hand it would be nice having Prismarine centralize the work of defining new protocol schemas, but on the other hand Steven would still need to adopt them and it adds more dependencies for what is already 70% done. Nonetheless, certainly useful for reference.

iceiix referenced this issue in iceiix/steven Dec 9, 2018
Protocol 47 (1.8.9-1.8) is the biggest multiprotocol (https://github.com/iceiix/steven/issues/18) change yet:

* New chunk format (load_chunk18)
* New metadata format (Metadata18)
* New packets and changes to 13 packets

References:

http://wiki.vg/index.php?title=Protocol&oldid=7368
https://wiki.vg/Protocol_version_numbers#Versions_after_the_Netty_rewrite
https://wiki.vg/Protocol_History#1.8
https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.8/protocol.json
1.8 chunk format: https://wiki.vg/index.php?title=Chunk_Format&oldid=6124
1.9 chunk format: https://wiki.vg/index.php?title=Chunk_Format&oldid=7411
1.8 vs 1.9: https://wiki.vg/index.php?title=Chunk_Format&diff=7411&oldid=6124
https://github.com/PrismarineJS/prismarine-chunk/blob/master/src/pc/1.8/section.js
https://github.com/PrismarineJS/prismarine-chunk/blob/master/src/pc/1.8/chunk.js


Details:

* Add 1.8.9 packet IDs from #37

* Add ChunkDataBulk, parse the ChunkMeta and save data in Vec<u8>

* Add EntityEquipment u16 variant, EntityStatus, ChunkData u16 variants

* SpawnPlayer with added held item

https://wiki.vg/Protocol_History#15w31a Removed Current Item short from Spawn Player (0x0C)

* SpawnObject no UUID and optional velocity

https://wiki.vg/index.php?title=Protocol&oldid=7368#Spawn_Object
https://wiki.vg/Protocol_History#15w31a
Added Entity UUID after entity ID to Spawn Object (0x0E)
Spawn Object always sends velocity, even if data is 0

* SpawnMob no UUID variant

https://wiki.vg/Protocol_History#15w31a
Added Entity UUID after entity ID to Spawn Mob (0x0F)

* Maps packet without tracking position boolean

https://wiki.vg/index.php?title=Protocol&oldid=7368#Map
https://wiki.vg/Protocol_History#15w34a
Added tracking position boolean to Map (0x34)

* Update Entity NBT was removed and Bossbar added (both 0x49) >1.8

https://wiki.vg/index.php?title=Protocol&oldid=7368#Update_Entity_NBT
https://wiki.vg/Protocol_History#15w31a
Removed Update Entity NBT Packet (0x49)
Added Boss Bar packet (0x4

* Use entity without hands

https://wiki.vg/index.php?title=Protocol&oldid=7368#Use_Entity
https://wiki.vg/Protocol_History#15w31a
Added VarInt enum for selected hand in Use Entity (0x02); only sent if type is interact or interact at

* Player block placement, held item stack and face byte variant

https://wiki.vg/index.php?title=Protocol&oldid=7368#Player_Block_Placement
https://wiki.vg/Protocol_History#15w31a
Face for Player Block Placement is now a VarInt enum instead of a byte
Replaced held item (slot) with VarInt enum selected hand in Player Block Placement

* Arm swing without hands, a packet with no fields, uses a ZST

https://wiki.vg/index.php?title=Protocol&oldid=7368#Animation_2
#57 (comment)
https://doc.rust-lang.org/nomicon/exotic-sizes.html

* ClickWindow uses u8 mode, same as in 15w39c

* ClientSettings without hands

* SpectateTeleport is added before ResourcePackStatus


* Copy load_chunk to load_chunk19 and load_chunk18

* 1.8 chunk reading implementation, load_chunk18

* Support both metadata formats, Metadata18/Metadata19

* Remove fmt::Debug

* Implement formatting in MetadataBase and bounce through fmt::Debug
iceiix referenced this issue in iceiix/steven Dec 9, 2018
Protocol 47 (1.8.9-1.8) is the biggest multiprotocol (https://github.com/iceiix/steven/issues/18) change yet:

* New chunk format (load_chunk18)
* New metadata format (Metadata18)
* New packets and changes to 13 packets

References:

http://wiki.vg/index.php?title=Protocol&oldid=7368
https://wiki.vg/Protocol_version_numbers#Versions_after_the_Netty_rewrite
https://wiki.vg/Protocol_History#1.8
https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.8/protocol.json
1.8 chunk format: https://wiki.vg/index.php?title=Chunk_Format&oldid=6124
1.9 chunk format: https://wiki.vg/index.php?title=Chunk_Format&oldid=7411
1.8 vs 1.9: https://wiki.vg/index.php?title=Chunk_Format&diff=7411&oldid=6124
https://github.com/PrismarineJS/prismarine-chunk/blob/master/src/pc/1.8/section.js
https://github.com/PrismarineJS/prismarine-chunk/blob/master/src/pc/1.8/chunk.js

Details:

* Add 1.8.9 packet IDs from #37

* Add ChunkDataBulk, parse the ChunkMeta and save data in Vec<u8>

* Add EntityEquipment u16 variant, EntityStatus, ChunkData u16 variants

* SpawnPlayer with added held item

https://wiki.vg/Protocol_History#15w31a Removed Current Item short from Spawn Player (0x0C)

* SpawnObject no UUID and optional velocity

https://wiki.vg/index.php?title=Protocol&oldid=7368#Spawn_Object
https://wiki.vg/Protocol_History#15w31a
Added Entity UUID after entity ID to Spawn Object (0x0E)
Spawn Object always sends velocity, even if data is 0

* SpawnMob no UUID variant

https://wiki.vg/Protocol_History#15w31a
Added Entity UUID after entity ID to Spawn Mob (0x0F)

* Maps packet without tracking position boolean

https://wiki.vg/index.php?title=Protocol&oldid=7368#Map
https://wiki.vg/Protocol_History#15w34a
Added tracking position boolean to Map (0x34)

* Update Entity NBT was removed and Bossbar added (both 0x49) >1.8

https://wiki.vg/index.php?title=Protocol&oldid=7368#Update_Entity_NBT
https://wiki.vg/Protocol_History#15w31a
Removed Update Entity NBT Packet (0x49)
Added Boss Bar packet (0x4

* Use entity without hands

https://wiki.vg/index.php?title=Protocol&oldid=7368#Use_Entity
https://wiki.vg/Protocol_History#15w31a
Added VarInt enum for selected hand in Use Entity (0x02); only sent if type is interact or interact at

* Player block placement, held item stack and face byte variant

https://wiki.vg/index.php?title=Protocol&oldid=7368#Player_Block_Placement
https://wiki.vg/Protocol_History#15w31a
Face for Player Block Placement is now a VarInt enum instead of a byte
Replaced held item (slot) with VarInt enum selected hand in Player Block Placement

* Arm swing without hands, a packet with no fields, uses a ZST

https://wiki.vg/index.php?title=Protocol&oldid=7368#Animation_2
#57 (comment)
https://doc.rust-lang.org/nomicon/exotic-sizes.html

* ClickWindow uses u8 mode, same as in 15w39c

* ClientSettings without hands

* SpectateTeleport is added before ResourcePackStatus

* Copy load_chunk to load_chunk19 and load_chunk18

* 1.8 chunk reading implementation, load_chunk18

* Support both metadata formats, Metadata18/Metadata19

* Remove fmt::Debug

* Implement formatting in MetadataBase and bounce through fmt::Debug
iceiix referenced this issue in iceiix/steven Dec 9, 2018
Protocol 47 (1.8.9-1.8) is the biggest multiprotocol (https://github.com/iceiix/steven/issues/18) change yet:

* New chunk format (load_chunk18)
* New metadata format (Metadata18)
* New packets and changes to 13 packets

References:

http://wiki.vg/index.php?title=Protocol&oldid=7368
https://wiki.vg/Protocol_version_numbers#Versions_after_the_Netty_rewrite
https://wiki.vg/Protocol_History#1.8
https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.8/protocol.json
1.8 chunk format: https://wiki.vg/index.php?title=Chunk_Format&oldid=6124
1.9 chunk format: https://wiki.vg/index.php?title=Chunk_Format&oldid=7411
1.8 vs 1.9: https://wiki.vg/index.php?title=Chunk_Format&diff=7411&oldid=6124
https://github.com/PrismarineJS/prismarine-chunk/blob/master/src/pc/1.8/section.js
https://github.com/PrismarineJS/prismarine-chunk/blob/master/src/pc/1.8/chunk.js

Details:

* Add 1.8.9 packet IDs from #37

* Add ChunkDataBulk, parse the ChunkMeta and save data in Vec<u8>

* Add EntityEquipment u16 variant, EntityStatus, ChunkData u16 variants

* SpawnPlayer with added held item

https://wiki.vg/Protocol_History#15w31a Removed Current Item short from Spawn Player (0x0C)

* SpawnObject no UUID and optional velocity

https://wiki.vg/index.php?title=Protocol&oldid=7368#Spawn_Object
https://wiki.vg/Protocol_History#15w31a
Added Entity UUID after entity ID to Spawn Object (0x0E)
Spawn Object always sends velocity, even if data is 0

* SpawnMob no UUID variant

https://wiki.vg/Protocol_History#15w31a
Added Entity UUID after entity ID to Spawn Mob (0x0F)

* Maps packet without tracking position boolean

https://wiki.vg/index.php?title=Protocol&oldid=7368#Map
https://wiki.vg/Protocol_History#15w34a
Added tracking position boolean to Map (0x34)

* Update Entity NBT was removed and Bossbar added (both 0x49) >1.8

https://wiki.vg/index.php?title=Protocol&oldid=7368#Update_Entity_NBT
https://wiki.vg/Protocol_History#15w31a
Removed Update Entity NBT Packet (0x49)
Added Boss Bar packet (0x4

* Use entity without hands

https://wiki.vg/index.php?title=Protocol&oldid=7368#Use_Entity
https://wiki.vg/Protocol_History#15w31a
Added VarInt enum for selected hand in Use Entity (0x02); only sent if type is interact or interact at

* Player block placement, held item stack and face byte variant

https://wiki.vg/index.php?title=Protocol&oldid=7368#Player_Block_Placement
https://wiki.vg/Protocol_History#15w31a
Face for Player Block Placement is now a VarInt enum instead of a byte
Replaced held item (slot) with VarInt enum selected hand in Player Block Placement

* Arm swing without hands, a packet with no fields, uses a ZST

https://wiki.vg/index.php?title=Protocol&oldid=7368#Animation_2
#57 (comment)
https://doc.rust-lang.org/nomicon/exotic-sizes.html

* ClickWindow uses u8 mode, same as in 15w39c

* ClientSettings without hands

* SpectateTeleport is added before ResourcePackStatus

* Copy load_chunk to load_chunk19 and load_chunk18

* 1.8 chunk reading implementation, load_chunk18

* Support both metadata formats, Metadata18/Metadata19

* Remove fmt::Debug

* Implement formatting in MetadataBase and bounce through fmt::Debug
@iceiix
Copy link
Owner Author

iceiix commented Dec 10, 2018

1.8.9 support is in (iceiix/steven#57), next is 1.7.10 (iceiix/steven#64), then the big one, 1.13.2, fortunately prismarine-chunk just published 1.10.1 with 1.13 chunk format support to use for reference: https://github.com/PrismarineJS/prismarine-chunk/commits/master and https://github.com/PrismarineJS/prismarine-chunk/blob/master/src/pc/1.13/chunk.js

iceiix referenced this issue in iceiix/steven Dec 16, 2018
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
iceiix referenced this issue in iceiix/steven Dec 17, 2018
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
iceiix referenced this issue in iceiix/steven Dec 29, 2018
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, replaces 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 bed offsets
* Add offset None to Missing253 and Missing254, no holes in block states of 1.13.2
* Add bed colors
* Add rails offsets
* Add seagrass, tall seagrass, remove redundant deadgrass, and piston offset
* Add piston head offsets
* Add piston extension offsets
* Add torch, TNT, fire offsets, remove slabs
* Add stair offsets
* Add chest offsets
* Add redstone wire offsets
* Add furnance offset, merges lit into a property
* Add sign offset and door offsets
* Add ladder offset
* Add wallsign offsets
* 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 jukebox offset
* Add fence offsets
* 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
* Add trapdoor offsets
* Add trapdoor wood as tree variants even though its not a real property
Avoids code duplication, and the IDs match up
* Change brown mushroom block to booleans instead of MushroomVariant
* Add mushroom block offsets, red/brown mushroom blocks, and a new mushroom stem block
* Add iron bars offsets
* Add glass pane offsets
* Add from melon/pumpkin stems, fence gate offsets, up to dragon egg
* No wooden slabs here
* Add cocoa offsets
* And ender chest, tripwire hook, and tripwire offsets
* 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.
* Add wooden button variant offsets
* Change wooden buttons to use a variant property instead of duplicating code
* Add skull offsets, wither skeleton skull
* Add heads, daylight detector, stained glass offsets
* Increase recursion limit in steven_blocks
* Add iron trapdoor, prismarine stairs, dark/brick prismarine stairs offsets
* Change prismarine stairs to use PrismarineVariant normal/brick/dark
* Add SlabType, like BlockHalf but includes Double
* Remove SlabType, add Double to BlockHalf, add PrismarineSlab
* Add hay block offsets
* Add double plant offsets
* Fix prismarine slab offsets
* Fix double plant offset
* Add colored banner offsets
* No daylight detector inverted offset
* Add wooden slab including double slab, in a different position for pre-1.13 and 1.13
* Add stone slab offsets
* StoneSlabVariant::Wood -> StoneSlabVariant::PetrifiedWood
* Add smooth stones
* Add fence_gate_offset() for wooden fence gates
* Add wooden fence offsets
* Add end rod offset
* Add chorus plant offsets
* Add purpur pillar offsets
* Add repeating/chain command block offsets
* Add frosted ice age, offset
* Add observer offsets
* Add glazed terracotta offsets
* Add new blocks: kelp, turtle egg, coral, coral fans, sea pickle, blue ice,
* Add new blocks: conduit, void air, cave aid, bubble column, last of the 1.13 blocks
iceiix referenced this issue in iceiix/steven Dec 29, 2018
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
@iceiix
Copy link
Owner Author

iceiix commented Dec 29, 2018

With 1.13.2 now supported as of iceiix/steven#67, all currently planned protocol versions are now supported (1.7.10 - 1.13.2, major versions), at least their initial support, not that there isn't any bugs but it is a start. Only future multiprotocol work would be for new versions as they are released (1.14 when?), and bugfixes, so I'm closing this feature enhancement issue.

@iceiix iceiix closed this as completed Dec 29, 2018
iceiix referenced this issue in iceiix/steven Jan 11, 2019
Adds support for the 19w02a (451) protocol, yesterday's snapshot.
Builds on #79 18w50a
Closer to https://github.com/iceiix/steven/issues/72 1.14 protocol support
Updates https://github.com/iceiix/steven/issues/18 Enhance protocol support

* Add 19w02a (452) protocol

* Add campfire recipe type

* Add trade list new packet, and window open variants
@iceiix iceiix transferred this issue from iceiix/steven Jan 12, 2019
iceiix added a commit that referenced this issue May 5, 2019
Previously, the server protocol was detected in the server listing GUI,
and saved for each server in a server_versions.json file. connect_to()
would read this file to get the version to use, an ugly hack/workaround
for threading/intercommunication challenges, and a questionable attempt
at avoiding another round-trip exchange.

Now, the server is re-pinged in connect_to() to get the protocol version
to use. This is a blocking ping so it may somewhat slow down server
connecting, but avoids the race conditions with the server list, and
undesirable intertwining the GUI with the server connection logic.

This hack was present since the original multiprotocol support (#18),
but it was blocking other enhancements, about time to remove it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant