valence/crates/valence_nbt/src
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
..
compound.rs Reorganize Packages (#180) 2022-12-29 16:51:05 -08:00
error.rs Reorganize Packages (#180) 2022-12-29 16:51:05 -08:00
from_binary_slice.rs Implement clientbound packets (#190) 2023-01-19 22:00:35 -08:00
lib.rs Add a simple SNBT parser (#201) 2023-02-03 03:16:27 -08:00
modified_utf8.rs Reorganize Packages (#180) 2022-12-29 16:51:05 -08:00
snbt.rs Refactor valence_protocol (#253) 2023-02-23 22:16:22 -08:00
tag.rs Reorganize Packages (#180) 2022-12-29 16:51:05 -08:00
tests.rs Support NBT lists of type TAG_End (#181) 2022-12-29 18:10:29 -08:00
to_binary_writer.rs Support NBT lists of type TAG_End (#181) 2022-12-29 18:10:29 -08:00
value.rs Add block entities (#32) 2023-02-18 10:16:01 -08:00