Commit Graph

13 Commits

Author SHA1 Message Date
HybridDog
e5cdeef141 Remove unused loop variables 2021-03-07 20:18:18 +01:00
upsilon
7ba7a5cceb
MapDataStorage: replace "%a" format with "%.17g" 2020-04-29 18:06:17 +02:00
upsilon
f2de7c89b1
MapDataStorage: change serialization in mod storage
Use minetest.serialize on the full values table instead of serializing
each value independently and concatenating.
2020-04-29 12:43:29 +02:00
HybridDog
0000cfb474 Remove old vector_extras code and use the MapDataStorage 2020-04-14 08:49:21 +02:00
HybridDog
9aa0e6ab3d Add MapDataStorage code as replacement for get_data_from_pos etc.
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.
2020-04-14 08:49:21 +02:00
upsilon
7cf99da1a5
LuaBlock: Major changes in mod storage usage
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.
2020-04-09 16:25:21 +02:00
Pierre-Adrien Langrognet
d580e0e974 Merge branch 'master' into settings 2017-06-04 17:57:16 +02:00
upsilon
c53ac5b660
Adjustable Blinky Plant: fix very fast blinking before having set an interval + add a minimum interval setting 2017-05-21 19:11:12 +02:00
AntumDeluge
d542d15fa4 Replace deprecated methods:
- 'setting_get' with 'settings:get'
- 'setting_getbool' with 'settings:get_bool'
2017-05-13 01:52:42 -07:00
upsilon
d8c859a162
Define vector_extras functions in moremesecons_utils
if vector_extras is not loaded
Loading vector_extras is still recommended because its functions may be more up-to-date.
2017-04-19 21:41:10 +02:00
upsilon
b60a719b14
moremesecons.setting: remove pointless val_under_min parameter 2017-04-19 18:33:36 +02:00
upsilon
ea81d826b9
moremesecons.setting: fix wrong type name
"bool" instead of "boolean"
2017-04-19 13:27:06 +02:00
upsilon
75abcb3077
Add a moremesecons_utils mod to reduce redundant code 2017-04-19 11:08:58 +02:00