The distance limit can be configured with the `moremesecons_entity_detector.max_radius` setting.
An additional change prevents a crash if an object returned by `get_objects_inside_radius` is neither a valid player nor a luaentity. We don't know why this happens but it sometimes does.
* Use opaque use_texture_alpha for the timegate and dual_delayer
This avoids warnings shown by Minetest and improves the nodes' look when a bilinear filter is enabled.
Since the textures are also used as inventory images, I didn't remove the transparency from the texture files.
* Luablock: Fix the missing position argument when executing the lua code fails
* Wireless: Fix the missing id argument
* Localize several variables
* Some other small changes, e.g. dead code removal
This reduces the PNG file sizes and fixes the invalid sRGB profile warnings.
I have additionally reduced the moremesecons_luablock.png resolution to 32x32.
In comparison to using Minetest's hash_node_position, this saves additional information about the z-only and zy-only components, which is what the vector_extras code did.
In comparison to the old vector_extras code, this does not create lots of lua tables, which is slow, but instead uses one table as hashmap.
The name of the detected player can now be requested by sending {command
= "get"} to the detector. The detection radius can be changed by sending
{radius = value}.
Data associated to a LuaBlock is redundantly stored in both its metadata
and in the mod storage so that it is not possible to hack a LuaBlock by
changing its metadata or copying it using WorldEdit. This commit changes
how it is done:
* Store full code instead of storing MD5 checksum, which avoids bug
caused by serializing non-ASCII strings using minetest.serialize,
* Also store owner,
* Use `minetest.hash_node_position` instead of deprecated vector_extras
set_data_to_pos etc,
* Remove mod storage data associated with the LuaBlock when destroying
it,
* Create helper functions for manipulating the mod storage in
moremesecons_utils, I will soon update other parts of MoreMesecons as well to use them.
This commit breaks backwards compatibility: previously created LuaBlocks
will have to be reset by opening the formspec and pressing the `Submit`
button.
This commit also fixes an unrelated bug: code in the formspec was not
correctly escaped using minetest.formspec_escape.