diff options
-rw-r--r-- | faregate.lua | 2 | ||||
-rw-r--r-- | init.lua | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/faregate.lua b/faregate.lua index a065002..e5170bd 100644 --- a/faregate.lua +++ b/faregate.lua @@ -8,6 +8,7 @@ minetest.register_node("farebox:faregate", { }, drawtype = "nodebox", paramtype = "light", + paramtype2 = "facedir", description = "Faregate", node_box = { type = "fixed", @@ -49,6 +50,7 @@ minetest.register_node("farebox:faregate_open", { tiles = { "default_steel_block.png" }, + paramtype2 = "facedir", description = "Open Faregate", mesecons = { effector = { @@ -36,12 +36,16 @@ farebox.rules = {x=0, y=2, z=0}} function farebox.open_faregate(pos) - minetest.swap_node(pos, {name="farebox:faregate_open"}) + node = minetest.get_node(pos) + node.name = "farebox:faregate_open" + minetest.swap_node(pos, node) minetest.sound_play("doors_steel_door_open", {pos = pos, gain = 0.3, max_hear_distance = 10}) end function farebox.close_faregate(pos) - minetest.swap_node(pos, {name="farebox:faregate"}) + node = minetest.get_node(pos) + node.name = "farebox:faregate" + minetest.swap_node(pos, node) minetest.sound_play("doors_steel_door_close", {pos = pos, gain = 0.3, max_hear_distance = 10}) end |