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, BlockHit, DigSpeed, Point, 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    /// How fast each of `blocks` (ids) is dug with the best tool in the hotbar, in order.
19    DigSpeeds { blocks: Vec<String> } -> Vec<DigSpeed> = ids::service_client_local::DIG_SPEEDS, "YogDigSpeeds.of";
20    /// The first block outline a ray from `from` to `to` hits in the client's world (fluids aside).
21    Raycast { from: Point, to: Point } -> Option<BlockHit> = ids::service_client_local::RAYCAST, "YogClientOps.raycast";
22    /// The block the crosshair is on, if it's on one.
23    Target {  } -> Option<BlockHit> = ids::service_client_local::TARGET, "YogClientOps.target";
24    /// Shows `text` in this player's own chat (no one else sees it).
25    Message { text: String } -> bool = ids::service_client_local::MESSAGE, "YogClientChat.message";
26}