[PR #6186] [MERGED] Test the sturdy up face when placing evoker fangs #6706

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6186
Author: @MSedgeMC
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/evoker-fang-sturdy


📝 Commits (1)

  • 177d2c9 Test the sturdy up face when placing evoker fangs

📊 Changes

1 file changed (+39 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/mobs/illager.rs (+39 -4)

📄 Description

Evoker.EvokerAttackSpellGoal.createSpellEntity accepts the first block below the cast whose
up face is sturdy:

// javap -p -c on Evoker$EvokerAttackSpellGoal
36: aload 16            // the BlockState below the candidate position
38: aload 42 / 45 / 47  // level, pos, Direction.UP
50: invokevirtual BlockState.isFaceSturdy
53: ifeq 125

Horizon tested full_collision instead, i.e. a full cube. The two agree on stone, dirt, farmland
and bottom slabs (I checked each against the exported isFaceSturdy table), but not on blocks
that are flush to the top of their cell without being a cube: soul sand, mud and a full snow
layer are sturdy_up = true with a collision top of 0.875, so vanilla stands the fang at
floor(maxY) + 0 while Horizon skipped to the block underneath and returned floor(maxY) - 1 + 0.875 — two sixteenths lower, sunk into the floor block.

Proven: on the build VM, cargo test -q -p horizon-client --lib a_fang_stands_on_a_soul_sand_floor
→ 1 passed, and the same test with the old full_collision test restored → FAILED, so the
assertion discriminates.

Not proven: not checked in game. The in-game check: cast on an evoker' target standing on soul
sand and look at where the fangs sit.

Two things worth saying plainly:

  • The ledger row this came from claimed fangs spawn inside farmland and slabs today. That part is
    not true and I did not write a test for it: per the exported isFaceSturdy table, farmland
    (FULL.UP = false, 15/16 high) and a bottom slab (FULL.UP = false) are skipped by vanilla too,
    and Horizon's final y for both is unchanged by this patch (64.5 on a bottom slab, one below the
    farmland in both). The change is real for the flush-but-not-full blocks above, and the test pins
    that; the offset it fixes is 2/16 of a block.
  • STURDY_TOP comes from the exporter's isFaceSturdy with an EmptyBlockGetter, while vanilla
    asks the real level. No block in 26.3 answers differently, but a modded block whose sturdiness
    depends on its neighbours would.

🔄 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/6186 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/evoker-fang-sturdy` --- ### 📝 Commits (1) - [`177d2c9`](https://github.com/horizon-rust/horizon/commit/177d2c9f559e867925bed7c57aebcb83c24d6443) Test the sturdy up face when placing evoker fangs ### 📊 Changes **1 file changed** (+39 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/illager.rs` (+39 -4) </details> ### 📄 Description `Evoker.EvokerAttackSpellGoal.createSpellEntity` accepts the first block below the cast whose **up face is sturdy**: ```java // javap -p -c on Evoker$EvokerAttackSpellGoal 36: aload 16 // the BlockState below the candidate position 38: aload 42 / 45 / 47 // level, pos, Direction.UP 50: invokevirtual BlockState.isFaceSturdy 53: ifeq 125 ``` Horizon tested `full_collision` instead, i.e. a full cube. The two agree on stone, dirt, farmland and bottom slabs (I checked each against the exported `isFaceSturdy` table), but not on blocks that are flush to the top of their cell without being a cube: soul sand, mud and a full snow layer are `sturdy_up = true` with a collision top of 0.875, so vanilla stands the fang at `floor(maxY) + 0` while Horizon skipped to the block underneath and returned `floor(maxY) - 1 + 0.875` — two sixteenths lower, sunk into the floor block. **Proven:** on the build VM, `cargo test -q -p horizon-client --lib a_fang_stands_on_a_soul_sand_floor` → `1 passed`, and the same test with the old `full_collision` test restored → `FAILED`, so the assertion discriminates. **Not proven:** not checked in game. The in-game check: cast on an evoker' target standing on soul sand and look at where the fangs sit. Two things worth saying plainly: - The ledger row this came from claimed fangs spawn *inside farmland and slabs* today. That part is not true and I did not write a test for it: per the exported `isFaceSturdy` table, farmland (`FULL.UP = false`, 15/16 high) and a bottom slab (`FULL.UP = false`) are skipped by vanilla too, and Horizon's final y for both is unchanged by this patch (64.5 on a bottom slab, one below the farmland in both). The change is real for the flush-but-not-full blocks above, and the test pins that; the offset it fixes is 2/16 of a block. - `STURDY_TOP` comes from the exporter's `isFaceSturdy` with an `EmptyBlockGetter`, while vanilla asks the real level. No block in 26.3 answers differently, but a modded block whose sturdiness depends on its neighbours would. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:25: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#6706
No description provided.