[PR #6627] [MERGED] OptiFine entity models: animations read blocking, crawling, swimming, held items and more #6995

Closed
opened 2026-11-03 06:31:10 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6627
Author: @some-du6e
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: optifine/emf-variables


📝 Commits (2)

  • 1d20a9d OptiFine entity models: animations read blocking, crawling, swimming, held items and more
  • e4b2778 OptiFine entity models: the local player's model knows when it's in water

📊 Changes

2 files changed (+105 additions, -7 deletions)

View changed files

📝 crates/horizon-client/src/game/perspective.rs (+4 -0)
📝 crates/horizon-client/src/mobs/cem_anim.rs (+101 -7)

📄 Description

Packs' entity model animations read Entity Model Features' extra variables: is_blocking, is_swimming, is_using_item, which arm is swinging, held items. Fresh Animations-style packs use them for shield poses, swim strokes, eating and drinking arms and riding poses. In Horizon most of them still read 0, so those animations never played.

This wires every one the client's mob actually has data for, in mobs/cem_anim.rs:

  • is_blocking: a player holding up an item that blocks attacks, as synced to the client. Other mobs never block, as in vanilla. It turns on as the item comes up; vanilla may wait out the shield's short block delay first, which I couldn't check without the decompiled source.
  • is_using_item: the synced living-entity flag (eating, drinking, drawing a bow).
  • is_swimming: the swimming pose, or a drowned's swimming flag. A drowned has no swimming pose.
  • is_crawling: the swimming pose out of water, vanilla's visual crawl. The local player's model now carries its water and lava state, so a player swimming in open water doesn't read as crawling.
  • is_holding_item_right / is_holding_item_left: the main and off hand, swapped for a left-handed mob or player.
  • is_swinging_right_arm / is_swinging_left_arm: a swing in progress, on the hand it names or the main arm.
  • is_ridden: the mob carries a passenger.
  • is_sitting: now also foxes, pandas and camels, by their own synced flags.

Still 0, with the reason in the code:

  • anger_time, anger_time_start: the client only gets a wolf's anger end time, and never the start.
  • height_above_ground, fluid_depth_up: they need the blocks around the mob, which the draw doesn't see.
  • is_wet: still water only, since rain needs the weather and the sky above the mob.
  • is_in_hand, is_in_item_frame, is_on_head, is_on_shoulder, is_first_person_hand, is_hovered: they depend on where the model is drawn, which isn't passed down yet.

Docs I worked from (no mod source read): EMF's .github/emf_animation.txt and FEATURES.md, and OptiFine's cem_animation.txt.

Checks:

  • cargo fmt: clean

  • Tests:

    • the parameters test now sets blocking, a crawl pose out of water, item use, a stick in the main hand of a left-handed mob, a swing naming no hand, and a rider, each adding its own power of two. Dropping any wire, or swapping left and right, changes the sum.
    • a fox's sitting comes from its own flags
    • the swimming pose swims in water and crawls out of it
    • The panda, camel and drowned branches have no test.
  • Build, clippy and the suite passed in fork CI (this machine doesn't build): https://github.com/some-du6e/horizon/actions/runs/41364989050 (the review fix is at https://github.com/some-du6e/horizon/actions/runs/41366655030)

  • Not run: the game, since there's no vanilla data (.local/) here.

  • Review loop: round 1 found the local player's model missing its water state; fixed in e4b2778ed.

Note

Filed by Opus 5.5 using Claude Code.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6627 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `optifine/emf-variables` --- ### 📝 Commits (2) - [`1d20a9d`](https://github.com/horizon-rust/horizon/commit/1d20a9db1dda2e1c9b768a2d62a9d7211934b19c) OptiFine entity models: animations read blocking, crawling, swimming, held items and more - [`e4b2778`](https://github.com/horizon-rust/horizon/commit/e4b2778edbd77814239d8316cd034d8847b41763) OptiFine entity models: the local player's model knows when it's in water ### 📊 Changes **2 files changed** (+105 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/perspective.rs` (+4 -0) 📝 `crates/horizon-client/src/mobs/cem_anim.rs` (+101 -7) </details> ### 📄 Description Packs' entity model animations read Entity Model Features' extra variables: `is_blocking`, `is_swimming`, `is_using_item`, which arm is swinging, held items. Fresh Animations-style packs use them for shield poses, swim strokes, eating and drinking arms and riding poses. In Horizon most of them still read 0, so those animations never played. This wires every one the client's mob actually has data for, in `mobs/cem_anim.rs`: - `is_blocking`: a player holding up an item that blocks attacks, as synced to the client. Other mobs never block, as in vanilla. It turns on as the item comes up; vanilla may wait out the shield's short block delay first, which I couldn't check without the decompiled source. - `is_using_item`: the synced living-entity flag (eating, drinking, drawing a bow). - `is_swimming`: the swimming pose, or a drowned's swimming flag. A drowned has no swimming pose. - `is_crawling`: the swimming pose out of water, vanilla's visual crawl. The local player's model now carries its water and lava state, so a player swimming in open water doesn't read as crawling. - `is_holding_item_right` / `is_holding_item_left`: the main and off hand, swapped for a left-handed mob or player. - `is_swinging_right_arm` / `is_swinging_left_arm`: a swing in progress, on the hand it names or the main arm. - `is_ridden`: the mob carries a passenger. - `is_sitting`: now also foxes, pandas and camels, by their own synced flags. Still 0, with the reason in the code: - `anger_time`, `anger_time_start`: the client only gets a wolf's anger end time, and never the start. - `height_above_ground`, `fluid_depth_up`: they need the blocks around the mob, which the draw doesn't see. - `is_wet`: still water only, since rain needs the weather and the sky above the mob. - `is_in_hand`, `is_in_item_frame`, `is_on_head`, `is_on_shoulder`, `is_first_person_hand`, `is_hovered`: they depend on where the model is drawn, which isn't passed down yet. Docs I worked from (no mod source read): EMF's `.github/emf_animation.txt` and `FEATURES.md`, and OptiFine's `cem_animation.txt`. Checks: - `cargo fmt`: clean - Tests: - the parameters test now sets blocking, a crawl pose out of water, item use, a stick in the main hand of a left-handed mob, a swing naming no hand, and a rider, each adding its own power of two. Dropping any wire, or swapping left and right, changes the sum. - a fox's sitting comes from its own flags - the swimming pose swims in water and crawls out of it - The panda, camel and drowned branches have no test. - Build, clippy and the suite passed in fork CI (this machine doesn't build): https://github.com/some-du6e/horizon/actions/runs/41364989050 (the review fix is at https://github.com/some-du6e/horizon/actions/runs/41366655030) - Not run: the game, since there's no vanilla data (`.local/`) here. - Review loop: round 1 found the local player's model missing its water state; fixed in e4b2778ed. > [!NOTE] > Filed by Opus 5.5 using Claude Code. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:31:10 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6995
No description provided.