diff --git a/mesecons/depends.txt b/mesecons/depends.txt index 4ad96d5..5e28bee 100644 --- a/mesecons/depends.txt +++ b/mesecons/depends.txt @@ -1 +1,2 @@ default +screwdriver? diff --git a/mesecons/services.lua b/mesecons/services.lua index 1abbc0c..0411be9 100644 --- a/mesecons/services.lua +++ b/mesecons/services.lua @@ -93,3 +93,11 @@ mesecon.queue:add_function("cooldown", function (pos) meta:set_int("heat", heat - 1) end end) + +-- "Shim" for simple rotation, will result in the following item in nodedefs using it: +-- "on_rotate = screwdriver.rotate_simple" if screwdriver mod is installed +-- "on_rotate = nil" (essentially not present) if screwdriver mod is missing + +if screwdriver then + mesecon.rotate_simple = screwdriver.rotate_simple +end diff --git a/mesecons_extrawires/corner.lua b/mesecons_extrawires/corner.lua index 05e76b3..63a6ec4 100644 --- a/mesecons_extrawires/corner.lua +++ b/mesecons_extrawires/corner.lua @@ -37,7 +37,7 @@ minetest.register_node("mesecons_extrawires:corner_on", { sunlight_propagates = true, selection_box = corner_selectionbox, node_box = corner_nodebox, - on_rotate = screwdriver.rotate_simple, + on_rotate = mesecon.rotate_simple, groups = {dig_immediate = 3, not_in_creative_inventory = 1}, drop = "mesecons_extrawires:corner_off", mesecons = {conductor = @@ -65,7 +65,7 @@ minetest.register_node("mesecons_extrawires:corner_off", { sunlight_propagates = true, selection_box = corner_selectionbox, node_box = corner_nodebox, - on_rotate = screwdriver.rotate_simple, + on_rotate = mesecon.rotate_simple, groups = {dig_immediate = 3}, mesecons = {conductor = { diff --git a/mesecons_extrawires/tjunction.lua b/mesecons_extrawires/tjunction.lua index 3d991d0..079d88c 100644 --- a/mesecons_extrawires/tjunction.lua +++ b/mesecons_extrawires/tjunction.lua @@ -38,7 +38,7 @@ minetest.register_node("mesecons_extrawires:tjunction_on", { sunlight_propagates = true, selection_box = tjunction_selectionbox, node_box = tjunction_nodebox, - on_rotate = screwdriver.rotate_simple, + on_rotate = mesecon.rotate_simple, groups = {dig_immediate = 3, not_in_creative_inventory = 1}, drop = "mesecons_extrawires:tjunction_off", mesecons = {conductor = @@ -66,7 +66,7 @@ minetest.register_node("mesecons_extrawires:tjunction_off", { sunlight_propagates = true, selection_box = tjunction_selectionbox, node_box = tjunction_nodebox, - on_rotate = screwdriver.rotate_simple, + on_rotate = mesecon.rotate_simple, groups = {dig_immediate = 3}, mesecons = {conductor = { diff --git a/mesecons_insulated/init.lua b/mesecons_insulated/init.lua index 108badf..5dc6d9b 100644 --- a/mesecons_insulated/init.lua +++ b/mesecons_insulated/init.lua @@ -30,7 +30,7 @@ minetest.register_node("mesecons_insulated:insulated_on", { type = "fixed", fixed = { -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 } }, - on_rotate = screwdriver.rotate_simple, + on_rotate = mesecon.rotate_simple, groups = {dig_immediate = 3, not_in_creative_inventory = 1}, drop = "mesecons_insulated:insulated_off", mesecons = {conductor = {