summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarter Kolwey <cheapiephp@gmail.com>2017-01-11 16:02:28 -0600
committerJeija <norrepli@gmail.com>2017-03-04 09:40:07 +0100
commit199fb62108e30f0c784583ca5c5add19ca36c02f (patch)
treeca3c98f7734ba6a84e1fa3ccd0b5757f4002ff32
parentc7136b72cb9d041d7a49d905c03841373a93b45c (diff)
Properly handle missing screwdriver modorigin/piston-rotation-rebased
-rw-r--r--mesecons/depends.txt1
-rw-r--r--mesecons/services.lua8
-rw-r--r--mesecons_extrawires/corner.lua4
-rw-r--r--mesecons_extrawires/tjunction.lua4
-rw-r--r--mesecons_insulated/init.lua2
5 files changed, 14 insertions, 5 deletions
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 = {