Commit graph

6 commits

Author SHA1 Message Date
Ryan Johnson 0960ad7ead
Refactor valence_protocol (#253)
## Description

- Remove duplicate packet definitions by using `Cow`.
- Rename packets to match yarn mappings.
- Remove some top-level re-exports.
- Move every packet into its own module for consistency.
- Move packet-specific types from the `types` module into the
appropriate packet module.
- Remove internal use of `EncodePacket`/`DecodePacket` derives and move
packet identification to `packet_group`. This can be done because there
are no duplicate packets anymore.
- Simplify some events.

In a future PR I plan to clean things up further by properly bounding
packet data (to prevent DoS exploits) and fixing any remaining
inconsistencies with the game's packet definitions.

## Test Plan

Behavior of `valence_protocol` should be the same.

Steps:
1. Use the packet inspector against the vanilla server to ensure packet
behavior has not changed.
2. Run the examples.
3. Run `valence_stresser`.
2023-02-23 22:16:22 -08:00
Mrln 1ceafe0ce0
Add block entities (#32)
This PR aims to add block entities.
Fixes #5

---------

Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
2023-02-18 10:16:01 -08:00
CaveNightingale ca269cd03e
Add a simple SNBT parser (#201)
To implement the hoverEvent show_item, we need an SNBT parser and a SNBT
serializer.
An SNBT parser is implemented in this commit.
2023-02-03 03:16:27 -08:00
Guac ad89e4457c
Implement clientbound packets (#190)
Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
2023-01-19 22:00:35 -08:00
Ryan Johnson c9aeda7dbd
Support NBT lists of type TAG_End (#181)
In NBT, lists are allowed to have the element type TAG_End iff their
length is zero. This adds an explicit `List::End` enum variant to
valence_nbt.
2022-12-29 18:10:29 -08:00
Ryan Johnson 2597e92b8f
Reorganize Packages (#180)
Moves all the packages to the `crates/` directory.
2022-12-29 16:51:05 -08:00