valence/crates/valence_inventory
Ryan Johnson c5557e744d
Move packets out of valence_core. (#335)
## Description

- Move all packets out of `valence_core` and into the places where
they're actually used. This has a few benefits:
- Avoids compiling code for packets that go unused when feature flags
are disabled.
- Code is distributed more uniformly across crates, improving
compilation times.
- Improves local reasoning when everything relevant to a module is
defined in the same place.
  - Easier to share code between the packet consumer and the packet.
- Tweak `Packet` macro syntax.
- Update `syn` to 2.0.
- Reorganize some code in `valence_client` (needs further work).
- Impl `WritePacket` for `Instance`.
- Remove packet enums such as `S2cPlayPacket` and `C2sPlayPacket`.
- Replace `assert_packet_count` and `assert_packet_order` macros with
non-macro methods.
To prevent this PR from getting out of hand, I've disabled the packet
inspector and stresser until they have been rewritten to account for
these changes.
2023-05-29 01:36:11 -07:00
..
src Move packets out of valence_core. (#335) 2023-05-29 01:36:11 -07:00
Cargo.toml Reorganize Project (#321) 2023-04-21 14:43:59 -07:00
README.md Reorganize Project (#321) 2023-04-21 14:43:59 -07:00

valence_inventory

The inventory system.

This module contains the systems and components needed to handle inventories. By default, clients will have a player inventory attached to them.

Components

  • [Inventory]: The inventory component. This is the thing that holds items.
  • [OpenInventory]: The component that is attached to clients when they have an inventory open.

Examples

An example system that will let you access all player's inventories:

# use bevy_ecs::prelude::*;
# use valence_inventory::*;
# use valence_client::Client;
fn system(clients: Query<(&Client, &Inventory)>) {}

See also

Examples related to inventories in the valence/examples/ directory:

  • building
  • chest