Skip to main content

yog_event/planes/view/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::{
5    BlockArea, BlockHit, BlockPos, DigSpeed, LocalState, NearbyEntity, PlacedBlock, Point,
6    SlotStack,
7};
8use yog_ids as ids;
9
10actions! {
11    /// Where the player is and how it fares.
12    State {  } -> Option<LocalState> = ids::service_client_local::STATE, "client.YogClientOps.state";
13    /// The player's stacks, by slot: 0–8 the hotbar, 9–35 the rest, 36–39 armor (feet first), 40 the off hand.
14    Inventory {  } -> Vec<SlotStack> = ids::service_client_local::INVENTORY, "client.YogClientOps.inventory";
15    /// The loaded blocks among `ids` (`minecraft:diamond_ore`, `#minecraft:logs` for a tag) between `min` and `max`.
16    Scan { min: BlockPos, max: BlockPos, ids: Vec<String> } -> Vec<PlacedBlock> = ids::service_client_local::SCAN, "client.YogClientOps.scan";
17    /// The blocks between `min` and `max`, for finding a way; `None` for a box too big.
18    Area { min: BlockPos, max: BlockPos } -> Option<BlockArea> = ids::service_client_local::AREA, "client.YogClientOps.area";
19    /// The entities within `radius` blocks of the player (not the player).
20    Entities { radius: f64 } -> Vec<NearbyEntity> = ids::service_client_local::ENTITIES, "client.YogClientOps.entities";
21    /// How fast each of `blocks` (ids) is dug with the best tool in the hotbar, in order.
22    DigSpeeds { blocks: Vec<String> } -> Vec<DigSpeed> = ids::service_client_local::DIG_SPEEDS, "server.YogDigSpeeds.of";
23    /// The first block outline a ray from `from` to `to` hits in the client's world (fluids aside).
24    Raycast { from: Point, to: Point } -> Option<BlockHit> = ids::service_client_local::RAYCAST, "client.YogClientOps.raycast";
25    /// The block the crosshair is on, if it's on one.
26    Target {  } -> Option<BlockHit> = ids::service_client_local::TARGET, "client.YogClientOps.target";
27    /// Shows `text` in this player's own chat (no one else sees it).
28    Message { text: String } -> bool = ids::service_client_local::MESSAGE, "client.YogClientChat.message";
29}