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.
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.
loose nodes are now automatically registrered when their settled
counterparts are. also rewrite a small amount of wrapper code and node
registration to work with this.
the api function `blockgame.register_node` will now emit events before
and after registering a node, allowing for other code to react to and
affect node registration.
make the wrapper `blockgame.register_node` make reasonable assumptions
that make node registration more convenient.
change other code to take advantage of that change.
also remove the `blockgame.reg_simple_node` utility since it's now
redundant.
create `bg_api_fall` mod, and move files `falling_node.lua` and `loose_node.lua` to there from `bg_api`.
update dependencies in other mods to account for this change.
make `flood_fill` able to be interrupted if its callback returns false;
the meaning that was previously indicated by this return value is now
indicated by nil instead.
update code that uses this function to account for this change.
create api functions `any`, `every`, and `underride`.
`any` and `every` checks if a condition is true for any and every item
in a table, respectively.
`underride` returns a table that defaults to a provided table, for
items that aren't specified in the other provided table.
replace the placeholder api functionality for checking whether air flows
through a node, with something that relies on a dedicated group (instead
of a hard-coded list in the api code).
create public api function that registers "increasing ABM:s"; these
abstract over using numerical values associated with individual nodes in
ABM:s, allowing for straightforward creation of processes that occur
over time.
expose an api function to register "loose" versions of existing nodes,
and implement some behaviour for such nodes; they will fall down if
there is air below them, and will eventually become their non-loose
counterparts if there is not air below them.
clean up things that were broken after renaming `bg_core` to
`bg_terrain`.
also clean up after global rename that added `bg_` prefix to every mod
name.
rename mods; add `bg_` prefix.
add hacky cleanup ABM (couldn't get LBM:s to work), that converts old
nodes into new ones according to this rename.
the cleanup doesn't do anything for items, though.
every server step, mapblocks near online players will have randomly
selected nodes within them receive a "random tick", the behaviour of
which is determined in node definitions.
fix usage of `math.random` in various places to provide both a minimum
and a maximum number, instead of just maximum.
also renamed some files very slightly.