Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 16 additions & 2 deletions pomme-client/src/app/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2560,7 +2560,6 @@ impl AppCore {
entity_type,
position,
velocity,
y_rot_deg,
x_rot_deg,
head_y_rot_deg,
} => {
Expand All @@ -2572,7 +2571,6 @@ impl AppCore {
entity_type,
position,
LookDirection::new(head_y_rot_deg, x_rot_deg),
y_rot_deg,
uuid,
);
if entity_type == azalea_registry::builtin::EntityKind::Player {
Expand Down Expand Up @@ -2835,6 +2833,22 @@ impl AppCore {
);
}
}
// `Armadillo.handleEntityEvent`: a local sound at its position.
NetworkEvent::ArmadilloPeek { id } => {
if let Some(pos) = game.entity_store.armadillo_peek(id) {
self.audio.play_world_sound(
&crate::audio::SoundRef::event("entity.armadillo.peek"),
crate::audio::CATEGORY_NEUTRAL,
pos,
1.0,
1.0,
fastrand::u64(..),
);
}
}
NetworkEvent::GoatRam { id, lowering } => {
game.entity_store.set_goat_lowering_head(id, lowering);
}
NetworkEvent::SquidTentacleReset { id } => {
game.entity_store.squid_tentacle_reset(id);
}
Expand Down
36 changes: 36 additions & 0 deletions pomme-client/src/app/phases/in_game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4145,6 +4145,8 @@ pub fn update_game(
fox: extras.fox,
axolotl: extras.axolotl,
panda: extras.panda,
armadillo: extras.armadillo,
goat: extras.goat,
parrot: extras.parrot,
dolphin_moving: extras.dolphin_moving,
turtle: extras.turtle,
Expand Down Expand Up @@ -5051,6 +5053,8 @@ struct EntityExtras {
fox: crate::renderer::entity_model::FoxAnims,
axolotl: crate::renderer::entity_model::AxolotlAnims,
panda: crate::renderer::entity_model::PandaAnims,
armadillo: crate::renderer::entity_model::ArmadilloAnims,
goat: crate::renderer::entity_model::GoatAnims,
parrot: crate::renderer::entity_model::ParrotAnims,
dolphin_moving: bool,
turtle: crate::renderer::entity_model::TurtleAnims,
Expand Down Expand Up @@ -5193,6 +5197,19 @@ fn entity_extras(
| EntityKind::TropicalFish
| EntityKind::Pufferfish => fish_extras(e, alpha),
EntityKind::IronGolem => golem_extras(e, alpha),
EntityKind::Armadillo => EntityExtras {
armadillo: armadillo_anims(e, alpha),
..Default::default()
},
// `GoatRenderer.extractRenderState`.
EntityKind::Goat => EntityExtras {
goat: crate::renderer::entity_model::GoatAnims {
has_left_horn: e.goat.has_left_horn,
has_right_horn: e.goat.has_right_horn,
ramming_x_head_rot: e.goat.ramming_x_head_rot(e.is_baby),
},
..Default::default()
},
// `DolphinRenderer.extractRenderState`.
EntityKind::Dolphin => EntityExtras {
dolphin_moving: e.velocity.x * e.velocity.x + e.velocity.z * e.velocity.z > 1.0e-7,
Expand Down Expand Up @@ -5417,6 +5434,25 @@ fn axolotl_anims(
anims
}

/// Vanilla `ArmadilloRenderer.extractRenderState`.
fn armadillo_anims(
e: &crate::entity::LivingEntity,
alpha: f32,
) -> crate::renderer::entity_model::ArmadilloAnims {
let a = &e.armadillo;
// `AnimationState.getTimeInMillis`, whose start may sit before tick 0
// after a `fastForward`.
let clock = |start: Option<i64>| {
start.map(|s| ((e.age_in_ticks as f32 + alpha - s as f32) * 50.0) as i64 as f32 / 1000.0)
};
crate::renderer::entity_model::ArmadilloAnims {
hiding_in_shell: a.hiding_in_shell(),
roll_out: clock(a.roll_out_start),
roll_up: clock(a.roll_up_start),
peek: clock(a.peek_start),
}
}

/// Vanilla `SnifferRenderer.extractRenderState`.
fn sniffer_anims(
e: &crate::entity::LivingEntity,
Expand Down
Loading
Loading