when using the village tool doing that on an unsuitable location
would result in no position for the belltower being available
this checks for that and ... doesn't crash then ^^
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.
The global(!) table settlements_in_world` has no use, but is serialized and
saved to a file `settlements.txt` every time during generation of a new
village, adding more lag. This commit removes all related code:
* Remove all instances of `settlements_in_world`.
* Remove `settlements.load()` and `settlements.save()`.
* Check if node has a definition table before attempting to evaluate its
attributes. By application of De Morgan's law, the compound logic
expression can be rewritten so that the existence of the table is
checked before all following attribute references.
* 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.
* Clarify code flow.
During the rewrite in 89e55e9065, a queue system was added to allow
using both VoxelManip-based generation steps, and set_node-based steps,
however some set_node-based steps (underground mushrooms, nether
decorations, and structures) were missed and remained in a VoxelManip
step. The result is that the changes made by the set_node stages were
overwritten after the (now-stale) VoxelManip data was committed later.
(ref. Mineclonia/Mineclonia#26)