Commit graph

6 commits

Author SHA1 Message Date
trans_soup
6bb71aa341 add opt-in falling_node collision for non-walkable nodes.
make falling_node entities land on nodes with `supports_falling = true`
in their definitions.
2023-10-19 14:07:47 +02:00
trans_soup
8d94fb9c70 minor rename.
look for `after_land` instead of `after_landing` in node defs when
handling falling nodes landing.
2023-10-19 12:46:38 +02:00
trans_soup
96ebbe8e0e improve fall_fix.
make the position passed to callbacks be the position where the
falling_node entity landed, rather than the position it tries to land
on/in.

note that if the node it lands on has its `paramtype2` set to
`"leveled"` then this new position might be empty after a landing.
2023-10-19 11:25:12 +02:00
trans_soup
a09dc62101 add hook for falling_node stepping.
and use this to keep track of their falling velocity.
2023-10-19 11:21:27 +02:00
trans_soup
becfb37402 provide more data to landing node callbacks.
specifically, give them the falling_node entity that landed as third
argument.
2023-10-19 11:19:32 +02:00
trans_soup
e1103a07e4 create fall_fix.
modify the builtin `falling_node` entity to make it possible for mods to
register callbacks to be called when they land and turn into a node.

also register such a callback that checks if the landed node has an
entry `after_landing`, and if so calls that.
2023-10-18 23:30:00 +02:00