This spawns a villager per bed on village gen and saves the bed
position in the entity. If it moves too far from the village
it gets teleported (for now) back.
As map generation and growing mechanics have been changed to generate
uncarved pumpkins instead of carved, requiring players to shear every
pumpkin before trading it with villagers seems like useless busywork.
* For some unexplained reason, `mcl_burning.storage[player]` can
sometimes be `nil`, causing a crash in `on_leaveplayer()`. This
commit adds a check for that. If a `nil` is encountered, a sane
value is substituted and a warning is set to the log.
* Remove unused code that was commented out. The code tried to find
fire luaentities in the same spot as the newly created fire luaentity.
It may have been intended to optimize getting set on fire multiple
times, but it makes no sense as it does not discriminate between fire
luaentities attached to the object set on fire and those attached to
other objects. The function that this code was in also has a better
way to prevent adding multiple fire luaentities in the first place.
* In mineclone5 a crash was reported to occur when deserialization of
storage returned nil in on_joinplayer. https://git.minetest.land/
MineClone5/MineClone5/commit/96c4fb60d8641b4181edb902ed24dbf173828d09
This commit uses a different, but equally effective fix.
* Remove animation_frame from fire entity state, it is now kept in the
storage table of the parent entity.
* Rename animation_timer in fire entity table to _mcl_animation_timer,
in line with mineclone2 policy on adding custom members to minetest
tables.
* Comment out code that does nothing sensible. Scheduled for deletion
at a later time.
* Mobs redo uses `registered_items[]` where clearly the proper table
accessed should be `registered_nodes[]`. Perhaps this magically
works, but it looks nonsensical. Switch to the use the more
sensible `registered_nodes[]` table.
* Check if node has a definition table before attempting to evaluate its
attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
and improve readability.
* Check if node has a definition table before attempting to evaluate its
attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
and improve readability.
* Check if node has a definition table before attempting to evaluate its
attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
and improve readability.
* Check if node has a definition table before attempting to evaluate its
attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
and improve readability.
* Check if node has a definition table before attempting to evaluate its
attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
and improve readability.
* Check if node has a definition table before attempting to evaluate
attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
and improve readability.
* Reduce redundant `== false` condition check.
Changes to mcl_burning.set_on_fire():
* Add logic that only updates the burn time, but skips adding fire
entities to objects that are already burning.
* Condense code a little, remove single use variables.
* Add a comment to a questionable piece of code.
* Add comments to the function.
* Add update_hud() function.
* Remove the client channels.
* Unglobalize animation_frames variable.
* Fix bug where player state was not stored on shutdown of singleplayer
game.
* Remove superfluous sanity_check() function, this code could easily be
inlined in its only caller.
The parameters for the flames sprite were incorrect, causing the reverse
side of the sprite to appear as an opaque black rectangle. Use the
correct incantation.