diff options
author | Thomas--S <info@thomas-stangl.de> | 2018-01-27 17:40:42 +0100 |
---|---|---|
committer | Thomas--S <info@thomas-stangl.de> | 2018-01-28 13:46:16 +0100 |
commit | 1c1be8a7c13cb664551503b88516c75b189aed87 (patch) | |
tree | 8163ba1896c9528683a10fa0288c9c60699034d8 /display_lib | |
parent | 78e3b852740c77b78e19b814e649f66b91dba673 (diff) | |
download | display_modpack-1c1be8a7c13cb664551503b88516c75b189aed87.tar.gz display_modpack-1c1be8a7c13cb664551503b88516c75b189aed87.tar.bz2 display_modpack-1c1be8a7c13cb664551503b88516c75b189aed87.zip |
Update the entities as soon as mapblock is loaded
Useful e.g. after /clearobjects
Introduces the group `display_lib_node`
Diffstat (limited to 'display_lib')
-rw-r--r-- | display_lib/API.md | 2 | ||||
-rw-r--r-- | display_lib/init.lua | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/display_lib/API.md b/display_lib/API.md index 148db60..de08090 100644 --- a/display_lib/API.md +++ b/display_lib/API.md @@ -80,4 +80,6 @@ This is a helper to register entities used for display. }) +**Note:** Nodes in the `display_lib_node` group will have their entities updated as soon as the mapblock is loaded (Useful after /clearobjects). + diff --git a/display_lib/init.lua b/display_lib/init.lua index 59a8529..11ed60e 100644 --- a/display_lib/init.lua +++ b/display_lib/init.lua @@ -230,5 +230,11 @@ function display_lib.register_display_entity(entity_name) end end - +minetest.register_lbm({ + label = "Update display_lib entities", + name = "display_lib:update_entities", + run_at_every_load = true, + nodenames = {"group:display_lib_node"}, + action = function(pos, node) display_lib.update_entities(pos) end, +}) |