Commit Graph

27 Commits

Author SHA1 Message Date
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
iceiix b554dbb98b 1.12.2 protocol support (340) (#40)
* Add new 1.12.2 packets and shift IDs

CraftRecipeResponse
AdvancementTab
SelectAdvancementTab
Advancements
CraftingRecipeRequest
UnlockRecipes
CraftingBookData

* Fix unlock recipes packet, add length-prefixed arrays

https://wiki.vg/index.php?title=Protocol&oldid=14204#Unlock_Recipes

* Update resources to 1.12.2

* Handle NBTTag metadata (value 13), parsed as nbt::NamedTag

https://wiki.vg/index.php?title=Entity_metadata&oldid=14048#Entity_Metadata_Format
https://github.com/iceiix/steven/pull/40#issuecomment-443454757

* Fix entity packet IDs, 0x25 now is Entity https://wiki.vg/index.php?title=Protocol&oldid=14204#Entity

* Add NBT long array (type 12) support

https://wiki.vg/NBT#Specification

* Entity metadata type is now a VarInt, not u8: https://wiki.vg/index.php?title=Entity_metadata&oldid=14048#Entity_Metadata_Format

* Keep alives changed to longs, no longer VarInts

https://wiki.vg/index.php?title=Protocol&oldid=14204#Keep_Alive_.28serverbound.29

* Parse CraftRecipeResponse (0x2b)

* Add structs for advancements data

* Implement Serializable trait for Advancement and AdvancementDisplay

* Implement advancement progress parsing; advancement packet works

* Particle packet adds fallingdust (46) with length 1

https://wiki.vg/index.php?title=Protocol&oldid=14204#Particle_2
2018-12-02 19:37:41 -08:00
iceiix 400cf2c18b 1.11.2 (316) protocol update (#38)
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
2018-12-01 10:10:48 -08:00
ice_iix da04367669 Use field init shorthand, instead of x:x, just x,
https://rust-lang-nursery.github.io/edition-guide/rust-2018/data-types/field-init-shorthand.html

find src -name '*.rs' -exec perl -pe 's/\b(\w+): \1,/$1,/g' -i {} \;
2018-11-04 13:43:30 -08:00
ice_iix 4b59bce512 Update to use crate:: for current crate, for Rust 2018 edition
From `cargo fix --edition`, see https://rust-lang-nursery.github.io/edition-guide/print.html#the-crate-keyword-refers-to-the-current-crate
2018-11-04 12:06:00 -08:00
ice_iix d2f256e19f Update try!() to new ? syntax for Rust 2018 edition
Not automatically updated, see https://users.rust-lang.org/t/why-does-cargo-fix-replace-try-with-r-try-instead-of/21972/3
There are other tools to replace it, btu this is what I used:
find src -name '*.rs' -exec perl -MRegexp::Common -0777 -pe'$bp=$RE{balanced}{-parens=>"()"}; s/try\!($bp)/substr($1, 1, length($1) - 2) . "?"/ges' -i {} \;
2018-11-04 11:48:51 -08:00
Techcable 6fcf121241 Update to Minecraft 1.11 (Fixes #63) 2016-12-09 14:32:02 +00:00
Techcable 40f146ac65 Update to minecraft 1.10.2 2016-07-10 12:23:59 +01:00
Thinkofname 8f976b3014 Clean up the protocol implementation to use generics instead of trait objects 2016-04-08 18:46:07 +01:00
Thinkofname 844d78ac8e Fix the formatting of StatusResponse's example 2016-04-04 23:58:40 +01:00
Thinkofname 24bdeb7d8f Allow documentation on packets to be actually be considered documentation by rustdoc 2016-04-04 23:50:27 +01:00
Thinkofname f282afe887 Replace usages of x,y,z for block positions with Position 2016-04-03 20:53:40 +01:00
Thinkofname 565e5110db Support Minecraft 1.9.2 2016-03-31 20:51:58 +01:00
Thinkofname 463ca00dd7 Handle block updates from the server 2016-03-31 15:26:07 +01:00
Thinkofname f3377c17c6 Follow some of clippy's suggestions 2016-03-26 14:24:26 +00:00
Thinkofname 03bdb015e5 Update to 1.9.0 2016-03-25 20:56:45 +00:00
Thinkofname 3d6f5ba904 Work on login screen, added ui buttons and textboxes (plus tab fixes) 2016-03-20 20:17:21 +00:00
Thinkofname 826602b459 Automatically allocate packet ids (Fixes #13) 2016-03-18 11:39:03 +00:00
Thinkofdeath 4cce36bf9c Update copyright 2016-03-16 18:25:35 +00:00
Thinkofdeath 6d34f11989 Clean up 2016-03-16 18:01:33 +00:00
Thinkofdeath d9e9ddc2b2 Reformat using rustfmt 2015-10-07 19:36:59 +01:00
Thinkofdeath 999dde1931 Base of ui system 2015-09-18 22:02:08 +01:00
Thinkofdeath 5681f1d69c Add license 2015-09-17 16:23:07 +01:00
Thinkofdeath 880cf0d912 Complete protocol implementation 2015-09-12 20:31:26 +01:00
Thinkofdeath c5d00f6dc8 Tabs to spaces 2015-09-10 11:58:42 +01:00
Thinkofdeath 11c33e2d8d Main part of the protocol complete 2015-09-10 11:49:41 +01:00
Thinkofdeath 3cedeb792e Initial commit 2015-09-07 21:11:00 +01:00