use serde::Deserialize;
use serde_json::Value;
use yog_ids::client_op as op;
use super::op::ask;
#[derive(Deserialize, Debug, Clone, PartialEq)]
pub struct State {
pub x: f64,
pub y: f64,
pub z: f64,
pub yaw: f32,
pub pitch: f32,
pub vx: f64,
pub vy: f64,
pub vz: f64,
pub on_ground: bool,
pub in_water: bool,
pub eye_height: f64,
pub health: f32,
pub food: i32,
pub dimension: String,
pub slot: i32,
pub attack_strength: f32,
}
pub fn state() -> Option<State> {
ask(op::STATE, Value::Null)
}
#[derive(Deserialize, Debug, Clone, PartialEq)]
pub struct Stack {
pub slot: i32,
pub item: String,
pub count: i32,
}
pub fn inventory() -> Vec<Stack> {
ask(op::INVENTORY, Value::Null).unwrap_or_default()
}