1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

fix incorrect data components

This commit is contained in:
mat 2025-04-13 02:38:29 +06:00
parent 1be8d8638f
commit 3112dc3ea0

View file

@ -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 {