Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.21.4 #189

Merged
merged 5 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
start updating to 1.21.4
  • Loading branch information
mat-1 committed Nov 26, 2024
commit 8e14951022503c75a0d65c65d133a4a5c2ce6efc
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A collection of Rust crates for making Minecraft bots, clients, and tools.

<!-- The line below is automatically read and updated by the migrate script, so don't change it manually. -->

_Currently supported Minecraft version: `1.21.2`._
_Currently supported Minecraft version: `1.21.4-pre3`._

> [!WARNING]
> Azalea is still very unfinished, though most crates are in a somewhat useable state
Expand Down
2 changes: 1 addition & 1 deletion azalea-block/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ edition = "2021"
license = "MIT"
name = "azalea-block"
repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-block"
version = "0.10.3+mc1.21.1"
version = "0.10.3+mc1.21.4"

[lib]

Expand Down
4 changes: 3 additions & 1 deletion azalea-chat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ azalea-buf = ["dep:azalea-buf", "simdnbt"]
numbers = ["dep:azalea-registry", "dep:simdnbt"]

[dependencies]
azalea-buf = { path = "../azalea-buf", features = ["serde_json"], version = "0.10.0", optional = true }
azalea-buf = { path = "../azalea-buf", features = [
"serde_json",
], version = "0.10.0", optional = true }
azalea-language = { path = "../azalea-language", version = "0.10.0" }
azalea-registry = { path = "../azalea-registry", version = "0.10.0", optional = true }
once_cell = { workspace = true }
Expand Down
4 changes: 3 additions & 1 deletion azalea-entity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ license = "MIT"
[dependencies]
azalea-block = { version = "0.10.0", path = "../azalea-block" }
azalea-buf = { version = "0.10.0", path = "../azalea-buf" }
azalea-chat = { version = "0.10.0", path = "../azalea-chat", features = ["azalea-buf"] }
azalea-chat = { version = "0.10.0", path = "../azalea-chat", features = [
"azalea-buf",
] }
azalea-core = { version = "0.10.0", path = "../azalea-core" }
azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" }
azalea-registry = { version = "0.10.0", path = "../azalea-registry" }
Expand Down
107 changes: 20 additions & 87 deletions azalea-entity/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2564,6 +2564,10 @@ impl Default for CowMetadataBundle {
pub struct CanMove(pub bool);
#[derive(Component, Deref, DerefMut, Clone)]
pub struct IsActive(pub bool);
#[derive(Component, Deref, DerefMut, Clone)]
pub struct IsTearingDown(pub bool);
#[derive(Component, Deref, DerefMut, Clone)]
pub struct CreakingHomePos(pub Option<BlockPos>);
#[derive(Component)]
pub struct Creaking;
impl Creaking {
Expand All @@ -2579,6 +2583,12 @@ impl Creaking {
17 => {
entity.insert(IsActive(d.value.into_boolean()?));
}
18 => {
entity.insert(IsTearingDown(d.value.into_boolean()?));
}
19 => {
entity.insert(CreakingHomePos(d.value.into_optional_block_pos()?));
}
_ => {}
}
Ok(())
Expand All @@ -2591,6 +2601,8 @@ pub struct CreakingMetadataBundle {
parent: AbstractMonsterMetadataBundle,
can_move: CanMove,
is_active: IsActive,
is_tearing_down: IsTearingDown,
creaking_home_pos: CreakingHomePos,
}
impl Default for CreakingMetadataBundle {
fn default() -> Self {
Expand Down Expand Up @@ -2638,79 +2650,8 @@ impl Default for CreakingMetadataBundle {
},
can_move: CanMove(true),
is_active: IsActive(false),
}
}
}

#[derive(Component)]
pub struct CreakingTransient;
impl CreakingTransient {
pub fn apply_metadata(
entity: &mut bevy_ecs::system::EntityCommands,
d: EntityDataItem,
) -> Result<(), UpdateMetadataError> {
match d.index {
0..=17 => Creaking::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
}
}

#[derive(Bundle)]
pub struct CreakingTransientMetadataBundle {
_marker: CreakingTransient,
parent: CreakingMetadataBundle,
}
impl Default for CreakingTransientMetadataBundle {
fn default() -> Self {
Self {
_marker: CreakingTransient,
parent: CreakingMetadataBundle {
_marker: Creaking,
parent: AbstractMonsterMetadataBundle {
_marker: AbstractMonster,
parent: AbstractCreatureMetadataBundle {
_marker: AbstractCreature,
parent: AbstractInsentientMetadataBundle {
_marker: AbstractInsentient,
parent: AbstractLivingMetadataBundle {
_marker: AbstractLiving,
parent: AbstractEntityMetadataBundle {
_marker: AbstractEntity,
on_fire: OnFire(false),
shift_key_down: ShiftKeyDown(false),
sprinting: Sprinting(false),
swimming: Swimming(false),
currently_glowing: CurrentlyGlowing(false),
invisible: Invisible(false),
fall_flying: FallFlying(false),
air_supply: AirSupply(Default::default()),
custom_name: CustomName(Default::default()),
custom_name_visible: CustomNameVisible(Default::default()),
silent: Silent(Default::default()),
no_gravity: NoGravity(Default::default()),
pose: Pose::default(),
ticks_frozen: TicksFrozen(Default::default()),
},
auto_spin_attack: AutoSpinAttack(false),
abstract_living_using_item: AbstractLivingUsingItem(false),
health: Health(1.0),
effect_particles: EffectParticles(Default::default()),
effect_ambience: EffectAmbience(false),
arrow_count: ArrowCount(0),
stinger_count: StingerCount(0),
sleeping_pos: SleepingPos(None),
},
no_ai: NoAi(false),
left_handed: LeftHanded(false),
aggressive: Aggressive(false),
},
},
},
can_move: CanMove(true),
is_active: IsActive(false),
},
is_tearing_down: IsTearingDown(false),
creaking_home_pos: CreakingHomePos(None),
}
}
}
Expand Down Expand Up @@ -8398,7 +8339,7 @@ impl Default for RavagerMetadataBundle {
#[derive(Component, Deref, DerefMut, Clone)]
pub struct SalmonFromBucket(pub bool);
#[derive(Component, Deref, DerefMut, Clone)]
pub struct SalmonKind(pub String);
pub struct SalmonKind(pub i32);
#[derive(Component)]
pub struct Salmon;
impl Salmon {
Expand All @@ -8412,7 +8353,7 @@ impl Salmon {
entity.insert(SalmonFromBucket(d.value.into_boolean()?));
}
17 => {
entity.insert(SalmonKind(d.value.into_string()?));
entity.insert(SalmonKind(d.value.into_int()?));
}
_ => {}
}
Expand Down Expand Up @@ -10509,7 +10450,7 @@ impl Default for TropicalFishMetadataBundle {
}

#[derive(Component, Deref, DerefMut, Clone)]
pub struct HomePos(pub BlockPos);
pub struct TurtleHomePos(pub BlockPos);
#[derive(Component, Deref, DerefMut, Clone)]
pub struct HasEgg(pub bool);
#[derive(Component, Deref, DerefMut, Clone)]
Expand All @@ -10530,7 +10471,7 @@ impl Turtle {
match d.index {
0..=16 => AbstractAnimal::apply_metadata(entity, d)?,
17 => {
entity.insert(HomePos(d.value.into_block_pos()?));
entity.insert(TurtleHomePos(d.value.into_block_pos()?));
}
18 => {
entity.insert(HasEgg(d.value.into_boolean()?));
Expand All @@ -10557,7 +10498,7 @@ impl Turtle {
pub struct TurtleMetadataBundle {
_marker: Turtle,
parent: AbstractAnimalMetadataBundle,
home_pos: HomePos,
turtle_home_pos: TurtleHomePos,
has_egg: HasEgg,
laying_egg: LayingEgg,
travel_pos: TravelPos,
Expand Down Expand Up @@ -10612,7 +10553,7 @@ impl Default for TurtleMetadataBundle {
abstract_ageable_baby: AbstractAgeableBaby(false),
},
},
home_pos: HomePos(BlockPos::new(0, 0, 0)),
turtle_home_pos: TurtleHomePos(BlockPos::new(0, 0, 0)),
has_egg: HasEgg(false),
laying_egg: LayingEgg(false),
travel_pos: TravelPos(BlockPos::new(0, 0, 0)),
Expand Down Expand Up @@ -12703,11 +12644,6 @@ pub fn apply_metadata(
Creaking::apply_metadata(entity, d)?;
}
}
azalea_registry::EntityKind::CreakingTransient => {
for d in items {
CreakingTransient::apply_metadata(entity, d)?;
}
}
azalea_registry::EntityKind::Creeper => {
for d in items {
Creeper::apply_metadata(entity, d)?;
Expand Down Expand Up @@ -13402,9 +13338,6 @@ pub fn apply_default_metadata(
azalea_registry::EntityKind::Creaking => {
entity.insert(CreakingMetadataBundle::default());
}
azalea_registry::EntityKind::CreakingTransient => {
entity.insert(CreakingTransientMetadataBundle::default());
}
azalea_registry::EntityKind::Creeper => {
entity.insert(CreeperMetadataBundle::default());
}
Expand Down
6 changes: 4 additions & 2 deletions azalea-entity/src/particle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use azalea_inventory::ItemSlot;
use azalea_registry::ParticleKind;
use bevy_ecs::component::Component;

// the order of this enum must be kept in-sync with ParticleKind, otherwise
// the order of this enum must be kept in sync with ParticleKind, otherwise
// we get errors parsing particles.
/// A [`ParticleKind`] with data potentially attached to it.
#[derive(Component, Clone, Debug, McBuf, Default)]
Expand Down Expand Up @@ -44,6 +44,7 @@ pub enum Particle {
Flame,
Infested,
CherryLeaves,
PaleOakLeaves,
SculkSoul,
SculkCharge(SculkChargeParticle),
SculkChargePop,
Expand Down Expand Up @@ -128,7 +129,7 @@ impl From<ParticleKind> for Particle {
/// attached (like block particles), then it's set to the default.
fn from(kind: ParticleKind) -> Self {
// this is mostly just here so it fails to compile when a new particle is added
// to ParticleKind, since ParticleData has to be updated manually
// to ParticleKind, since `Particle` has to be updated manually
match kind {
ParticleKind::AngryVillager => Self::AngryVillager,
ParticleKind::Block => Self::Block(BlockParticle::default()),
Expand Down Expand Up @@ -162,6 +163,7 @@ impl From<ParticleKind> for Particle {
ParticleKind::Fishing => Self::Fishing,
ParticleKind::Flame => Self::Flame,
ParticleKind::CherryLeaves => Self::CherryLeaves,
ParticleKind::PaleOakLeaves => Self::PaleOakLeaves,
ParticleKind::SculkSoul => Self::SculkSoul,
ParticleKind::SculkCharge => Self::SculkCharge(SculkChargeParticle::default()),
ParticleKind::SculkChargePop => Self::SculkChargePop,
Expand Down
6 changes: 4 additions & 2 deletions azalea-inventory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ edition = "2021"
license = "MIT"
name = "azalea-inventory"
repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-inventory-macros"
version = "0.10.3+mc1.21.1"
version = "0.10.3+mc1.21.4"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
azalea-buf = { version = "0.10.0", path = "../azalea-buf" }
azalea-chat = { version = "0.10.0", path = "../azalea-chat", features = ["azalea-buf"] }
azalea-chat = { version = "0.10.0", path = "../azalea-chat", features = [
"azalea-buf",
] }
azalea-core = { version = "0.10.0", path = "../azalea-core" }
azalea-inventory-macros = { version = "0.10.0", path = "./azalea-inventory-macros" }
azalea-registry = { version = "0.10.0", path = "../azalea-registry" }
Expand Down
Loading
Loading