From f66d2d476759085601fc398afcac7d8b1940ebf7 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Thu, 13 Jun 2024 19:52:05 -0500 Subject: 1.21 (#145) * 24w18a (data driven enchantments not implemented yet) * 1.21 --- azalea-inventory/src/components.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'azalea-inventory/src') diff --git a/azalea-inventory/src/components.rs b/azalea-inventory/src/components.rs index 948bb96d..9c9b90ad 100644 --- a/azalea-inventory/src/components.rs +++ b/azalea-inventory/src/components.rs @@ -49,6 +49,8 @@ pub fn from_kind( kind: azalea_registry::DataComponentKind, buf: &mut Cursor<&[u8]>, ) -> Result, BufReadError> { + // if this is causing a compile-time error, look at DataComponents.java in the + // decompiled vanilla code to see how to implement new components Ok(match kind { DataComponentKind::CustomData => Box::new(CustomData::read_from(buf)?), DataComponentKind::MaxStackSize => Box::new(MaxStackSize::read_from(buf)?), @@ -114,6 +116,7 @@ pub fn from_kind( DataComponentKind::Bees => Box::new(Bees::read_from(buf)?), DataComponentKind::Lock => Box::new(Lock::read_from(buf)?), DataComponentKind::ContainerLoot => Box::new(ContainerLoot::read_from(buf)?), + DataComponentKind::JukeboxPlayable => todo!(), }) } @@ -654,3 +657,10 @@ pub struct ContainerLoot { pub loot: NbtCompound, } impl DataComponent for ContainerLoot {} + +#[derive(Clone, PartialEq, McBuf)] +pub struct JukeboxPlayable { + pub song: azalea_registry::JukeboxSong, + pub show_in_tooltip: bool, +} +impl DataComponent for JukeboxPlayable {} -- cgit v1.2.3