make slot component fields public

This commit is contained in:
MeexReay 2025-05-11 02:02:50 +03:00
parent abb12eb756
commit 1eed718f38
2 changed files with 25 additions and 25 deletions

View File

@ -60,7 +60,7 @@ pub enum IDSet {
#[derive(Clone)] #[derive(Clone)]
pub struct Property { pub struct Property {
name: String, pub name: String,
value: String, pub value: String,
signature: Option<String>, pub signature: Option<String>,
} }

View File

@ -42,16 +42,16 @@ pub struct PaintingVariant;
#[derive(Clone)] #[derive(Clone)]
pub struct HiveBee { pub struct HiveBee {
entity_data: DynNBT, pub entity_data: DynNBT,
ticks_in_hive: i32, pub ticks_in_hive: i32,
min_ticks_in_hive: i32, pub min_ticks_in_hive: i32,
} }
#[derive(Clone)] #[derive(Clone)]
pub struct BannerLayer { pub struct BannerLayer {
pattern_type: i32, pub pattern_type: i32,
asset_id: Option<String>, pub asset_id: Option<String>,
translation_key: Option<String>, pub translation_key: Option<String>,
/// Can be one of the following: /// Can be one of the following:
/// - 0 - White /// - 0 - White
/// - 1 - Orange /// - 1 - Orange
@ -69,19 +69,19 @@ pub struct BannerLayer {
/// - 13 - Green /// - 13 - Green
/// - 14 - Red /// - 14 - Red
/// - 15 - Black /// - 15 - Black
color: u8, pub color: u8,
} }
#[derive(Clone)] #[derive(Clone)]
pub struct AttributeModifier { pub struct AttributeModifier {
attribute_id: u64, pub attribute_id: u64,
modifier_id: String, pub modifier_id: String,
value: f64, pub value: f64,
/// The operation to be applied upon the value. Can be one of the following: /// The operation to be applied upon the value. Can be one of the following:
/// - 0 - Add /// - 0 - Add
/// - 1 - Multiply base /// - 1 - Multiply base
/// - 2 - Multiply total /// - 2 - Multiply total
operation: u8, pub operation: u8,
/// The item slot placement required for the modifier to have effect. /// The item slot placement required for the modifier to have effect.
/// Can be one of the following: /// Can be one of the following:
/// - 0 - Any /// - 0 - Any
@ -94,24 +94,24 @@ pub struct AttributeModifier {
/// - 7 - Head /// - 7 - Head
/// - 8 - Armor /// - 8 - Armor
/// - 9 - Body /// - 9 - Body
slot: u8, pub slot: u8,
} }
#[derive(Clone)] #[derive(Clone)]
pub struct ToolRule { pub struct ToolRule {
blocks: IDSet, pub blocks: IDSet,
has_speed: bool, pub has_speed: bool,
speed: Option<f32>, pub speed: Option<f32>,
has_correct_drop_for_blocks: bool, pub has_correct_drop_for_blocks: bool,
correct_drop_for_blocks: Option<bool>, pub correct_drop_for_blocks: Option<bool>,
} }
#[derive(Clone)] #[derive(Clone)]
pub struct DamageReduction { pub struct DamageReduction {
horizontal_blocking_angle: f32, pub horizontal_blocking_angle: f32,
damage_kind: Option<IDSet>, pub damage_kind: Option<IDSet>,
base: f32, pub base: f32,
factor: f32, pub factor: f32,
} }
/// https://minecraft.wiki/w/Java_Edition_protocol/Slot_data#Structured_components /// https://minecraft.wiki/w/Java_Edition_protocol/Slot_data#Structured_components
@ -445,7 +445,7 @@ pub trait ReadWriteSlotComponent: DataReader + DataWriter {
impl ReadWriteSlotComponent for Packet { impl ReadWriteSlotComponent for Packet {
fn read_slot_component(&mut self) -> Result<SlotComponent, ServerError> { fn read_slot_component(&mut self) -> Result<SlotComponent, ServerError> {
let id = self.read_u16_varint()?; let _ = self.read_u16_varint()?; // id
todo!() todo!()
} }