mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 11:06:11 -10:00
Spawn eggs used on vines spawn the mob in the vines
SpawnEggItem.useOn spawns in the clicked block itself when its collision shape is empty (vines, grass, flowers) and only otherwise in the block on the clicked face. Horizon always took the face's block, so an egg used on vines put the mob a block out in the air, where it fell instead of climbing. Fixes #6125 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
abbfe4996b
commit
cbb7efe894
2 files changed
+4
-2
No files matched your search
@@ -5882,7 +5882,9 @@ impl Game<'_> {
|
||||
}
|
||||
return Ok(true);
|
||||
}
|
||||
let p = if fluid {
|
||||
// useOn: a clicked block without a collision shape (vines, grass)
|
||||
// takes the mob itself, any other the one on the clicked face.
|
||||
let p = if fluid || self.collision_empty(hit.pos) {
|
||||
hit.pos
|
||||
} else {
|
||||
[
|
||||
|
||||
@@ -207,7 +207,7 @@ impl Game<'_> {
|
||||
self.process_level_events()
|
||||
}
|
||||
/// The block at `pos` has no collision shape.
|
||||
fn collision_empty(&self, pos: [i32; 3]) -> bool {
|
||||
pub(super) fn collision_empty(&self, pos: [i32; 3]) -> bool {
|
||||
let mut scene = SceneCollisions {
|
||||
world: &self.world,
|
||||
binding: self.collision,
|
||||
|
||||
Reference in new issue
Block a user