diff options
author | FaceDeer <derksenmobile@gmail.com> | 2017-01-08 01:23:10 -0700 |
---|---|---|
committer | FaceDeer <derksenmobile@gmail.com> | 2017-01-08 01:23:10 -0700 |
commit | d7e5309833bc7044447982424dc8431d84d7a1a0 (patch) | |
tree | db1081d61fd650db0593ef190b0bb32f93a19b3a /node_builders.lua | |
parent | e704249735372a3232883cc8b7f25679f4949a8d (diff) |
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.
Diffstat (limited to 'node_builders.lua')
-rw-r--r-- | node_builders.lua | 6 |
1 files changed, 6 insertions, 0 deletions
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}) |