diff options
| author | mat <git@matdoes.dev> | 2025-04-13 02:38:29 +0600 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-04-13 02:38:29 +0600 |
| commit | 3112dc3ea0fd128a35717e4fed1aed839be7e633 (patch) | |
| tree | 1f175fbb37918ed79368fc1b8d07aa46030d2bb8 /azalea-inventory/src | |
| parent | 1be8d8638f37cbd8f3d9f0dd0c8bb9d25c1690b2 (diff) | |
| download | azalea-drasl-3112dc3ea0fd128a35717e4fed1aed839be7e633.tar.xz | |
fix incorrect data components
Diffstat (limited to 'azalea-inventory/src')
| -rw-r--r-- | azalea-inventory/src/components.rs | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/azalea-inventory/src/components.rs b/azalea-inventory/src/components.rs index baeb3457..89847ead 100644 --- a/azalea-inventory/src/components.rs +++ b/azalea-inventory/src/components.rs @@ -607,14 +607,23 @@ impl DataComponent for BlockEntityData { const KIND: DataComponentKind = DataComponentKind::BlockEntityData; } -#[derive(Clone, PartialEq, AzBuf)] -pub struct Instrument { - pub instrument: registry::Instrument, +#[derive(Clone, PartialEq, Debug, AzBuf)] +pub enum Instrument { + Registry(registry::Instrument), + Holder(Holder<registry::Instrument, InstrumentData>), } impl DataComponent for Instrument { const KIND: DataComponentKind = DataComponentKind::Instrument; } +#[derive(Clone, PartialEq, Debug, AzBuf)] +pub struct InstrumentData { + pub sound_event: Holder<SoundEvent, azalea_core::sound::CustomSound>, + pub use_duration: f32, + pub range: f32, + pub description: FormattedText, +} + #[derive(Clone, PartialEq, AzBuf)] pub struct OminousBottleAmplifier { #[var] @@ -799,12 +808,21 @@ impl DataComponent for ContainerLoot { } #[derive(Clone, PartialEq, AzBuf)] -pub struct JukeboxPlayable { - pub song: registry::JukeboxSong, +pub enum JukeboxPlayable { + Registry(registry::JukeboxSong), + Direct(Holder<registry::JukeboxSong, JukeboxSongData>), } impl DataComponent for JukeboxPlayable { const KIND: DataComponentKind = DataComponentKind::JukeboxPlayable; } +#[derive(Clone, PartialEq, AzBuf)] +pub struct JukeboxSongData { + pub sound_event: Holder<SoundEvent, CustomSound>, + pub description: FormattedText, + pub length_in_seconds: f32, + #[var] + pub comparator_output: i32, +} #[derive(Clone, PartialEq, AzBuf)] pub struct Consumable { @@ -1085,11 +1103,21 @@ impl DataComponent for HorseVariant { #[derive(Clone, PartialEq, AzBuf)] pub struct PaintingVariant { - pub variant: registry::PaintingVariant, + pub variant: Holder<registry::PaintingVariant, PaintingVariantData>, } impl DataComponent for PaintingVariant { const KIND: DataComponentKind = DataComponentKind::PaintingVariant; } +#[derive(Clone, PartialEq, AzBuf)] +pub struct PaintingVariantData { + #[var] + pub width: i32, + #[var] + pub height: i32, + pub asset_id: ResourceLocation, + pub title: Option<FormattedText>, + pub author: Option<FormattedText>, +} #[derive(Clone, PartialEq, AzBuf)] pub struct LlamaVariant { @@ -1166,6 +1194,8 @@ impl DataComponent for BlocksAttacks { pub struct DamageReduction { pub horizontal_blocking_angle: f32, pub kind: Option<HolderSet<DamageKind, ResourceLocation>>, + pub base: f32, + pub factor: f32, } #[derive(Clone, PartialEq, AzBuf)] pub struct ItemDamageFunction { |
