Commit Graph

679 Commits

Author SHA1 Message Date
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 55ff26409a Update to Rust stable 1.44.1, closes #258 2020-06-21 11:35:20 -07:00
Mèir Noordermeer b26500e1b2
Fix crash when window gets minimized (#332). Fixes #275
* Make sure aspect ratio is always valid

* Do not render while window has an invalid size (e.g. window is minimized)
2020-06-21 12:24:41 +02:00
ice_iix 0dd21a0a20 Update readme with contributions guidelines, open open source 2020-06-20 16:47:25 -07:00
ice_iix 41f8be6b90 Update to image 0.23.6, closes #333 2020-06-20 15:04:59 -07:00
Martin Kröning 54763da22d Get scale_factor from window instead of monitor
Fixes #316
2020-06-20 14:27:00 -07:00
iceiix a6bff21de8
Update to glutin 0.22.0 and winit 0.20.0 release (#268)
Thanks to @mwkroening (#317) and @martijnberger (#323) for helping fix this update.

* Update to glutin 0.22.0 and winit 0.20.0 release, removing alpha pinning

* scale_factor() replaces hidpi_factor()

* Listen for ScaleFactorChanged, separate from Resized event

* Fix getting physical size of window

* Fix logical mouse event coordinates
2020-06-20 13:55:45 -07:00
ice_iix a42d9a6761 Update dependencies with cargo update 2020-06-20 12:04:23 -07:00
ice_iix 852624f68a www: npm audit fix, closes #300, closes #324 2020-06-20 11:58:36 -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
Kezi 3e96d2e03b
Add --username option to set offline username (#290) 2020-06-20 10:41:08 -07:00
Mèir Noordermeer 50befb5a0f
Do not redraw until main events are cleared (#315). Fixes #282
Fixes unresponsiveness to input
2020-06-20 10:26:47 -07:00
ice_iix a06928e6da www: npm audit fix to update deps, fixing GHSA-h9rv-jmmf-4pgx
https://github.com/advisories/GHSA-h9rv-jmmf-4pgx
https://github.com/iceiix/stevenarella/network/alert/www/package-lock.json/serialize-javascript/open
2020-02-02 09:08:46 -08:00
ice_iix 472208cc8c www: update README to remove wasm-pack; use cargo web start
wasm-pack is more broken, see https://github.com/iceiix/stevenarella/issues/171#issuecomment-581151711
cargo web start is still broken (#171) but less so
2020-02-02 09:07:51 -08:00
ice_iix dece047cd7 Remove clipboard crate git dependency, back to 0.5.0
The git dependency was only for wasm32-unknown-emscripten support:
https://github.com/aweinstock314/rust-clipboard/pull/62
but #92 changes to using wasm32-unknown-unknown instead, a better
supported path (though still incomplete in this project, see #171)
2020-02-02 08:29:20 -08: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
iceiix fb7f47c70b
Add protocol implementation in subdirectory for #167 (#277)
Adds the protocol submodule, and required dependencies, in a new subdirectory
protocol/ for a separate crate in #167. This merge preserves the commit history
(without requiring --follow to view) using filter-branch as follows:

git checkout master
git checkout -b protocol_subtree
git filter-branch -f --prune-empty --subdirectory-filter src/protocol @
git filter-branch -f --prune-empty --tree-filter 'mkdir -p protocol/src/protocol; mv * protocol/src/protocol 1>/dev/null 2>/dev/null; true' @

git checkout master
git checkout -b protocol_deps_subtree
git filter-branch --index-filter 'git rm --cached -qr --ignore-unmatch -- . && git reset -q $GIT_COMMIT -- src/format.rs src/item.rs src/macros.rs src/nbt src/types' --prune-empty --
git filter-branch -f --prune-empty --tree-filter 'mkdir -p protocol/src; mv * protocol 1>/dev/null 2>/dev/null; true' @

git checkout protocol_subtree
git merge --allow-unrelated-histories protocol_deps_subtree

git checkout master
git checkout -b protocol_crate2
git merge --allow-unrelated-histories protocol_subtree
2020-02-02 07:36:23 -08:00
ice_iix baefa0a8de Add protocol in protocol/ subdirectory for #167 2020-02-02 05:52:26 -08:00
ice_iix 3baba519c8 Add protocol dependencies for #167 2020-02-02 05:50:17 -08:00
iceiix 87e0726f3f
blocks: split macro into multiple functions, fast! (#267)
Improves fix for #184, whereas #255 reduced optimizations,
we now address the underlying compiler limitation and split out
the one massive lazy_static! initialization function, into
one function per block in the block_registration_functions module.

Previous build time, with opt-level=1:

% time cargo build --release
   Compiling steven_blocks v0.0.1
    Finished release [optimized] target(s) in 21.24s
cargo build --release  31.80s user 0.71s system 152% cpu 21.276 total

With this change, opt-level=3 and the function splitting fix:

% time cargo build --release
   Compiling steven_blocks v0.0.1
    Finished release [optimized] target(s) in 30.80s
cargo build --release  40.26s user 0.86s system 133% cpu 30.850 total

Full optimizations are expectedly slightly slower, but this is still
much much _much_ faster than before this refactoring, where this crate
would take up to an unbelievable 5 hours (and tens of GB of RAM). Long
story short, we're now back to full optimizations and stable Rust.

Thanks to dtolnay on the Rust programming language forum for suggesting
this technique, https://users.rust-lang.org/t/5-hours-to-compile-macro-what-can-i-do/36508/2
2020-01-09 20:08:28 -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
ice_iix 643de31073 protocol: atomics replace unsafe for version/debug. Closes #261 2020-01-08 18:57:57 -08:00
ice_iix 90f7d9afd9 Update sha-1 and zip dependencies
Closes #263 Bump sha-1 from 0.8.1 to 0.8.2
Closes #265 Bump zip from 0.5.3 to 0.5.4
2020-01-07 19:31:10 -08:00
ice_iix 15499ee95e steven_gl: update gl_generator, khronos_api, libc 2020-01-05 18:45:00 -08:00
iceiix a020ed6f2c
Update to glutin 0.22.0-alpha5, remove wasm_stub (#260)
Update from glutin 0.21.x fork to glutin 0.22.0-alpha5 and corresponding
compatible version of winit. This removes our custom temporary wasm_stub
branches, back to mainline glutin and winit, and is a step towards WebAssembly
compatibility, most importantly merging the game loop and event loops as
required by winit _which now supports wasm_. Not yet functional on the web
because other web dependencies have to be added, see #171 and #34, but native
functionality is preserved.

* Update for 0.22 glutin API changes:

* Move game logic into event loop, run() replacing poll_events()

* Specify fullscreen Borderless mode

* Pass generic parameter of Event through handle_window_event
* hidpi_factor() replaces get_hidpi_factor()
* with_inner_size() replaces with_dimensions()
* No longer need to unwrap() LogicalSize
* set_cursor_grab/visible() replaces grab/hide_cursor()

* Fix modifiers deprecated warnings by destructuring only event fields we use, ignoring the rest with '..'

* Remove unnecessary mutability from events_loop

* Listen for ModifiersChanged event, fixing deprecated modifiers field

* Change to stdweb for web backend, replacing web-sys

* Pin to glutin =0.22.0-alpha5 and winit =0.20.0-alpha6
2020-01-05 17:56:32 -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
iceiix 8ab981f3ad
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 b307843d2b Change to PCG random number generator algorithm
See http://www.pcg-random.org/ for benefits of PCG over xorshift
Updates #236 #183
2020-01-05 10:01:44 -08:00
ice_iix 6c32fce5a3 Update rand to 0.7.2 and rand_xorshift 0.2.0. Closes #236, closes #183 2020-01-05 09:49:03 -08:00
ice_iix cfbcf71b40 Bump image from 0.21.3 to 0.22.3. Closes #238 2020-01-05 09:10:59 -08:00
ice_iix 3f5f02db93 Update dependencies: base64, flate2, num-traits, and more (#257)
* Closes #237 Bump base64 from 0.10.1 to 0.11.0

* Closes #241 Bump flate2 from 1.0.12 to 1.0.13

* Closes #245 Bump num-traits from 0.2.8 to 0.2.10

* Closes #248 Bump serde_json from 1.0.41 to 1.0.44

* Closes #249 Bump serde from 1.0.102 to 1.0.104

* Closes #251 Bump web-sys from 0.3.30 to 0.3.33

* Closes #254 Bump structopt from 0.3.3 to 0.3.7

* Bump cfg-if from 0.1.9 to 0.1.10

* `cargo update` all modules
2020-01-05 08:00:55 -08:00
ice_iix e04ee876f3 Nightly rust, steven_blocks: reduce optimizations in release. Fixes #184 (#255)
Reduce to "basic optimizations" for the steven_blocks module, so it
doesn't take hours of time and gigabytes of memory to compile. The main
program and other code still builds with full optimizations in release
mode, to accomplish this, the profile-overrides feature is required so
we also switch to nightly Rust (to be switched to 1.41+ in #258).

* Update to rustc 1.42.0-nightly (760ce94c6 2020-01-04)

* Update builds.sr.ht to use +nightly

* Override opt-level=1 for steven_blocks using profile-overrides
2020-01-05 07:16:10 -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 e435daf959 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 20bcddfb13 Replace into_iter() -> iter() for arrays, fixes 1.42-nightly warning
warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
   --> src/entity/player.rs:363:11
    |
363 |         ].into_iter().enumerate() {
    |           ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
2020-01-04 19:33:05 -08:00
ice_iix 8502c031f8 Update to Rust 1.40.0. Closes #253
* Update mem::uninitialized to MaybeUninit

* Update to Rust version 1.40 in AppVeyor

* Update readme for Rust version requirement
2020-01-04 17:26:26 -08:00
ice_iix afa100313c Correct minimum Rust version requirement in readme, updates #235 2020-01-04 17:20:28 -08:00
ice_iix 248c276f3d steven_blocks: update lazy_static to 1.4.0 2020-01-04 12:21:03 -08:00
ice_iix b7a8fbf8f6 steven_blocks: cargo update. Closes #256 2020-01-04 12:19:54 -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 2daca512b0 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 3da354def4 Update to Rust 1.38.0 in AppVeyor. Closes #235 2019-11-02 15:46:16 -07:00
ice_iix 49f2582a50 Fix warning: `...` range patterns are deprecated 2019-11-02 15:46:10 -07:00
ice_iix c88631b124 Fix bare trait objects warning, add explicit `dyn` 2019-11-02 15:46:06 -07:00
ice_iix 3946f22863 Update serde, image, hex, lazy_static, structopt..
* serde 1.1.0.2, closes #233
* image 0.21.3, closes #221
* hex 0.4.0, closes #225
* lazy_static 1.4.0, closes #217
* structopt 0.3.3, closes #231
  * Requires rustc 1.36+, updated in previous commit
* reqwest 0.9.22, closes #230
* cargo update, closes #219
2019-11-02 14:24:50 -07:00
ice_iix 1b668242d0 Update to Rust 1.36.0 on AppVeyor 2019-11-02 14:18:01 -07:00
ice_iix 7c49ca3c0d Add missing time, nbt{_compound,}_tag command nodes. Fixes #227 2019-11-02 13:43:00 -07:00
ice_iix 6723c75ab4 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 d24b6cb599
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
ice_iix 80006d9212 Update web-sys, zip, flate2 dependencies
Closes #209 Bump web-sys from 0.3.25 to 0.3.26
Closes #210 Bump zip from 0.5.2 to 0.5.3
Closes #211 Bump flate2 from 1.0.9 to 1.0.11
2019-08-17 13:34:32 -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 d1f88c9797
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 45099165d9
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
ice_iix 862c40c59d Update dependencies: web-sys, reqwest, log, serde
Closes #196 Bump web-sys from 0.3.24 to 0.3.25
Closes #200 Bump reqwest from 0.9.18 to 0.9.19
Closes #202 Bump log from 0.4.6 to 0.4.8
Closes #203 Bump serde from 1.0.94 to 1.0.98
2019-08-11 16:18:57 -07:00
ice_iix 9066b19031 Allow Cmd modifier as alternative to Ctrl, closes #206 2019-08-11 16:15:36 -07:00
dependabot[bot] 095ae1f6ab Bump lodash from 4.17.11 to 4.17.15 in /www (#201)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.15)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-27 17:50:33 -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
iceiix 95a9920cb6
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 2a3be38407 npm update www dependencies. Closes #182 2019-07-04 15:25:02 -07:00
ice_iix 8c0350eb7c Update web-sys, flate2, structopt, serde/json, and minor deps
Closes #187 Bump web-sys from 0.3.22 to 0.3.24
Closes #188 Bump flate2 from 1.0.7 to 1.0.9
Closes #189 Bump structopt from 0.2.16 to 0.2.18
Closes #190 Bump serde from 1.0.92 to 1.0.94
Closes #192 Bump serde_json from 1.0.39 to 1.0.40

`cargo update` updates smallvec (and others) used by collision:
Closes #193 [Security] Bump smallvec from 0.6.9 to 0.6.10
2019-07-02 19:08:50 -07:00
ice_iix 115560ce82 Update byteorder, serde, image, reqwest
Closes #181, closes #178, closes #179, closes #180
2019-06-10 17:09:19 -07:00
ice_iix eecd5631db Add builds.sr.ht build status badge to readme
Updates #176, replacing Travis-CI due to #173
2019-05-31 09:30:04 -07:00
dependabot-preview[bot] f52913ee86 Bump structopt from 0.2.15 to 0.2.16 (#172)
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.2.15 to 0.2.16.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.2.15...v0.2.16)
2019-05-31 09:24:49 -07:00
iceiix 6d0da658ed
Add .build.yml file for builds.sr.ht SourceHut CI (#176) 2019-05-31 09:23:13 -07:00
ice_iix d729039849 steven_blocks: Use the ? operator instead of * in macro
Previously, only the * and + operators were available, for 0 or more and
1 or more, respectively, so steven_blocks used * for optional tokens
even though only one would be expected in most cases.

Rust version 1.32.0 added a new operator, ?, for zero or one:

https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1320-2019-01-17
> You can now use the ? operator in macro definitions. The ? operator allows
> you to specify zero or one repetitions similar to the * and + operators.
https://github.com/rust-lang/rust/pull/56245/

Change to use ? instead of * for these optional repetitions.
Found this while investigating #174.
2019-05-30 18:31:23 -07:00
ice_iix 74d37d7150 Fix redundant imports on rustc 0.35.0. Fixes #175 2019-05-30 18:13:54 -07:00
ice_iix 19948ff397 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 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