Amenities are nodes that are placed within the home's area and offer
some kind of benefit to the area or the homeowner (while within the
area). An example would be one which expands the maximum area volume,
or one which provides healing while inside the home.
We now check against the home node associated with the area's metadata
to determine whether or not the player is permitted to build/dig in the
area.
This updates the format of the AreaStore area's data to (probably) the
final version this should be considered the format to go with going
forward. Everything going in the home node's metadata just makes things
easier.
This was a doozy to figure out: AreaStore's to_string method doesn't
return a valid UTF8 string, which apparently means that StorageRef's
set_string method won't save it properly.
To counteract this, the serialized AreaStore must be converted to a
valid UTF-8 string before saving. We do this by running it through
minetest.encode_base64 and minetest.decode_base64 to prevent
corruption.
This introduces a performance impact that we need to keep in mind;
thankfully, during normal gameplay it's unlikely that areas will be
updated often enough for this to be an issue.
Also, minor formatting and debugging changes.
This is only a rough first step; later on, we will allow players to
customize the area that their home node covers (up to a point) as well
as what protections and effects are attached to this area.
For now, we only have basic protection of a 7x7x7 cube centered on the
home node.