Skip to main content

yog_event/client/
local.rs

1//! What this client's player is and sees: the host's actions (nothing on
2//! a dedicated server, nor without a player).
3
4use yog_core::{BlockArea, BlockPos, LocalState, NearbyEntity, PlacedBlock, SlotStack};
5use yog_ids as ids;
6
7actions! {
8    /// Where the player is and how it fares.
9    State {  } -> Option<LocalState> = ids::service_client_local::STATE, "YogClientOps.state";
10    /// The player's stacks, by slot: 0–8 the hotbar, 9–35 the rest, 36–39 armor (feet first), 40 the off hand.
11    Inventory {  } -> Vec<SlotStack> = ids::service_client_local::INVENTORY, "YogClientOps.inventory";
12    /// The loaded blocks among `ids` (`minecraft:diamond_ore`, `#minecraft:logs` for a tag) between `min` and `max`.
13    Scan { min: BlockPos, max: BlockPos, ids: Vec<String> } -> Vec<PlacedBlock> = ids::service_client_local::SCAN, "YogClientOps.scan";
14    /// The blocks between `min` and `max`, for finding a way; `None` for a box too big.
15    Area { min: BlockPos, max: BlockPos } -> Option<BlockArea> = ids::service_client_local::AREA, "YogClientOps.area";
16    /// The entities within `radius` blocks of the player (not the player).
17    Entities { radius: f64 } -> Vec<NearbyEntity> = ids::service_client_local::ENTITIES, "YogClientOps.entities";
18}