From d7e5309833bc7044447982424dc8431d84d7a1a0 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sun, 8 Jan 2017 01:23:10 -0700 Subject: Added a rotation controller Well that was a lot of work. Also, switched the "waiting" timer management to the actual on_timer system - I noticed that minetest.after wasn't persisting through server shutdown and restart, that could put a controller in a "broken" state. --- node_builders.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'node_builders.lua') diff --git a/node_builders.lua b/node_builders.lua index 94467a8..9e348cc 100644 --- a/node_builders.lua +++ b/node_builders.lua @@ -89,6 +89,8 @@ minetest.register_node("digtron:builder", { offset = meta:get_int("offset") end if build_facing and build_facing >= 0 and build_facing < 24 then + -- TODO: wallmounted facings only run from 0-5, a player could theoretically put a wallmounted item into the builder and then manually set the build facing to an invalid number + -- Should prevent that somehow. But not tonight. meta:set_int("build_facing", math.floor(build_facing)) end @@ -134,6 +136,10 @@ minetest.register_node("digtron:builder", { on_destruct = function(pos) digtron.remove_builder_item(pos) end, + + after_place_node = function(pos) + digtron.update_builder_item(pos) + end, allow_metadata_inventory_put = function(pos, listname, index, stack, player) local inv = minetest.get_inventory({type="node", pos=pos}) -- cgit v1.2.3