Commit graph

192 commits

Author SHA1 Message Date
dani162 77ad1dfdd1
Listen on any network interfaces #77 (#79) 2022-09-21 15:11:45 -07:00
Ryan b13fe32f76 Only set center chunk when crossing chunk borders, not sections 2022-09-19 21:03:39 -07:00
Tim Satke d9b7008827
Add methods to Config to use a custom session server (#72)
* Add methods to Config to use a custom session server

Added new methods to the Config trait, that enables
implementors to use a custom session server host
or even a fully custom URL.

* Fix error in documentation

* Make format_session_server_url return a String
2022-09-19 20:23:39 -07:00
Ryan d25f3674fb Acknowledge only the latest dug block sequence 2022-09-19 19:19:20 -07:00
Carson McManus 4574e18d49
inventory client events (#66)
* finish packet definition for ClickContainer

* add CloseScreen client event

* add DropItem client event

* add SetSlotCreative client event

* implement ClientEvent::CloseScreen

* ClientEvent::DropItem

* implement ClientEvent::SetSlotCreative

* cargo fmt

* add inventory_piano example to demo inventory slot click events

* lints

* implement ClickContainer event

* inventory_piano: deduplicate note playing logic

* add DropItemStack client event

* implement ClientEvent::DropItemStack

* adjust logging

* tweak inventory_piano example, send text to chat instead of stdout

* fix lint

* move Slot outside of protocol module

* avoid cloning slot in ClickContainer packet handler

* fix inventory_piano example
2022-09-19 11:29:41 -07:00
Ryan 2f2bc91535 Fix error in docs 2022-09-18 18:38:12 -07:00
Ryan d459df8b2c Fix formatting 2022-09-17 23:37:11 -07:00
Ryan cab1337716 Add Giant to entity_raycast example 2022-09-17 23:30:54 -07:00
Ryan 5bdac7fbb0 Remove unnecessary prefix from Poses 2022-09-17 23:25:07 -07:00
Ryan Johnson 9ec1df1978
Entity Hitbox Improvements (#70)
Solves #45. With help from @guac420
2022-09-17 23:14:48 -07:00
Ryan dcd4a2b5ed Update resource pack link and add SHA-1 hash 2022-09-17 19:40:26 -07:00
James P e6f01e5e4d
Custom resource packs (#68)
Implements custom resource pack support.

Adds a `Client` method to set resource pack, and a `ClientEvent` for listening to resource pack status updates from clients.
2022-09-17 19:32:40 -07:00
Ryan 02b4b49c10 Remove packets.json notice 2022-09-16 22:48:22 -07:00
EmperialDev 419d317736
Migrating the packets to wiki.vg (#62)
Addresses #56. Migrating all the packet names to wiki.vg's instead of fabric's.
2022-09-16 21:29:48 -07:00
Ryan Johnson 0a75f103aa
Packet filtering (#67)
* Add `PacketName`

* Fix inefficiency in codec.rs

* Add regex argument to packet_inspector

* Reorder imports

* Make the regex arg optional

* Update README
2022-09-16 05:31:37 -07:00
Ryan Johnson 7cd3b6cd2d
Add inventory packets (#57)
Adds the inventory packets so we can use them with `packet_inspector`.
2022-09-14 14:18:04 -07:00
Carson McManus f165b55c7b
add building example (#49)
This adds a new example to demonstrate how to implement block breaking/placing.
2022-09-13 18:30:45 -07:00
Ryan 7878793629 Explain event validation 2022-09-12 21:53:07 -07:00
Ryan 51cb3bd277 Fix formatting 2022-09-12 20:32:11 -07:00
Ryan dc64f06cac Clarify chunk space/world space 2022-09-12 20:20:58 -07:00
Nolan Rosen adc927d319
Cleaner fix to #10 (#52) 2022-09-12 17:14:37 -07:00
Ryan 65dc561868 Document and rename default_client_event to handle_event_default. 2022-09-11 21:59:05 -07:00
Ryan c15a9361f2 Make note about packet names matching packets.json. 2022-09-10 17:01:42 -07:00
Ryan Johnson ca4f47c768
Implement the player sample (#47)
Verify that it works by hovering your mouse over the player count in the
cow_sphere example.
2022-09-10 16:02:12 -07:00
Ryan Johnson fdedf74d29
Add clippy lints and format checks (#46)
The nightly rust toolchain is used because we are currently using unstable rustfmt settings.
2022-09-09 21:59:10 -07:00
Ryan 4920defe3e Fix clippy issue 2022-09-09 17:56:16 -07:00
Sekky61 a80052097a
Added SetExperience and SetHealth packets (#34)
* Added `SetExperience` and `SetHealth` packets

Packets were tested

* Rename packets in accordance with `packets.json`
Renamed `SetExperience` to
`ExperienceBarUpdate` and `SetHealth` to `HealthUpdate`

* `set_level` and `set_health_and_food` functions
2022-09-09 17:54:09 -07:00
Nolan Rosen 7b3e317c06
Bugfix: Conflicting UUIDs (#38)
* Adding basic test for entities container

* Entities test written

* Fixes: #11

* Update src/entity.rs

Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>

* Removing unused imports

Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
2022-09-09 17:45:38 -07:00
guac420 96f5614941
Add support for Slot data decoding (#25)
* Impl Seek for reader in Decode Trait

* Add support for Slot data type

* Update tests and rust fmt

* Add tests for Slot

Also fixed bugs I found while testing

* Update slot signature

* Resolved requested changes

Updated decode trait signature and removed unnecessary getters/setters in `Slot`
2022-09-08 21:39:08 -07:00
Ryan Johnson 20546e2fb8
Split Chunk into loaded and unloaded types (#37)
These changes will pave the way for nonblocking terrain generation in `terrain.rs`.
2022-09-08 19:33:24 -07:00
Ryan c955ab8799 Resolve remaining clippy warnings 2022-09-07 11:36:12 -07:00
Carson McManus 2b3794da7e
Update definition for ChatMessage and CommandExecution (#30)
* Update ChatMessage definition, prevent typing in chat from kicking players

fixes #24

* Update definition for CommandExecution
2022-09-07 11:21:20 -07:00
Ryan 6215373b18 Re-export the BlockFace type 2022-09-05 22:53:09 -07:00
Ryan 74a09df978 Hide protocol module from docs 2022-09-05 18:37:55 -07:00
Tristan F 10a8de3bbd
Add action bar support (#15)
* Action bar + conway

* Docs for action bar

* Apply suggestions

* fmt
2022-09-05 17:23:32 -07:00
Mrln 42dfcef57d
Add ClientEvent::InteractWithBlock (#26)
* Add ClientEvent::InteractWithBlock

* Add an example of ClientEvent::InteractWithBlock to the conway example
2022-09-05 17:01:39 -07:00
TheEternalShine b9b0728fd3
Add named text color parsing (#23) 2022-09-05 16:24:33 -07:00
Tristan F df3e5b12bb
Add custom sound effect packet and sound example to conway (#12)
* Add custom sound effect packet, sound example

* Small logic cleanup

* More sound packets

* fmt

* Apply suggestions
2022-09-05 15:37:59 -07:00
Ryan cac348a4b6 Update logo links 2022-09-04 22:25:08 -07:00
Ryan 30e05bb373 cargo fmt 2022-09-04 22:21:24 -07:00
Tristan F d7e229e0a9 Make default client event 2022-09-04 15:42:08 -04:00
Ryan ebbea74017 Prepare for public release 2022-09-03 16:48:11 -07:00
Ryan dafc9a375a Fix clippy issues 2022-09-02 00:37:02 -07:00
Ryan f7a35f356e Update rust docs 2022-09-02 00:06:45 -07:00
Ryan 27033c758e Update packet_inspector 2022-09-01 00:57:02 -07:00
Ryan 5fb46178dd Don't hide the protocol module behind a feature 2022-08-31 19:20:49 -07:00
Ryan 79399c153e Update to 1.19.2 2022-08-30 18:41:17 -07:00
Ryan c8cc7a021c Add valence_nbt to valence 2022-08-29 19:28:19 -07:00
Ryan 2a266fb091 Change rustfmt settings 2022-08-28 21:31:07 -07:00
Ryan 793a795732 Check protocol version during login 2022-08-14 15:18:22 -07:00
Ryan 7fac522a8e Tweak packet macros 2022-08-14 14:58:32 -07:00
Ryan 55cb595740 Improve chunks API 2022-08-10 20:09:10 -07:00
Ryan e27144bc01 Direct bits per idx for biomes depends on the size of the biome registry 2022-08-10 19:15:53 -07:00
Ryan b2310db7b7 Fix chunks loading multiple times
The default chunk view distance has also been lowered to 2 since that is the most conservative guess.
2022-08-10 10:27:25 -07:00
Ryan d4d169d130 Use chunk state instead of HashSet 2022-08-09 17:24:21 -07:00
Ryan 3649a8ca99 Make superflat option per client rather than per world 2022-08-09 15:09:51 -07:00
Ryan a5a560220c New player list implementation 2022-08-09 14:44:04 -07:00
Ryan 1838c290a0 Extract slotmap logic into separate modules 2022-08-08 18:42:39 -07:00
Ryan 9c67978e06 Add collision shapes to block states 2022-08-06 16:46:07 -07:00
Ryan c1857e1603 Implement basic incoming packet buffering
There is still room for improvement because of one unnecessary layer of copying.
2022-08-06 03:53:39 -07:00
Ryan fb9220bf58 Implement outgoing packet buffering 2022-08-05 23:10:25 -07:00
Ryan 49d63a39c0 Clean up client and fix names 2022-08-05 12:36:34 -07:00
Ryan 6b5e795f81 Rename entity data 2022-08-02 19:02:05 -07:00
Ryan e21fd70160 Restructure packet module 2022-07-29 05:34:29 -07:00
Ryan 959e2b2deb Rename packets
Use yarn packet names (with some exceptions) for better consistency. We should also avoid using Mojang names for things in the future.
2022-07-29 04:49:08 -07:00
Ryan 35c697ff93 Rename *Data to *State 2022-07-27 19:21:11 -07:00
Ryan 2e22946ffc Rewrite the entity generator 2022-07-27 07:10:35 -07:00
Ryan 044a735729 Fix stack overflow during BVH construction
The epsilon for float equality was too small which prevented the
function from terminating. Additionally, it has been rewritten in terms
of a loop because tail-call optimization was not happening.
2022-07-17 22:07:51 -07:00
Ryan b604dafe73 Add combat example 2022-07-17 21:29:44 -07:00
Ryan 865ab76699 Add custom data 2022-07-15 20:40:39 -07:00
Ryan 0ef05bb0d0 Add client velocity 2022-07-15 04:21:32 -07:00
Ryan 4b83801066 Clean up docs and fix clippy issues 2022-07-14 23:18:20 -07:00
Ryan 4a12def900 Redesign the spatial index API and add raycast example 2022-07-14 03:40:26 -07:00
Ryan a36b5163f7 Implement attack and movement speed 2022-07-12 20:47:53 -07:00
Ryan 3f150b4c8a Document most items 2022-07-11 05:08:02 -07:00
Ryan 54e0d5cb90 impl Display for BlockState 2022-07-06 18:46:03 -07:00
Ryan 24cf864ed1 Don't export items arbitrarily at the crate root 2022-07-06 18:27:59 -07:00
Ryan 70476973b6 Ignore "unexpected EOF" errors 2022-07-06 02:11:15 -07:00
Ryan 7bdcc28b65 Expose the send_packet fn when 'protocol' feature is active 2022-07-06 01:55:00 -07:00
Ryan a06ba7e645 Add hardcore 2022-07-06 01:12:05 -07:00
Ryan 5fcde5f7ae Implement title and subtitle 2022-07-06 00:16:07 -07:00
Ryan bfba7a1d11 Swing correct hand 2022-07-05 19:28:29 -07:00
Ryan 3ac711ca74 Use idiomatic names
The Rust stdlib uses "Kind" instead of "Type".
2022-07-05 19:21:52 -07:00
Ryan fcda380f2a Improve entity event API 2022-07-05 18:08:40 -07:00
Ryan 0f8b906265 Make the packet inspector error resistant 2022-07-04 18:22:29 -07:00
Ryan c4590a45fc Fix entity create/delete bugs 2022-07-04 16:30:37 -07:00
Ryan 6c0eef1ae7 Add more client events 2022-07-04 15:51:28 -07:00
Ryan 4aca4e24a7 Don't load entities with the same UUID as the client 2022-07-04 00:48:21 -07:00
Ryan 0d07b3659f Store entity events in the entity struct 2022-07-04 00:24:55 -07:00
Ryan e8451da55e Add entity status codes 2022-07-03 23:17:51 -07:00
Ryan fb09ab7f8c Spawn player entities in the conway example 2022-07-03 20:31:20 -07:00
Ryan a6bb67ecfe Fix client respawning 2022-07-03 18:45:11 -07:00
Ryan 04ce5366c8 Add a null state to some IDs 2022-07-03 18:02:00 -07:00
Ryan 622f15e71d Implement client world switching 2022-07-03 17:32:05 -07:00
Ryan 79cb4c159a Store entities and clients per server rather than per world 2022-07-03 15:31:24 -07:00
Ryan 985ecf3922 Don't send untranslated error messages to clients 2022-07-02 16:23:58 -07:00
Ryan 0c6ecc9c12 Tweak biomes 2022-07-02 13:41:45 -07:00
Ryan c468fc3eea Use a VecDeque for events 2022-07-02 11:22:28 -07:00
Ryan 232b76a8f7 Improve BlockPos API 2022-07-02 10:27:54 -07:00
Ryan c14bf88bd1 Fix warnings 2022-07-02 00:15:16 -07:00