Commit Graph

906 Commits

Author SHA1 Message Date
iceiix 0fbcb192d8
1.14.2 protocol support (485) (#170)
* Add protocol 1.14.2 (485)

* Copy v1_14_2 from v1_14_1

* Update readme for protocol support
2019-05-29 08:22:45 -07:00
iceiix 8faeb9f5cc wasm: Fix operation not supported on std::fs. Closes #115 (#166)
* Add new web-based std::fs replacement, localstoragefs:

https://github.com/iceiix/localstoragefs

* Add std_or_web to switch between std::fs (native) or localstoragefs (web)

* Update www readme for new missing glutin/winit links, opens issue #171
2019-05-29 08:21:56 -07:00
iceiix 836ab9f126
wasm: Fix operation not supported on std::fs. Closes #115 (#166)
* Add new web-based std::fs replacement, localstoragefs:

https://github.com/iceiix/localstoragefs

* Add std_or_web to switch between std::fs (native) or localstoragefs (web)

* Update www readme for new missing glutin/winit links, opens issue #171
2019-05-29 08:21:56 -07:00
ice_iix 3eee3e9163 Fix dual-license MIT/Apache-2.0 syntax in Cargo.toml 2019-05-29 08:13:38 -07:00
ice_iix d7340007a0 Use super:: relative instead of crate::protocol absolute import paths 2019-05-25 14:09:09 -07:00
ice_iix 367c3e5e09 Use super:: relative instead of crate::protocol absolute import paths 2019-05-25 14:09:09 -07:00
dependabot-preview[bot] ef334643cc Bump num-traits from 0.2.7 to 0.2.8 (#165)
Bumps [num-traits](https://github.com/rust-num/num-traits) from 0.2.7 to 0.2.8.
- [Release notes](https://github.com/rust-num/num-traits/releases)
- [Changelog](https://github.com/rust-num/num-traits/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-traits/compare/num-traits-0.2.7...num-traits-0.2.8)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-24 19:00:29 -07:00
ice_iix 1125c3883d Conditionalize wasm_bindgen to fix compile error on wasm32-wasi
From investigation for #115, now three targets:

- wasm32-unknown-unknown: build with `wasm-pack build`, uses
the #[wasm_bindgen] directive on main()

- wasm32-wasi: build with `cargo +nightly build --target wasm32-wasi`,
requires normal main()

- native targets: same as wasm32-wasi
2019-05-22 18:12:10 -07:00
dependabot[bot] 51aa361bbc Bump num-traits from 0.2.6 to 0.2.7 (#162)
Bumps [num-traits](https://github.com/rust-num/num-traits) from 0.2.6 to 0.2.7.
- [Release notes](https://github.com/rust-num/num-traits/releases)
- [Changelog](https://github.com/rust-num/num-traits/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-traits/compare/num-traits-0.2.6...num-traits-0.2.7)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-22 17:29:39 -07:00
ice_iix c6b753bc9a Update to patched glutin wasm_stub allowing compiling for wasi
Includes 1e48d3216e

Progress towards #115, fixes the missing glutin symbols when compiling
with cargo +nightly build --target wasm32-wasi
2019-05-22 17:28:27 -07:00
iceiix fd7add3f17
wasm: log output to browser JavaScript console (#163)
Logging from the `log` facade goes to the colorized in-game GUI console (opened with the backtick key), as well as standard output using `println!` on the native build. To make this work on the wasm build, web-sys is used to access the `console` object, to call `console.log`, `console.warn`, and so on corresponding to the log levels. Extends #92, fails later (see also #115) but now outputs the starting up message:

[main.rs:206][INFO] Starting steven

* Add println! logging to console.log on wasm

* Initialize logger before config (called 'console variables' for some reason) to avoid having to disable it to reach the first logging statement

* Add web-sys crate for browser console access, wasm32-only

* Refactor logger to call println_level on both web/native

* Add multiple log levels, console.warn etc., matching console_log crate

https://github.com/iamcodemaker/console_log#details
2019-05-22 16:12:43 -07:00
ice_iix bdf18cc6d4 Replace println! with log crate facade macros info!, debug!, etc. 2019-05-22 16:01:14 -07:00
ice_iix fd028d41b0 Replace println! with log crate facade macros info!, debug!, etc. 2019-05-22 16:01:14 -07:00
iceiix 8071db668c
Update to glutin 0.21.0. Closes #157 (#160)
Updating the glutin dependency to a 0.21.0-based branch, based on the migration guide at:
https://gentz.rocks/posts/glutin-v0-21-0-migration-guide/

* Remove glutin::ContextTrait

* Create window with ContextBuilder instead of WindowedContext::new

* Add .window() accessor on WindowContext, since it now dereferences to Context

In order to not break wasm32-unknown-unknown compilation, a minor fork is used of glutin v0.21.0 and a corresponding version of winit: https://github.com/iceiix/glutin/pull/1 https://github.com/iceiix/winit/pull/2
 - with stubs to compile (but not run, see issue #115)
2019-05-19 17:58:08 -07:00
ice_iix 9ceddc5057 Fix toggling fullscreen with F11 initially. Closes #156 2019-05-19 11:43:36 -07:00
dependabot[bot] 381815ce22 Bump reqwest from 0.9.16 to 0.9.17 (#158)
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.9.16 to 0.9.17.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.9.16...v0.9.17)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-19 11:35:47 -07:00
dependabot[bot] f8e59a74bb Bump wasm-bindgen from 0.2.43 to 0.2.44 (#159)
Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen) from 0.2.43 to 0.2.44.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-19 11:35:09 -07:00
iceiix c532c31530 Add support for a modded block: rockwool from Thermal Expansion (#153)
The first in support for modded content, a simple custom block: "rockwool" from the Thermal Expansion and Thermal Foundation mods for Forge:

https://ftb.gamepedia.com/Rockwool_(Thermal_Expansion_3)

This makes use of the Forge handshake (#88 #134 #144), matching the mod block names from the negotiation to numeric identifiers in the world to steven_blocks. Rockwool was chosen due to ease of implementation, it looks like wool from vanilla (except is fire-proof), and by supporting it the groundwork necessary is laid for more sophisticated mod support.

Tested with Thermal Expansion on 1.7.10, 1.10.2 (FTB Beyond), and 1.12.2 Forge servers.

* Add `modid` macro token, skipped from vanilla mappings

* Add ThermalExpansionRockwool block (1.7.10)

* Register modded blocks by modid->[data], and lookup block metadata

* Save block IDs from ModIdData/RegistryData to World modded_block_ids

* Add namespaced mod ids for ModIdData, \u{1}=block \u{2}=item

* Add ThermalFoundation's Rockwool (1.12.2)
2019-05-15 12:49:57 -07:00
iceiix e9b336192a Add support for a modded block: rockwool from Thermal Expansion (#153)
The first in support for modded content, a simple custom block: "rockwool" from the Thermal Expansion and Thermal Foundation mods for Forge:

https://ftb.gamepedia.com/Rockwool_(Thermal_Expansion_3)

This makes use of the Forge handshake (#88 #134 #144), matching the mod block names from the negotiation to numeric identifiers in the world to steven_blocks. Rockwool was chosen due to ease of implementation, it looks like wool from vanilla (except is fire-proof), and by supporting it the groundwork necessary is laid for more sophisticated mod support.

Tested with Thermal Expansion on 1.7.10, 1.10.2 (FTB Beyond), and 1.12.2 Forge servers.

* Add `modid` macro token, skipped from vanilla mappings

* Add ThermalExpansionRockwool block (1.7.10)

* Register modded blocks by modid->[data], and lookup block metadata

* Save block IDs from ModIdData/RegistryData to World modded_block_ids

* Add namespaced mod ids for ModIdData, \u{1}=block \u{2}=item

* Add ThermalFoundation's Rockwool (1.12.2)
2019-05-15 12:49:57 -07:00
ice_iix 3bbab7a128 Refactor recipe parsing minecraft: prefix, related to #155 2019-05-15 12:49:50 -07:00
ice_iix 480b865363 Refactor recipe parsing minecraft: prefix, related to #155 2019-05-15 12:49:50 -07:00
dependabot[bot] b244406850 Bump cfg-if from 0.1.7 to 0.1.9 (#154)
Bumps [cfg-if](https://github.com/alexcrichton/cfg-if) from 0.1.7 to 0.1.9.
- [Release notes](https://github.com/alexcrichton/cfg-if/releases)
- [Commits](https://github.com/alexcrichton/cfg-if/compare/0.1.7...0.1.9)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-15 07:57:45 -07:00
ice_iix 5e0f78d6e2 Update Cargo.lock for steven_blocks for #138
Missed this in the blocks/Cargo.toml update #97 #126 #138, automatic
2019-05-14 17:23:28 -07:00
iceiix 5467304bcf Disable parsing advancements to fix 1.12.2 Forge SevTech crash (#148) (#149)
Leave the advancements packet as an opaque blob for now instead of trying to deserialize it, because it apparently is changed on some modded servers - see https://github.com/iceiix/stevenarella/issues/148
2019-05-13 17:13:22 -07:00
iceiix 8d4d606873
Disable parsing advancements to fix 1.12.2 Forge SevTech crash (#148) (#149)
Leave the advancements packet as an opaque blob for now instead of trying to deserialize it, because it apparently is changed on some modded servers - see https://github.com/iceiix/stevenarella/issues/148
2019-05-13 17:13:22 -07:00
iceiix 1a600c7192 1.14.1 protocol support (480) (#151)
* Copy v1_14_1 from v1_14

* Add protocol 1.14.1 (480)

* Update readme

* 0x08 serverbound is now ClickWindowButton

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14764#Click_Window_Button
2019-05-13 16:45:41 -07:00
iceiix 599227aef2 1.14.1 protocol support (480) (#151)
* Copy v1_14_1 from v1_14

* Add protocol 1.14.1 (480)

* Update readme

* 0x08 serverbound is now ClickWindowButton

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14764#Click_Window_Button
2019-05-13 16:45:41 -07:00
ice_iix 604a09b3ce Enhance -p/--protocol-version to accept game version string
Now you can pass `-p 1.7.10` as an alternative to `-p 5`, etc
2019-05-13 16:35:39 -07:00
ice_iix 1274a75f81 Enhance -p/--protocol-version to accept game version string
Now you can pass `-p 1.7.10` as an alternative to `-p 5`, etc
2019-05-13 16:35:39 -07:00
ice_iix f15ece0377 Replace read_to_string -> read_to_end to improve UTF-8 deserialization
See c1692e950a
There are two more instances, encountered when debugging #148

> Instead of read_to_string(), use read_to_end() to read into a buffer,
> then convert using String::from_utf8() and unwrap it. This gives a
> better error message when UTF-8 fails to decode.

which includes the offending bytes that can't be converted
2019-05-12 14:08:53 -07:00
ice_iix 16886110be Replace read_to_string -> read_to_end to improve UTF-8 deserialization
See c1692e950a
There are two more instances, encountered when debugging #148

> Instead of read_to_string(), use read_to_end() to read into a buffer,
> then convert using String::from_utf8() and unwrap it. This gives a
> better error message when UTF-8 fails to decode.

which includes the offending bytes that can't be converted
2019-05-12 14:08:53 -07:00
ice_iix 10e5d6f441 Replace read_to_string -> read_to_end to improve UTF-8 deserialization
See c1692e950a
There are two more instances, encountered when debugging #148

> Instead of read_to_string(), use read_to_end() to read into a buffer,
> then convert using String::from_utf8() and unwrap it. This gives a
> better error message when UTF-8 fails to decode.

which includes the offending bytes that can't be converted
2019-05-12 14:08:53 -07:00
iceiix 83c848fa6f Fix packet compression (fixes FTB Beyond, etc.). Closes #146 (#147)
Previously, the zlib compressor was initialized once, lazily, then reused for each packet by resetting the stream. This didn't properly emit the zlib headers, so packet compression was broken and caused "java.util.zip.DataFormatException: incorrect header check" on the server. Since packets are only compressed above a threshold, this problem manifested itself only on larger servers, such as 1.10.2 FTB Beyond and Skyfactory 3, and 1.12.2 SevTech: Ages, which require sending a large ModList above the compression threshold enabled by the server. Change to instead recreate the zlib compressor, each time it is used as to capture the full header. For symmetry, the decompressor is also recreated each time.

* Removes self.compression_write and self.compression_read instance variables

* Remove self.compression_write, initialize with cursor

* Log compressing/decompressing packets in network debug mode
2019-05-12 12:15:02 -07:00
iceiix b98ba3afd2
Fix packet compression (fixes FTB Beyond, etc.). Closes #146 (#147)
Previously, the zlib compressor was initialized once, lazily, then reused for each packet by resetting the stream. This didn't properly emit the zlib headers, so packet compression was broken and caused "java.util.zip.DataFormatException: incorrect header check" on the server. Since packets are only compressed above a threshold, this problem manifested itself only on larger servers, such as 1.10.2 FTB Beyond and Skyfactory 3, and 1.12.2 SevTech: Ages, which require sending a large ModList above the compression threshold enabled by the server. Change to instead recreate the zlib compressor, each time it is used as to capture the full header. For symmetry, the decompressor is also recreated each time.

* Removes self.compression_write and self.compression_read instance variables

* Remove self.compression_write, initialize with cursor

* Log compressing/decompressing packets in network debug mode
2019-05-12 12:15:02 -07:00
iceiix 2451e780bd Forge 1.8.9-1.12.2 handshake protocol support (#144)
Adds support for connecting to Forge servers from 1.8.9 up to 1.12.2.
(1.7.10 was already supported with #134 #88)

Tested on:

- 1.8.9 + forge 11.15.1.2318 + ironchest
- 1.10.2 + forge 12.18.3.2511 + ironchest
- 1.11.2 + forge 13.20.1.2588 + ironchest
- 1.12.2 + forge 14.23.5.2837 + ironchest

Changes:

* Parse and handle FmlHs::RegistryData packet for 1.8+

* Fix RegistryData acknowledgement phase WaitingServerComplete

* Fix acknowledgement phase for 1.7.10 ModIdData too, somehow it worked accidentally

* Append \0FML\0 to end of server hostname if Forge mods detected

https://wiki.vg/Minecraft_Forge_Handshake#Connection_to_a_forge_server
2019-05-11 18:37:33 -07:00
iceiix 0cd02fd2da
Forge 1.8.9-1.12.2 handshake protocol support (#144)
Adds support for connecting to Forge servers from 1.8.9 up to 1.12.2.
(1.7.10 was already supported with #134 #88)

Tested on:

- 1.8.9 + forge 11.15.1.2318 + ironchest
- 1.10.2 + forge 12.18.3.2511 + ironchest
- 1.11.2 + forge 13.20.1.2588 + ironchest
- 1.12.2 + forge 14.23.5.2837 + ironchest

Changes:

* Parse and handle FmlHs::RegistryData packet for 1.8+

* Fix RegistryData acknowledgement phase WaitingServerComplete

* Fix acknowledgement phase for 1.7.10 ModIdData too, somehow it worked accidentally

* Append \0FML\0 to end of server hostname if Forge mods detected

https://wiki.vg/Minecraft_Forge_Handshake#Connection_to_a_forge_server
2019-05-11 18:37:33 -07:00
ice_iix a081c73215 1.7.10: Fix player position too high on login. Closes #87
Adds a new TeleportPlayer_NoGround packet, which is subtly different
from TeleportPlayer_NoConfirm. The flags u8 is replaced with an
on_ground bool, but more importantly the Y position is the eyes
position, so we have to translate to feet position for the client.

1.7.10: https://wiki.vg/index.php?title=Protocol&oldid=6003#Player_Position_And_Look
1.8.9: https://wiki.vg/index.php?title=Protocol&oldid=7368#Player_Position_And_Look
2019-05-11 14:53:42 -07:00
ice_iix ba4a7a9d85 1.7.10: Fix player position too high on login. Closes #87
Adds a new TeleportPlayer_NoGround packet, which is subtly different
from TeleportPlayer_NoConfirm. The flags u8 is replaced with an
on_ground bool, but more importantly the Y position is the eyes
position, so we have to translate to feet position for the client.

1.7.10: https://wiki.vg/index.php?title=Protocol&oldid=6003#Player_Position_And_Look
1.8.9: https://wiki.vg/index.php?title=Protocol&oldid=7368#Player_Position_And_Look
2019-05-11 14:53:42 -07:00
ice_iix a159355751 1.7.10: Fix sending head/feet player position, #87
1.8+ removes the player head position, and sends only the feet position.
We store the feet position internally in the client, so the head
position has to be calculated, normally 1.62 units higher. Previously
the calculation was reversed, which caused the client to show its
position as 1.62 units higher than the server, and the server would
correct the position when the client descends to the ground.

1.7.10: https://wiki.vg/index.php?title=Protocol&oldid=6003#Player_Position
1.8.9: https://wiki.vg/index.php?title=Protocol&oldid=7368#Player_Position
2019-05-11 14:24:41 -07:00
iceiix 0034756339 Fix movement fixed-point packets, misplaced players on 1.7/8 (#140)
Movement packets were handled incorrectly, because although the fields are specified as integers they are actually fixed-point values, which need to be converted to floating-point before use. These fields were converted with `as f64`, but they actually need to be scaled. To fix this add several new types, FixedPoint5 for 5-bit fractional fixed-point and FixedPoint12 for 12-bit. Both are parameterized by an integer type: FixedPoint5<i32> and FixedPoint5<i8> for 1.7.10/1.8.9, FixedPoint12<i16> for 1.9+. This moves the calculation into the packet field parsing, so it no longer has to be calculated in src/server/mod.rs since the scaling is taken care of as part of the field type. This fixes the long-standing invisible or actually misplaced players bug on 1.7.10 and 1.8.9, closes #139.

* Add new FixedPoint5<T> type for 1.7/8, https://wiki.vg/Data_types#Fixed-point_numbers

* Add FixedPoint12<i16> for 1.9+, moving type conversion into packet type

https://wiki.vg/index.php?title=Protocol#Entity_Relative_Move

* Add num-traits 0.2.6 dependency for NumCast to use instead of From

* Use FixedPoint5<i32> in spawn object, experience orb, global entity, mob, player, teleport

* Use FixedPoint5<i8> and FixedPoint12<i16> in entity move, look and move

* Update packet handling bouncer functions, using f64::from for each conversion
2019-05-11 13:28:25 -07:00
iceiix c8e13c38bd Fix movement fixed-point packets, misplaced players on 1.7/8 (#140)
Movement packets were handled incorrectly, because although the fields are specified as integers they are actually fixed-point values, which need to be converted to floating-point before use. These fields were converted with `as f64`, but they actually need to be scaled. To fix this add several new types, FixedPoint5 for 5-bit fractional fixed-point and FixedPoint12 for 12-bit. Both are parameterized by an integer type: FixedPoint5<i32> and FixedPoint5<i8> for 1.7.10/1.8.9, FixedPoint12<i16> for 1.9+. This moves the calculation into the packet field parsing, so it no longer has to be calculated in src/server/mod.rs since the scaling is taken care of as part of the field type. This fixes the long-standing invisible or actually misplaced players bug on 1.7.10 and 1.8.9, closes #139.

* Add new FixedPoint5<T> type for 1.7/8, https://wiki.vg/Data_types#Fixed-point_numbers

* Add FixedPoint12<i16> for 1.9+, moving type conversion into packet type

https://wiki.vg/index.php?title=Protocol#Entity_Relative_Move

* Add num-traits 0.2.6 dependency for NumCast to use instead of From

* Use FixedPoint5<i32> in spawn object, experience orb, global entity, mob, player, teleport

* Use FixedPoint5<i8> and FixedPoint12<i16> in entity move, look and move

* Update packet handling bouncer functions, using f64::from for each conversion
2019-05-11 13:28:25 -07:00
ice_iix 72d73f529f Change Lengthable trait method names to into_len/from_len
std::convert::From<usize> cannot be used here because we cannot
implement bool<->usize conversions, due to Rust's orphan rules:

http://smallcultfollowing.com/babysteps/blog/2015/01/14/little-orphan-impls/
"prevent you from implementing external traits for external types"

Nonetheless, Lengthable used the same methods as From. This is allowed
but can require disambiguation if both are used, no longer strictly
needed for #140 but to reduce confusion and improve clarity, renamed
`from` to `from_len` and `into` to `into_len`.
2019-05-11 13:03:24 -07:00
ice_iix 87bfb8d2a4 Change Lengthable trait method names to into_len/from_len
std::convert::From<usize> cannot be used here because we cannot
implement bool<->usize conversions, due to Rust's orphan rules:

http://smallcultfollowing.com/babysteps/blog/2015/01/14/little-orphan-impls/
"prevent you from implementing external traits for external types"

Nonetheless, Lengthable used the same methods as From. This is allowed
but can require disambiguation if both are used, no longer strictly
needed for #140 but to reduce confusion and improve clarity, renamed
`from` to `from_len` and `into` to `into_len`.
2019-05-11 13:03:24 -07:00
iceiix 185f3d0297
Update cgmath and collision. Closes #97, closes #126 (#138)
* Update cgmath and collision. Closes #97, closes #126

* Update steven_blocks cgmath/collision

* Run cargo update
2019-05-10 15:39:56 -07:00
ice_iix 99a4e77a11 Update wasm-bindgen and cargo update. Closes #133 2019-05-08 20:01:06 -07:00
ice_iix b1cae32eed Update to rand 0.6.5 and migrate off deprecated methods. Closes #81
* Import from rand_xorshift crate

* Use shuffle/choose from SliceRandom trait

See https://rust-random.github.io/book/update-0.6.html
2019-05-08 19:32:05 -07:00
ice_iix 04246d4c88 Fix non-JSON sign text rendering, such as on 1.7.10. Closes #135
src/format.rs Component from_string() attempts JSON deserialization
using serde_json::from_str, and if it fails falls back to a literal text
string. Call from_string() instead of deserializing in format::Component
read_from() and then from_value(). Note the from_string() comment:

    // Sometimes mojang sends a literal string, so we should interpret it literally
2019-05-08 19:12:36 -07:00
ice_iix de25096a6b Fix non-JSON sign text rendering, such as on 1.7.10. Closes #135
src/format.rs Component from_string() attempts JSON deserialization
using serde_json::from_str, and if it fails falls back to a literal text
string. Call from_string() instead of deserializing in format::Component
read_from() and then from_value(). Note the from_string() comment:

    // Sometimes mojang sends a literal string, so we should interpret it literally
2019-05-08 19:12:36 -07:00
ice_iix 06cab07ae6 Log plugin messages only if -n/--network-debug enabled 2019-05-08 19:11:23 -07:00
dependabot[bot] 68bf0970a3 Bump serde from 1.0.90 to 1.0.91 (#137)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.90 to 1.0.91.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.90...v1.0.91)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-07 18:51:41 -07:00
ice_iix 938905068b Add command-line option to change default protocol version
Previously, we would send the latest supported protocol version in the
server ping packet. This normally works fine since the server will
respond with the protocol version it supports, which we'll use. However,
some server software such as BungeeCord supports _multiple_ protocols,
and the server will match what the client sent in the ping (if it
supports it). Since BungeeCord is a proxy, it forwards to backend
servers which can be of various versions, which won't necessarily be the
latest.

This change adds a command-line option to change the "default" protocol
version, -p or --default-protocol-version, which is used in the ping
packet instead. Current default is 477 (1.14), but if you pass for
example -p 404 (1.13.2), then BungeeCord will respond accordingly:

packet = Some(StatusResponse(StatusResponse { status: "{\"version\":{\"name\":\"BungeeCord 1.8.x-1.14.x\",\"protocol\":404},\"players\":{\"max\":1,\"online\":0},\"description\":{\"extra\":[{\"color\":\"dark_blue\",\"text\":\"Another Bungee server\"}],\"text\":\"\"},\"modinfo\":{\"type\":\"FML\",\"modList\":[]}}" }))

[main.rs:95][INFO] Detected server protocol version 404

and this protocol will be used. Effectively, this option lets you
masquerade as any supported client version.

See https://github.com/iceiix/stevenarella/issues/125#issuecomment-489484701
2019-05-06 16:00:01 -07:00
iceiix 1476d0628a Add Forge handshake support. Closes #88 (#134)
Adds support for connecting to 1.7.10 modded servers using the FML|HS protocol:
https://wiki.vg/Minecraft_Forge_Handshake

* Handle client-bound plugin message packets

* Parse FML|HS plugin channel messages

* Add ModList serialization using Mod serializable, LenPrefixed<VarInt, Mod>

* Save forge_mods from server ping and send in FML|HS ModList packet

* Show Forge mod count in server ping listing

* Send acknowledgements, completing the handshake

* Add VarShort to custom payload len prefix replaces i16, fixes OOM on large modded servers

* Add custom CoFHLib's SendUUID packet -26

See explanation at https://github.com/SpigotMC/BungeeCord/issues/1437
This packet is defined by CoFHLib in https://github.com/CoFH/CoFHLib/blob/1.7.10/src/main/java/cofh/lib/util/helpers/SecurityHelper.java#L40
Fixes thread '' panicked at 'bad packet id 0xffffffe6 in Clientbound Play' with FTB:IE
2019-05-05 18:39:58 -07:00
iceiix 327efcf043 Add Forge handshake support. Closes #88 (#134)
Adds support for connecting to 1.7.10 modded servers using the FML|HS protocol:
https://wiki.vg/Minecraft_Forge_Handshake

* Handle client-bound plugin message packets

* Parse FML|HS plugin channel messages

* Add ModList serialization using Mod serializable, LenPrefixed<VarInt, Mod>

* Save forge_mods from server ping and send in FML|HS ModList packet

* Show Forge mod count in server ping listing

* Send acknowledgements, completing the handshake

* Add VarShort to custom payload len prefix replaces i16, fixes OOM on large modded servers

* Add custom CoFHLib's SendUUID packet -26

See explanation at https://github.com/SpigotMC/BungeeCord/issues/1437
This packet is defined by CoFHLib in https://github.com/CoFH/CoFHLib/blob/1.7.10/src/main/java/cofh/lib/util/helpers/SecurityHelper.java#L40
Fixes thread '' panicked at 'bad packet id 0xffffffe6 in Clientbound Play' with FTB:IE
2019-05-05 18:39:58 -07:00
ice_iix 30b91f4707 Remove unused Game instance variable protocol_version 2019-05-05 17:33:10 -07:00
ice_iix 2f82d2ae71 Add flag to log network packets for debugging, --network-debug
Pass -n or --network-debug to print out the packets from the server as
they are received, as well as write to last-packet for later analysis.
Useful when debugging network protocol issues. Builds on #90 #114.
2019-05-05 14:32:48 -07:00
ice_iix 4520f6bdae Add flag to log network packets for debugging, --network-debug
Pass -n or --network-debug to print out the packets from the server as
they are received, as well as write to last-packet for later analysis.
Useful when debugging network protocol issues. Builds on #90 #114.
2019-05-05 14:32:48 -07:00
ice_iix 9a6af430df Update to Rust stable 1.34.1 2019-05-05 06:22:31 -07:00
iceiix 047ba79947
Add command-line arguments parsing, --server (#90) (#114)
* Add structopt dependency

* Add command-line --server argument to connect to server on startup

* Don't show login/server screen (which pings servers) when connecting to a server from command-line
2019-05-04 18:36:22 -07:00
ice_iix 6322cf8b21 Re-ping server on connect to detect protocol version
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.
2019-05-04 17:21:58 -07:00
ice_iix 4f4533411e 1.14 protocol support (477) (#132). Closes #72
Adds 1.14 (477) protocol support, based on:

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

* New packets: SetDifficulty, LockDifficulty, UpdateJigsawBlock, UpdateViewPosition, UpdateViewDistance

* New metadata: Optional VarInt (17) and Pose (18)

* Add new join game variant with view distance, without difficulty

* Add new server difficulty variant, with locked boolean

* Implement recipe parsing changes, add stonecutting recipe type
2019-05-04 16:04:19 -07:00
ice_iix f935afdeac 1.14 protocol support (477) (#132). Closes #72
Adds 1.14 (477) protocol support, based on:

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

* New packets: SetDifficulty, LockDifficulty, UpdateJigsawBlock, UpdateViewPosition, UpdateViewDistance

* New metadata: Optional VarInt (17) and Pose (18)

* Add new join game variant with view distance, without difficulty

* Add new server difficulty variant, with locked boolean

* Implement recipe parsing changes, add stonecutting recipe type
2019-05-04 16:04:19 -07:00
ice_iix eca9b8ae00 1.14 protocol support (477) (#132). Closes #72
Adds 1.14 (477) protocol support, based on:

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

* New packets: SetDifficulty, LockDifficulty, UpdateJigsawBlock, UpdateViewPosition, UpdateViewDistance

* New metadata: Optional VarInt (17) and Pose (18)

* Add new join game variant with view distance, without difficulty

* Add new server difficulty variant, with locked boolean

* Implement recipe parsing changes, add stonecutting recipe type
2019-05-04 16:04:19 -07:00
ice_iix 65ddb3b898 Improve error reporting of invalid UTF-8 when deserializing strings
std::io::Read read_to_string() [1] reports this uninformative error:

thread 'main' panicked at 'Err: IOError(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") })', src/server/mod.rs:442:33

Instead of read_to_string(), use read_to_end() to read into a buffer,
then convert using String::from_utf8() and unwrap it. This gives a
better error message when UTF-8 fails to decode:

thread '' panicked at 'called Result::unwrap() on an Err value: FromUtf8Error { bytes: [105, 110, 101, 99, 114, 97, 102, 116, 58, 99, 114, 97, 102, 116, 105, 110, 103, 95, 115, 104, 97, 112, 101, 100, 20, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 98, 111, 110, 101, 95, 98, 108, 111, 99, 107, 3, 3, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 249, 2, 1, 0, 25, 109], error: Utf8Error { valid_up_to: 50, error_len: Some(1) } }', src/libcore/result.rs:1009:5

which is helpful for tracking down protocol errors, such as updating to
a new protocol (developed for GH-132 / GH-72).

[1] https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string
[2] https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8
2019-04-30 19:20:32 -07:00
ice_iix c1692e950a Improve error reporting of invalid UTF-8 when deserializing strings
std::io::Read read_to_string() [1] reports this uninformative error:

thread 'main' panicked at 'Err: IOError(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") })', src/server/mod.rs:442:33

Instead of read_to_string(), use read_to_end() to read into a buffer,
then convert using String::from_utf8() and unwrap it. This gives a
better error message when UTF-8 fails to decode:

thread '' panicked at 'called Result::unwrap() on an Err value: FromUtf8Error { bytes: [105, 110, 101, 99, 114, 97, 102, 116, 58, 99, 114, 97, 102, 116, 105, 110, 103, 95, 115, 104, 97, 112, 101, 100, 20, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 98, 111, 110, 101, 95, 98, 108, 111, 99, 107, 3, 3, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 249, 2, 1, 0, 25, 109], error: Utf8Error { valid_up_to: 50, error_len: Some(1) } }', src/libcore/result.rs:1009:5

which is helpful for tracking down protocol errors, such as updating to
a new protocol (developed for GH-132 / GH-72).

[1] https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string
[2] https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8
2019-04-30 19:20:32 -07:00
ice_iix 0d02759d46 Update image, reqwest dependencies. Closes GH-130, closes GH-131 2019-04-30 19:18:27 -07:00
ice_iix 1e848d957b Update cfg-if, cfb8, flate2, serde, zip
Closes #116 Bump cfg-if from 0.1.6 to 0.1.7
Closes #120 Bump cfb8 from 0.3.1 to 0.3.2
Closes #122 Bump flate2 from 1.0.6 to 1.0.7
Closes #124 Bump serde from 1.0.89 to 1.0.90
Closes #127 Bump zip from 0.5.0 to 0.5.2
2019-04-13 08:16:42 -07:00
ice_iix e44511b62f Add entity_summon and other missing CommandData nodes. Fix #119
Match to 4428409d41/protocol/src/main/java/net/md_5/bungee/protocol/packet/Commands.java (L514)
Not all were documented on https://wiki.vg/Command_Data
2019-03-17 15:26:21 -07:00
ice_iix acc086bf27 Add entity_summon and other missing CommandData nodes. Fix #119
Match to 4428409d41/protocol/src/main/java/net/md_5/bungee/protocol/packet/Commands.java (L514)
Not all were documented on https://wiki.vg/Command_Data
2019-03-17 15:26:21 -07:00
ice_iix 0d5c1478a5 Update for glutin wasm_stub branch tracking Rust 2018 changes
c0b36056bd
https://github.com/iceiix/glutin/pull/1
2019-03-03 11:50:52 -08:00
iceiix 096c4c6fc6 Add support for compiling WebAssembly wasm32-unknown-unknown target (#92)
Note this only is the first step in web support, although the project compiles, it doesn't run!

Merging now to avoid branch divergence, until dependencies can be updated for wasm support.

* Add instructions to build for wasm32-unknown-unknown with wasm-pack in www/

* Update to rust-clipboard fork to compile with emscripten

https://github.com/aweinstock314/rust-clipboard/pull/62

* Exclude reqwest dependency in wasm32

* Exclude compiling clipboard pasting on wasm32

* Exclude reqwest-using code from wasm32

* Install wasm target with rustup in Travis CI

* Update to collision 0.19.0

Fixes wasm incompatibility in deprecated rustc-serialize crate: https://github.com/rustgd/collision-rs/issues/106

error[E0046]: not all trait items implemented, missing: `encode`
    --> github.com-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1358:1

* Increase travis_wait time even further, try 120 minutes

* Set RUST_BACKTRACE=1 in main

* Remove unused unneeded bzip2 features in zip crate

To fix wasm32-unknown-unknown target compile error:
error[E0432]: unresolved imports `libc::c_int`, `libc::c_uint`, `libc::c_void`, `libc::c_char`
 --> src/github.com-1ecc6299db9ec823/bzip2-sys-0.1.7/lib.rs:5:12
  |
5 | use libc::{c_int, c_uint, c_void, c_char};
  |            ^^^^^  ^^^^^^  ^^^^^^  ^^^^^^ no `c_char` in the root
  |            |      |       |
  |            |      |       no `c_void` in the root
  |            |      no `c_uint` in the root
  |            no `c_int` in the root

* flate2 use Rust backend

* Add console_error_panic_hook module for wasm backtraces

* Build using wasm-pack, wasm-bindgen, run with wasm-app

* Update to miniz_oxide 0.2.1, remove patch for https://github.com/Frommi/miniz_oxide/issues/42

* Update to official clipboard crate since https://github.com/aweinstock314/rust-clipboard/pull/62 was merged, but git revision pending release

* Update to branch of glutin attempting to build for wasm

https://github.com/iceiix/glutin/pull/1

* Update winit dependency of glutin to git master

https://github.com/iceiix/winit/pull/2

* Update to glutin branch with working (compiles, doesn't run) wasm_stub

* Add app name in title on web page

* Add wasm to Travis-CI test matrix

* Update glutin to fix Windows EGL compilation on AppVeyor

97797352b5
2019-03-03 08:32:36 -08:00
iceiix 2f2f35848a
Add support for compiling WebAssembly wasm32-unknown-unknown target (#92)
Note this only is the first step in web support, although the project compiles, it doesn't run!

Merging now to avoid branch divergence, until dependencies can be updated for wasm support.

* Add instructions to build for wasm32-unknown-unknown with wasm-pack in www/

* Update to rust-clipboard fork to compile with emscripten

https://github.com/aweinstock314/rust-clipboard/pull/62

* Exclude reqwest dependency in wasm32

* Exclude compiling clipboard pasting on wasm32

* Exclude reqwest-using code from wasm32

* Install wasm target with rustup in Travis CI

* Update to collision 0.19.0

Fixes wasm incompatibility in deprecated rustc-serialize crate: https://github.com/rustgd/collision-rs/issues/106

error[E0046]: not all trait items implemented, missing: `encode`
    --> github.com-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1358:1

* Increase travis_wait time even further, try 120 minutes

* Set RUST_BACKTRACE=1 in main

* Remove unused unneeded bzip2 features in zip crate

To fix wasm32-unknown-unknown target compile error:
error[E0432]: unresolved imports `libc::c_int`, `libc::c_uint`, `libc::c_void`, `libc::c_char`
 --> src/github.com-1ecc6299db9ec823/bzip2-sys-0.1.7/lib.rs:5:12
  |
5 | use libc::{c_int, c_uint, c_void, c_char};
  |            ^^^^^  ^^^^^^  ^^^^^^  ^^^^^^ no `c_char` in the root
  |            |      |       |
  |            |      |       no `c_void` in the root
  |            |      no `c_uint` in the root
  |            no `c_int` in the root

* flate2 use Rust backend

* Add console_error_panic_hook module for wasm backtraces

* Build using wasm-pack, wasm-bindgen, run with wasm-app

* Update to miniz_oxide 0.2.1, remove patch for https://github.com/Frommi/miniz_oxide/issues/42

* Update to official clipboard crate since https://github.com/aweinstock314/rust-clipboard/pull/62 was merged, but git revision pending release

* Update to branch of glutin attempting to build for wasm

https://github.com/iceiix/glutin/pull/1

* Update winit dependency of glutin to git master

https://github.com/iceiix/winit/pull/2

* Update to glutin branch with working (compiles, doesn't run) wasm_stub

* Add app name in title on web page

* Add wasm to Travis-CI test matrix

* Update glutin to fix Windows EGL compilation on AppVeyor

97797352b5
2019-03-03 08:32:36 -08:00
ice_iix 13fbbaa80a Add recommended Cargo.toml description/repository/license fields
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
2019-03-03 07:13:10 -08:00
ice_iix a6231a0a2a Remove Travis-CI testing on beta, only nightly and stable so testing finishes faster 2019-03-02 16:20:57 -08:00
ice_iix d4e3f9f3da Update serde and serde_json versions
Closes #112 Bump serde_json from 1.0.38 to 1.0.39
Closes #113 Bump serde from 1.0.88 to 1.0.89
2019-03-02 15:20:03 -08:00
ice_iix 86b1c940ee Update to glutin unreleased post-0.19.0 git revision, current master 2019-03-02 15:17:45 -08:00
ice_iix 0e2f9b743d Add community IRC channel. Closes #109 2019-03-02 07:04:12 -08:00
dependabot[bot] 40b2424cf0 Bump lazy_static from 1.2.0 to 1.3.0 (#111)
Bumps [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/rust-lang-nursery/lazy-static.rs/releases)
- [Commits](https://github.com/rust-lang-nursery/lazy-static.rs/compare/1.2.0...1.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-28 18:27:00 -08:00
ice_iix ab88f3ca99 Update serde, serde_json, and reqwest; minor version bumps
Closes #105 Bump serde_json from 1.0.37 to 1.0.38
Closes #107 Bump serde from 1.0.85 to 1.0.88
Closes #108 Bump reqwest from 0.9.9 to 0.9.10
2019-02-23 15:48:39 -08:00
Bart Ribbers 04d9fed5c5 Replace trim_left_matches() (deprecated) for trim_start_matches() (#110) 2019-02-23 09:02:04 -08:00
Bart Ribbers 3e176fa7c2 Replace trim_left_matches() (deprecated) for trim_start_matches() (#110) 2019-02-23 09:02:04 -08: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
ice_iix 7624b89292 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
ice_iix 1aaf8292ba Add double-jump to toggle creative flight. Closes #46 2019-01-26 13:00:19 -08:00
ice_iix 66dd64871d Update Cargo.lock with 'cargo update' 2019-01-26 07:50:54 -08:00
ice_iix a5ba71ee38 Minor updates to serde, serde_json, reqwest, base64 dependencies
Closes #100 Bump serde from 1.0.84 to 1.0.85
Closes #101 Bump serde_json from 1.0.36 to 1.0.37
Closes #102 Bump reqwest from 0.9.8 to 0.9.9
Closes #103 Bump base64 from 0.10.0 to 0.10.1
2019-01-26 07:38:36 -08:00
ice_iix 3b211064bd Update flate2 to use Rust backend, zip remove unneeded features
Found as part of #92 WebAssembly support, but this optimization applies
to native platforms, as well. https://github.com/iceiix/stevenarella/pull/92#issuecomment-455923439
2019-01-26 07:31:21 -08:00
dependabot[bot] 18217c2849 Bump collision from 0.18.0 to 0.19.0 (#95)
Required for #92 WebAssembly support, since it fixes the deprecated rustc-serialize dependency:

https://github.com/iceiix/stevenarella/pull/92#issuecomment-453775934

* Bump collision from 0.18.0 to 0.19.0

Bumps [collision](https://github.com/rustgd/collision-rs) from 0.18.0 to 0.19.0.
- [Release notes](https://github.com/rustgd/collision-rs/releases)
- [Changelog](https://github.com/rustgd/collision-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustgd/collision-rs/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* blocks/Cargo.toml: Bump collision to 0.19.0
2019-01-19 07:47:46 -08:00
dependabot[bot] 5040ebd2c7 Bump serde_json from 1.0.34 to 1.0.36 (#96)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.34 to 1.0.36.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.34...v1.0.36)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-18 17:00:03 -08:00
ice_iix adff9129aa Update Travis CI status badge to master branch 2019-01-13 09:11:30 -08:00
iceiix 90eb2b2693
Fix AppVeyor CI configuration to build from master branch (#91) 2019-01-12 11:22:47 -08:00
ice_iix 1e5f9c2b4a Update reqwest and image dependencies. Closes #85, closes #86 2019-01-12 11:04:40 -08:00
ice_iix 67841f9b2e Fix missing pre-flattening blocks (deadbush, etc.). Closes #89
Blocks not present after "the flattening" (1.13.2) were not registered
for older versions (hierarchical, pre-1.13). This wasn't noticed when
implementing #67 since almost all blocks pre-flattening also have
flattened IDs. The exceptions are when the blocks were removed or moved,
such as dead bush - hierarchical id 32, which is now a block state of
tallgrass instead. But it is still needed pre-flattening, due a logic
error these were skipped.

Fix pre-flattening block ID registration by moving the conditional
clause for vanilla_id outside of the offset conditional.
2019-01-12 10:40:57 -08:00
ice_iix ddd0897fee Update Cargo.lock 2019-01-12 08:36:11 -08:00
ice_iix c80372a1f1 Rename project to Stevenarella (#83)
This fork has significantly diverged from the original, it is time
to make it official, as a new distinct project. Forked from
https://github.com/thinkofname/steven into https://github.com/iceiix/steven,
now moved to https://github.com/iceiix/stevenarella and renamed accordingly.

* Update readme

* Update logo

* Update binary name

* Update window title

* Update splash text
2019-01-11 20:41:19 -08:00
iceiix 19057ed2a0 Add 19w02a (452) multiprotocol support (#82)
Adds support for the 19w02a (451) protocol, yesterday's snapshot.
Builds on https://github.com/iceiix/steven/pull/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
2019-01-10 17:47:07 -08:00
iceiix 916473d8a7
Add 19w02a (452) multiprotocol support (#82)
Adds support for the 19w02a (451) protocol, yesterday's snapshot.
Builds on https://github.com/iceiix/steven/pull/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
2019-01-10 17:47:07 -08:00
iceiix 264bf6084e Add 18w50a (451) multiprotocol support (#79)
Adds 18w50a (451) multiprotocol support, last snapshot of 2018
Reference: https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14491

* Use v18w50a module for protocol

* Add blasting, smoking, and suspicious stew recipe types

* Add entity tags to tags packet

* Add chunk data packet variant with height map

* Add update light packet

* Add chunk format parsing with block_count, without skylights, conditionalize on protocol_version >= 451

* Add villager data entity metadata type parsing

https://wiki.vg/Pre-release_protocol#Entity_Metadata

* Add open book and entity sound effect packets
2019-01-10 17:21:19 -08:00
iceiix 3075de291b Add 18w50a (451) multiprotocol support (#79)
Adds 18w50a (451) multiprotocol support, last snapshot of 2018
Reference: https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14491

* Use v18w50a module for protocol

* Add blasting, smoking, and suspicious stew recipe types

* Add entity tags to tags packet

* Add chunk data packet variant with height map

* Add update light packet

* Add chunk format parsing with block_count, without skylights, conditionalize on protocol_version >= 451

* Add villager data entity metadata type parsing

https://wiki.vg/Pre-release_protocol#Entity_Metadata

* Add open book and entity sound effect packets
2019-01-10 17:21:19 -08:00
iceiix 9adf589436
Add 18w50a (451) multiprotocol support (#79)
Adds 18w50a (451) multiprotocol support, last snapshot of 2018
Reference: https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14491

* Use v18w50a module for protocol

* Add blasting, smoking, and suspicious stew recipe types

* Add entity tags to tags packet

* Add chunk data packet variant with height map

* Add update light packet

* Add chunk format parsing with block_count, without skylights, conditionalize on protocol_version >= 451

* Add villager data entity metadata type parsing

https://wiki.vg/Pre-release_protocol#Entity_Metadata

* Add open book and entity sound effect packets
2019-01-10 17:21:19 -08:00
iceiix 98cc88df5c
Workaround resource manager RwLock deadlock (#78). Closes https://github.com/iceiix/steven/issues/75
game.resource_manager, an Arc<RwLock<resources::Manager>>, sometimes hangs on write(), apparently a deadlock. Switch to using try_write() and continue the main game loop iteration if it fails, using the previous resource version and allow main loop tick if can't obtain a write lock. No warning is logged since this error is recoverable and seemingly intermittent. May not be the best fix, but unblocking iterative development.
2019-01-06 19:56:34 -08:00