Commit Graph

239 Commits

Author SHA1 Message Date
iceiix ecf829c544
Update dependencies: reqwest, serde, serde_json (#755)
* Bump reqwest to 0.11.13. Closes #751

* Bump serde to 1.0.152. Closes #752

* Bump serde_json to 1.0.91. Closes #753
2022-12-31 17:45:27 -08:00
iceiix 3043b0ab02
Update dependencies: image, flate2
* Bump flate2 to 1.0.25. Closes #748

* Bump image to 0.24.5. Closes #749
2022-12-31 17:23:10 -08:00
iceiix 6ad43b3ccb
Merge pull request #731 from nathanruiz/digging
Add the ability to break blocks
2022-10-30 16:10:45 -07:00
Nathan Ruiz 18b2641d66 Send correct dig packet for each version 2022-10-24 16:04:30 +00:00
iceiix 620ff3a167
Update dependencies from dependabot (#742)
* Bump web-sys to 0.3.60. Closes #725
* Bump wasm-bindgen 0.2.83. Closes #726
* Bump reqwest 0.11.12. Closes #728
* Bump image 0.24.4. Closes #730, closes #733
* Bump winit 0.27.4. Closes #736
* Bump zip 0.6.3. Closes #737
* Bump serde_json 1.0.87. Closes #739
* Bump getrandom 0.2.8. Closes #740
* Bump serde 1.0.147. Closes #741
* Bump num-traits 0.2.15. Closes #734
* Update Cargo.lock
2022-10-23 16:57:28 -07:00
iceiix 069a3915bd
1.18.2 protocol (758) (#706)
Minor protocol update

https://minecraft.fandom.com/wiki/Java_Edition_1.18.2
https://wiki.vg/index.php?title=Protocol&oldid=17499 1.18.2 (758)
https://wiki.vg/index.php?title=Protocol&diff=17499&oldid=17341 1.18.1 (757) vs 1.18.2 (758)

* Add EntityRemoveEffect_VarInt, split i8 variant
* Add UpdateScore_VarInt, split u8 variant
* Add EntityEffect_VarInt, split i8 variant
2022-08-06 17:35:55 -07:00
iceiix adb71c7caa
Update dependencies: image, serde, serde_json (#707)
* Bump image to 0.24.3. Closes #702

* Bump serde to 1.0.142. Closes #704

* Bump serde_json to 1.0.83. Closes #705
2022-08-06 17:33:27 -07:00
iceiix 1f183ed76e
1.18.1 protocol (757) (#640)
https://wiki.vg/index.php?title=Protocol&oldid=17203 1.18.1
https://wiki.vg/index.php?title=Protocol&type=revision&diff=17203&oldid=16918 1.18.1 vs 1.17.1

* protocol: add UpdateSimulationDistance packet and update IDs
* protocol: add JoinGame_WorldNames_IsHard_SimDist packet variant
* protocol: add UpdateBlockEntity_VarInt packet variant
* protocol: start adding ChunkData_AndLight, combining ChunkData + UpdateLight
* protocol: ChunkData_AndLight: add struct BlockEntityAtPackedLocation

* server: handle JoinGame_WorldNames_IsHard_SimDist packet variant
* server: handle combined chunk data and light packet
* server: on_chunk_data_and_light: set all bits in now-removed bitmask

* bit map: add derived std::fmt::Debug implementation
* bit map: allow creating, but not accessing, zero-length bit maps

* world: sanity check chunk bit_size, failing earlier
* world: read biome data bits after palette
* world: support single-valued palettes
* world: handle single-valued biomes
* world: add checks for direct palettes; update comments
* world: parse dimension tags
* world: load dimension type tags: min_y
* world: skip chunk sections underneath y<0
* world: force filling sky on 1.18+ for now, workaround until mask/fill_sky can be calculated correctly wrt min_y

* readme: add 1.18.1 (757)
2022-08-06 16:32:40 -07:00
iceiix ba3cf43f93
Update dependencies: glutin 0.29, winit 0.27, and more (#700)
* Update to glutin 0.29.0, winit 0.27.0. Closes #695
Change true/false to CursorGrabMode::Locked/None for set_cursor_grab
https://github.com/rust-windowing/winit/releases/tag/v0.27.0
> Breaking: Window::set_cursor_grab now accepts CursorGrabMode to control grabbing behavior.

* Update web-sys to 0.3.59. Closes #699

* Update flate2 to 1.0.24. Closes #698

* Update zip to 0.6.2. Closes #697

* Update to log 0.4.17. Closes #696
2022-07-30 15:54:49 -07:00
iceiix e00e249793
Update dependencies (#694)
* Update rand to 0.8.5. Closes #665

* Update web-sys to 0.3.55. Closes #637

* Update glow to 0.11.2. Closes #641

* Update to structopt 0.3.26. Closes #652

* Update to crossbeam-deque 0.8.2. Closes #680

* Update crossbeam-utils to 0.8.11. Closes #681

* Updaet tokio to 1.16.1. Closes #682

* protocol: Update tokio to 1.19.2. Closes #683, closes #684

* Update reqwest to 0.11.11. Closes #685

* Update getrandom to 0.2.7. Closes #686

* Update wams-bindgen to 0.2.81. Closes #687

* Update serde_json to 1.0.82. Closes #689

* Update serde to 1.0.140. Closes #693
2022-07-30 14:49:30 -07:00
Ben Reeves 9a8d3572eb Derive Clone, PartialEq, Eq, and Hash where appropriate.
This is really useful for anyone who wishes to use the steven_protocol
crate and write tests that compare packets to expected values.
2022-02-05 15:42:38 -08:00
ice_iix 00e7a3d1bc 1.13.2+: correct particle IDs, fixes Failed to read all of packet 0x24
Updates https://github.com/iceiix/stevenarella/issues/377#issuecomment-1003598682
2022-01-02 08:10:50 -08:00
iceiix 21a1b64a14
Merge pull request #639 from iceiix/rust2021
Update to Rust 1.57.0 and 2021 edition
2021-12-24 10:53:27 -08:00
ice_iix a90a6af7c2 Update to Rust 2021 2021-12-24 09:32:56 -08:00
ice_iix 669e37ac5c Suppress dead_code warnings for unused fields new in Rust 1.57 2021-12-24 09:17:58 -08:00
iceiix c8cb29e1fa
Update dependencies: flate2, dirs, structopt, instant, serde... (#636)
* Bump flate2 to 1.0.22. Closes #614

* Bump wasm-bindgen to 0.2.78. Closes #616

* Bump dirs to 4.0.0. Closes #617

* Bump console_error_panic_hook to 0.1.7. Closes #622

* Bump structopt to 0.3.25. Closes #623

* Bump instant to 0.1.12. Closes #624

* Bump serde to 1.0.132. Closes #634

* Bump serde_json to 1.0.73. Closes #633

* Bump reqwest to 0.11.8. Closes #635

* Update Cargo.lock
2021-12-24 09:04:43 -08:00
iceiix cfcc7d2a1f
1.17.1 (756) protocol (#605)
https://wiki.vg/index.php?title=Protocol&oldid=16918

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

* server: handle TeleportPlayer_WithDismount
* server: handle ChunkData_Biomes3D_Bitmasks

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

* metadata: add PoseData::LongJumping 

* protocol: update Cargo.lock for serde_json 1.0.130
* build: pin to wasm-pack 0.10.0
2021-09-05 13:30:32 -07:00
ice_iix 0d5feb9454 build(deps): update serde, wasm-bindgen, web-sys
Bump serde to 1.0.129. Closes #604
Bump wasm-bindgen to 0.2.76. Closes #595
Bump web-sys to 0.3.52. Closes #591
2021-08-29 18:44:00 -07:00
iceiix 755aaf9ede
Update protocol crate dependencies (#590), closes #587
* protocol: bump hex to 0.4.3

* protocol: bump sha-1 to 0.9.7

* protocol: bump num-traits to 0.2.14

* protocol: bump aes to 0.7.4, cfb8 to 0.7.1
2021-08-16 07:22:01 -07:00
ice_iix 107d4f4f4a protocol: bump serde to 1.0.127, updates #586 2021-08-15 18:45:07 -07:00
dependabot[bot] a35b9d241f
build(deps): bump serde_json from 1.0.64 to 1.0.66 (#579)
* build(deps): bump serde_json from 1.0.64 to 1.0.66

Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.64 to 1.0.66.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.64...v1.0.66)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* protocol: update to serde_json 1.0.66

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ice_iix <ice_ix@protonmail.ch>
2021-08-01 06:39:35 -07:00
iceiix fd5290fa4f
Update reqwest, structopt, instant. Closes #561, #574, #574 (#576)
* Update to reqwest 0.11.4. Closes #561
* Update to structopt 0.3.22. Closes #574
* Update to instant 0.1.10. Closes #575
* Update cargo.lock
* protocol: update Cargo.lock
2021-07-18 09:44:37 -07:00
iceiix 0563757cb0
Update dependencies: byteorder, reqwest, zip, dirs, serde (#540)
* Bump byteorder to 1.4.3. Closes #522

* Bump reqwest to 0.11.3. Closes #529

* Bump zip to 0.5.12. Closes #530

* Bump dirs to 3.0.2. Closes #533

* Bump serde to 1.0.126. Closes #539

* Update Cargo lock
2021-05-16 21:13:50 -07:00
Kezi eb452abbb5
protocol/item: update to support protocol_version >= 404 (1.13.2+) (#524) 2021-03-25 08:21:25 -07:00
iceiix abbc58b9ef
deps: update reqwest, wasm-bindgen, serde_json, image (#516)
* Bump reqwest to 0.11.1, closes #504

* Bump wasm-bindgen to 0.2.71, closes #513

* Bump serde_json to 1.0.64, closes #514

* Bump image to 0.23.14, closes #515

* cargo update
2021-03-06 16:47:38 -08:00
Kezi e3845a0dbf
protocol: fix panic in chat formatting, closes #505 (#506)
* remove panic on chat thing

* fmt
2021-03-03 19:28:43 -08:00
iceiix 7dcbac2a5d
Update dependencies: serde, log, rand, flate2, image (#502)
* cargo update all modules

* Bump serde to 1.0.123. Closes #496

* Bump wasm-bindgen to 0.2.70. Closes #497

* Bump log to 0.4.14. Closes #498

* Bump rand to 0.8.3. Closes #499

* Bump flate2 to 1.0.20. Closes #500!

* Bump image to 0.23.13. Closes #501
2021-02-06 13:49:49 -08:00
iceiix 3e3bcdc5da
protocol, console, server: receive chat messages (#479)
Implements support for receiving chat messages from the server, the
first step towards #63 chat support. Long way to go, but is a start.

* server: handle ServerMessage_* packets, on_servermessage

* format: get the with arguments of translations
* format: hardcode chat types
* format: support bare strings, used in chat.type.text
* format: use extra text if present, fixes missing username on 1.16.5

* console/main/server: activate on receiving chat messages
2021-01-24 17:41:16 -08:00
iceiix 6b961622aa
forge: add FML2 protocol support (1.13.2-1.16.5+), fixes #400 (#494)
Allows connecting to newer Forge servers, 1.13.2 to 1.16.5 at least, which use
the FML2 handshake protocol:

https://wiki.vg/Minecraft_Forge_Handshake#FML2_protocol_.281.13_-_Current.29

Tested with a modded 1.16.5 server

Extends #88 #134 Forge FML (v1, for 1.7.10 - 1.12.2)

* protocol: update Cargo.lock
* protocol: send FML2 on fmlNetworkVersion: 2
* protocol: factor out read_raw_packet_from()
* protocol: move plugin message writing from Server to Conn; add write_fml2_handshake_plugin_message
* protocol: CommandNode: add forge:modid, forge:enum
* forge: add fml2 handshake packets
* server: handle fml:loginwrapper fml::handshake packets
2021-01-23 13:47:30 -08:00
ice_iix d60a495425 deps: update getrandom, serde (#491, #490)
Bump getrandom to 0.2.2, closes #491
Bump serde to 1.0.120, closes #490
2021-01-20 15:29:06 -08:00
iceiix c78068e6f9
1.16.5 protocol is the same as 1.16.4 (#480) 2021-01-17 17:13:23 -08:00
ice_iix d14573c3cf protocol: glowstone compatibility: warn not panic on unrecognized modinfo, fixes #478 2021-01-16 19:48:20 -08:00
ice_iix bb4fb9eb8b Update byteorder, log, serde dependencies
Bump byteorder to 1.4.2, closes #470
Bump log to 0.4.13, closes #471
Bump serde to 1.0.119, closes #472
2021-01-12 19:13:21 -08:00
ice_iix ac63ee5ece protocol: add angle command node (fixes #466) 2021-01-10 15:00:34 -08:00
ice_iix 622cf164f9 protocol: update Cargo.lock 2021-01-10 15:00:09 -08:00
iceiix 8bd233c3db
Update reqwest, getrandom, rand (#464)
Update getrandom to 0.2.1. Closes #460
Update rand to 0.8.1. Closes #462
Update reqwest to 0.11.0. Closes #463
2021-01-07 17:29:09 -08:00
iceiix b7bd59f75f
Update to Rust 1.49.0 (#457)
* Update to Rust 1.49.0

* Fix clippy::manual_range_contains warnings
2020-12-31 09:51:46 -08:00
ice_iix 028ab1cbe3 1.16.4-19w02a: fix Maps packet missing locked, closes #454 2020-12-28 14:02:05 -08:00
ice_iix 5a38ea1091 1.16.4-1.14: fix Particle_f64/Data packet fields, closes #377 2020-12-28 11:57:59 -08:00
ice_iix 80887eec91 1.16.2+: fix Respawn dimension field, closes #452 2020-12-27 18:13:51 -08:00
iceiix 503a98d7a8
Use instant over std::time, for wasm compat (#449)
Replace std::time with the `instant` crate, which bridges to std::time on
native but on wasm calls performance.now() instead of panicking.

A step towards 🕸️ Web support #446

* logo: replace SystemTime/UNIX_EPOCH with Instant
2020-12-27 15:06:03 -08:00
iceiix 0471eb3a82 Use web-sys for web backend (#444)
A small step for #446 🕸️ Web support, use web-sys to interface to the web.
Previously, we would try to use glutin on the web, which is not supported;
now glutin is only used on native: fixes #171 could not find Context in platform_impl.

winit is still used on both, but the GL context is created with web-sys and glow
(on the web), and created with glutin and used with glow (on native). stdweb is
no longer used, being replaced by web-sys.

Substantial refactoring to allow reusing the code between web/native:

* settings: use VirtualKeyCode from winit, not reexported from glutin
* std_or_web: remove broken localstoragefs/stdweb, add File placeholder
* render: disable skin_thread on wasm since we don't have threads

* gl: use glow types in gl wrapper (integers in native, but Web*Key in web)
* gl: web-sys WebGlUniformLocation does not implement Copy trait, so glow::UniformLocation doesn't so gl::Uniform can't
* gl: refactor context initialization, pass glow::Context to gl::init for consistency between native/web
* gl: update to glow with panicking tex_image_2d_multisample web-sys wrapper

* glsl: use shader version in GLSL for WebGL 2 and OpenGL 3.2

* shaders: add explicit float/int type conversions, required for WebGL
* shaders: specify mediump precision, required for WebGL
* shaders: specify fragment shader output locations for WebGL

* main: refactor handle_window_event to take a winit window, not glutin context
* main: handle resize outside of handle_window_event since it updates the glutin window (the only event which does this)
* main: use winit events in handle_window_event not reexported glutin events
* main: refactor game loop handling into tick_all()
* main: create winit window for WebGL, and use winit_window from glutin
* main: restore console_error_panic_hook,  mistakingly removed in (#260)
* main: remove force setting env RUST_BACKTRACE=1, no longer can set env on web

* www: index.js: fix wasm import path
* www: npm update, npm audit fix
* www: update readme to link to status on #446 🕸️ Web support
2020-12-26 13:43:21 -08:00
ice_iix 5d0fb7fa64 Update dependencies: reqwest, serde/json, structopt...
Closes #425 build(deps): bump wasm-bindgen from 0.2.68 to 0.2.69
Closes #426 build(deps): bump structopt from 0.3.20 to 0.3.21
Closes #427 build(deps): bump serde_json from 1.0.59 to 1.0.60
Closes #428 build(deps): bump serde from 1.0.117 to 1.0.118
Closes #433 build(deps): bump reqwest from 0.10.9 to 0.10.10
2020-12-19 17:48:13 -08:00
iceiix 433429e8a0
1.16+: implement EntityEquipment_Array top-bit terminated variant (#439)
Fixes #408 1.16.1: EntityEquipment_VarInt : Main thread panic: Failed to read all of packet 0x47, had 363 bytes left - enchants
Fixes #421 1.16.1: EntityEquipment_VarInt : Player heads break things. (Failed to read all of packet 0x47, had 1292 bytes left)
2020-12-19 15:51:27 -08:00
ice_iix 37f55e2c57 Add --network-parse-packet option 2020-12-19 15:32:19 -08:00
ice_iix 47dd9ac112 Update protocol Cargo.lock 2020-12-19 15:32:14 -08:00
ice_iix da137ca9b4 Update deps: cfg-if, serde/_json, structopt...
Bump cfg-if to 1.0.0 (closes #412)
Bump serde to 1.0.117 (closes #416)
Bump serde_json to 1.0.59 (closes #413)
Bump structopt to 0.3.20 (closes #414)
Bump flate2 to 1.0.19 (closes #420)
Bump reqwest to 0.10.9 (closes #423)
2020-11-24 19:02:18 -08:00
iceiix 4a757656ab 1.16.4 (754) / 1.16.3 (753) / 1.16.2 (751) protocol (#390)
Adds support for 1.16.4 (754) / 1.16.3 (753) / 1.16.2 (751) protocols

* Update packet IDs and readme

* Add and handle ChunkData_Biomes3D_VarInt variant

* Support world chunk data padded bit map array

* Add and handle JoinGame_WorldNames_IsHard variant

* Add and handle MultiBlockChange_Packed variant

* Add UnlockRecipes_WithBlastSmoker variant

* Add SetDisplayedRecipe and SetRecipeBookState packets
2020-11-24 19:01:57 -08:00
ice_iix ff90d8af6a Use `matches!` for bool match (clippy match_like_matches_macro) 2020-10-10 16:22:46 -07:00
ice_iix 1234588974 protocol: cargo update 2020-10-10 14:30:36 -07:00
ice_iix d9399015cd Update deps: log, reqwest, serde_json, flate2, structopt...
Closes #372 bump log from 0.4.8 to 0.4.11
Closes #387 bump reqwest from 0.10.6 to 0.10.8
Closes #391 bump wasm-bindgen from 0.2.64 to 0.2.68
Closes #403 bump serde_json from 1.0.56 to 1.0.58
Closes #405 bump flate2 from 1.0.16 to 1.0.18
Closes #409 bump structopt from 0.3.15 to 0.3.19
2020-10-10 12:04:21 -07:00
Terminator 85c1014f86
Don't consume self when writing packet to a writer. Mutability is not affected (#375)
* Minor change: Don't consume self when writing packet to a writer. Mutability is not affected.

* Further decrease packet write requirements

Co-authored-by: Terminator <terminator@nonexistent.com>
2020-10-09 19:36:55 -07:00
ice_iix f5f61e071e Update flate2, serde_json, wasm-bindgen; +gl/protocol
Bump flate2 to 1.0.16, closes #350
Bump serde_json to 1.0.56, closes #349
Bump wasm-bindgen to 0.2.64, closes #348
gl: Bump libc to 0.2.71
protocol: Bump hex to 0.4.2
protocol: Bump aes to 0.4.0
protocol: Bump cfb8 to 0.4.0
protocol: Bump num-traits to 0.2.12
2020-07-05 08:45:34 -07:00
ice_iix 759cef1255 protocol: commit Cargo.lock 2020-07-05 08:25:50 -07:00
ice_iix 4e9cda2929 protocol: add missing minecraft:uuid CommandNode property
Fixes thread '<unnamed>' panicked at 'unsupported command node parser minecraft:uuid', protocol/src/protocol/packet.rs:3098:22
This was added in https://wiki.vg/index.php?title=Command_Data&diff=15659&oldid=14622
2020-07-04 14:48:33 -07:00
ice_iix eb703f0776 protocol: log bad format color codes, fixes #353 2020-07-03 16:33:23 -07:00
ice_iix cb8681a615 protocol: use mutable iterator populating Biomes3D (needless_range_loop) 2020-06-29 17:43:49 -07:00
ice_iix 66a787a535 protocol: change UUID from_str to implement FromStr trait (should_implement_trait) 2020-06-29 17:43:49 -07:00
ice_iix 783e437397 protocol: fix manually copying, use clone_from_slice, thanks clippy! (manual_memcpy) 2020-06-28 18:39:57 -07:00
ice_iix 72f0595111 protocol: fix wildcard_in_or_patterns 2020-06-28 18:36:16 -07:00
ice_iix 2f1c7b3c60 protocol: fix redundant_clone in access token 2020-06-28 18:34:42 -07:00
ice_iix 77394f0536 protocol: use and_then, ok_or_else; option_map_or_none and or_fun_call 2020-06-28 18:33:32 -07:00
ice_iix 07fed441f3 protocol: fix redundant_field_names 2020-06-28 18:28:09 -07:00
ice_iix 853f76b24a protocol: fix redundant_static_lifetimes 2020-06-28 18:27:30 -07:00
ice_iix 9621b235c4 protocol: fix redundant imports, single_component_path_imports 2020-06-28 18:26:52 -07:00
ice_iix 3db08a3fc5 Fix to_string shadowing fmt::Display fmt (found by clippy)
https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string_shadow_display
2020-06-28 14:37:08 -07:00
ice_iix 287fb3feca Update sha-1 dependency to 0.9.1. Closes #342
* Remove unused top-level sha-1 dependency since it was moved to the
protocol crate
2020-06-28 09:15:01 -07:00
ice_iix c167d70aea Update serde and base64 dependencies
Update to serde 1.0.114, closes #340
Update to base64 0.12.3, closes #341
2020-06-28 09:02:38 -07:00
ice_iix 0626888197 1.16.1 protocol support (736) (#345)
* Update shifted packet ids

* Add new smithing recipe type

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

New packets:

* GenerateStructure

New packet variants:

* UseEntity_Sneakflag, split from UseEntity_Hand

* ClientAbilities_u8, split from ClientAbilities_f32

* UpdateJigsawBlock_Joint, split from UpdateJigsawBlock_Type

* ServerMessage_Sender, split from ServerMessage_Position

* ChunkData_Biomes3D_bool, split from ChunkData_Biomes3D

* JoinGame_WorldNames, split from JoinGame_HashedSeed_Respawn

* Respawn_WorldName, split from Respawn_Gamemode

* EntityEquipment_VarInt renamed

* UpdateLight_WithTrust, split from UpdateLight_NoTrust

* LoginSuccess_UUID, split from LoginSuccess_String
2020-06-27 18:39:59 -07:00
ice_iix 0670e76e0c Reformat with cargo fmt, updates #301 #343 2020-06-27 18:09:05 -07:00
iceiix 85b9774f21
1.15.2 (578) protocol support (#338)
v1_15 is now used for both 1.15.1 and 1.15.2.

No protocol changes except ChangeGameState reason code values
2020-06-27 14:44:22 -07:00
Kezi e0d5d205c1
protocol: pub fields in struct Stack (#344) 2020-06-27 14:16:25 -07:00
Kezi dde28b48b7
Misc protocol fixes: position (fixes #301), 1.14+ block place, spawn object (#343)
* some protocol fixes

* remove newline
2020-06-27 14:08:33 -07:00
iceiix 518b6a07f8
Reformat all source with cargo fmt (#335) 2020-06-21 12:17:24 -07:00
iceiix 7279f4177e
1.13.2: add untested Forge protocol handshake support (#145)
Initial support for the new Forge 1.1+3 server list ping JSON mod parsing
2020-06-21 12:01:31 -07:00
ice_iix 9b2147c895 Update structopt, base64, zip, serde_json, reqwest, flate2, byteorder
Update to structopt 0.3.15, closes #330
Update to base64 0.12.2, closes #329
Update to zip 0.5.6, closes #328
Update to serde_json 1.0.55, closes #327
Update to reqwest 0.10.6, closes #321
Update to flate2 1.0.14, closes #303
Update to byteorder 1.3.4, closes #285
2020-06-20 11:49:21 -07:00
ice_iix ed7f06b1a8 Update deps: serde_json, structopt, image, rand, num-traits, reqwest
Closes #276 Bump serde_json from 1.0.44 to 1.0.45
Closes #274 Bump structopt from 0.3.7 to 0.3.8
Closes #273 Bump image from 0.22.3 to 0.22.4
Closes #272 Bump rand from 0.7.2 to 0.7.3
Closes #270 Bump num-traits from 0.2.10 to 0.2.11
Closes #269 Bump reqwest from 0.10.0 to 0.10.1
2020-02-02 08:19:15 -08:00
ice_iix bda0009a6f Add Cargo.toml for new steven_protocol crate. Closes #167 (#278)
Completes the move of the protocol implementation into a new
crate, named steven_protocol, in the protocol/ subdirectory.

* Add Cargo.toml for steven_protocol

* Add steven_protocol entrypoint in protocol/src/lib.rs

* Use steven_protocol in main

* Remove protocol in main, replaced by steven_protocol

* Remove unused dependencies moved into steven_protocol
2020-02-02 07:47:11 -08:00
ice_iix 3baba519c8 Add protocol dependencies for #167 2020-02-02 05:50:17 -08:00
ice_iix b563ca4394 protocol: atomics replace unsafe for version/debug. Closes #261 2020-01-08 18:57:57 -08:00
ice_iix e834ee2f53 protocol: atomics replace unsafe for version/debug. Closes #261 2020-01-08 18:57:57 -08:00
iceiix 9077c22304 Update to reqwest 0.10.0. Closes #259
* Bump reqwest from 0.9.22 to 0.10.0

* Use blocking reqwest API instead of futures, for now
2020-01-05 10:38:21 -08:00
ice_iix a833ef7bf5 Remove deprecated Error description, replaced by Display
The Display trait is already implemented, so this is only a code
deletion. Fixes 1.42-nightly warning:

warning: use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
   --> src/protocol/mod.rs:981:40
    |
981 |             Error::IOError(ref e) => e.description(),
    |                                        ^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default
2020-01-04 19:35:18 -08:00
ice_iix dd2fb32df1 1.15.1 protocol support (575) (#252)
* Add v1_15_1 for protocol 575

* Update for shifted packet IDs

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

* Add SpawnMob packet variant, no metadata

* Add SpawnPlayer packet variant, no metadata

* Add block update actions comments, including beehive

* Add particle packet variant with 64-bit floats

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

* Add chunk data packet variant with 3D biomes

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

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

* Add load_chunk115 to not read chunk data structure biomes

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=15213#Data_structure
2019-12-29 15:55:19 -08:00
ice_iix 7c49ca3c0d Add missing time, nbt{_compound,}_tag command nodes. Fixes #227 2019-11-02 13:43:00 -07:00
iceiix 57da39bb79 Fix SpawnPainting parsing 1.13.2-1.14.4, closes #212 (#213)
The packet changed in 1.13.2 but wasn't updated, so we split the packet
variants into SpawnPainting_String for the old version and
SpawnPainting_VarInt for the new version with a 'motive' VarInt field
instead of a String title.

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

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

* Rename the variant for 1.9-1.12.2 to Teams_u8
2019-08-11 17:46:34 -07:00
iceiix a095e26a22 1.14.4 protocol support (498) (#207)
* Add protocol 498 for 1.14.4

* Add 0x5c AcknowledgePlayerDigging packet, https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14870#Acknowledge_Player_Digging

* Add new demand field in protocol::Trade

https://wiki.vg/index.php?title=Pre-release_protocol&type=revision&diff=14862&oldid=14856
MC-151282 - Villager trade GUI does not show the correct price on servers if trade demand is high
2019-08-11 17:26:20 -07:00
iceiix c0849e4a29 1.14.3 protocol support (490) (#194)
* Copy v1_14_3 from v1_14_2

* Add protocol 490 for v1_14_3

* Add missing 1.14 release TradeList packet fields

TradeList only had fields from the prerelease:
19w02a (452): https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14515#Trade_List

add the six missing fields present in the 1.14 release:
1.14 (477): https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14752#Trade_List

Note this breaks 19w02a TradeList parsing, can be fixed by splitting the
packet for 19w02a/1.14 if needed later.

* Add TradeList_WithRestock variant with new can_restock field
2019-07-07 14:58:49 -07:00
ice_iix 74d37d7150 Fix redundant imports on rustc 0.35.0. Fixes #175 2019-05-30 18:13:54 -07:00
iceiix 75b94356d2 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
ice_iix d7340007a0 Use super:: relative instead of crate::protocol absolute import paths 2019-05-25 14:09:09 -07:00
ice_iix bdf18cc6d4 Replace println! with log crate facade macros info!, debug!, etc. 2019-05-22 16:01:14 -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
ice_iix 3bbab7a128 Refactor recipe parsing minecraft: prefix, related to #155 2019-05-15 12:49:50 -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 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
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 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