Use rotate_simple for insulated wires (#382)

This commit is contained in:
DS 2018-01-30 19:47:03 +01:00 committed by Vitaliy
parent 065e870349
commit 7537b9f381
5 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,5 @@
local screwdriver_exists = minetest.global_exists("screwdriver")
local corner_nodebox = { local corner_nodebox = {
type = "fixed", type = "fixed",
fixed = {{ -16/32-0.001, -17/32, -3/32, 0, -13/32, 3/32 }, fixed = {{ -16/32-0.001, -17/32, -3/32, 0, -13/32, 3/32 },
@ -47,6 +49,7 @@ minetest.register_node("mesecons_extrawires:corner_on", {
offstate = "mesecons_extrawires:corner_off" offstate = "mesecons_extrawires:corner_off"
}}, }},
on_blast = mesecon.on_blastnode, on_blast = mesecon.on_blastnode,
on_rotate = screwdriver_exists and screwdriver.rotate_simple,
}) })
minetest.register_node("mesecons_extrawires:corner_off", { minetest.register_node("mesecons_extrawires:corner_off", {
@ -75,6 +78,7 @@ minetest.register_node("mesecons_extrawires:corner_off", {
onstate = "mesecons_extrawires:corner_on" onstate = "mesecons_extrawires:corner_on"
}}, }},
on_blast = mesecon.on_blastnode, on_blast = mesecon.on_blastnode,
on_rotate = screwdriver_exists and screwdriver.rotate_simple,
}) })
minetest.register_craft({ minetest.register_craft({

View File

@ -1,2 +1,3 @@
default default
mesecons mesecons
screwdriver?

View File

@ -1,3 +1,5 @@
local screwdriver_exists = minetest.global_exists("screwdriver")
local tjunction_nodebox = { local tjunction_nodebox = {
type = "fixed", type = "fixed",
fixed = {{ -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 }, fixed = {{ -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 },
@ -48,6 +50,7 @@ minetest.register_node("mesecons_extrawires:tjunction_on", {
offstate = "mesecons_extrawires:tjunction_off" offstate = "mesecons_extrawires:tjunction_off"
}}, }},
on_blast = mesecon.on_blastnode, on_blast = mesecon.on_blastnode,
on_rotate = screwdriver_exists and screwdriver.rotate_simple,
}) })
minetest.register_node("mesecons_extrawires:tjunction_off", { minetest.register_node("mesecons_extrawires:tjunction_off", {
@ -76,6 +79,7 @@ minetest.register_node("mesecons_extrawires:tjunction_off", {
onstate = "mesecons_extrawires:tjunction_on" onstate = "mesecons_extrawires:tjunction_on"
}}, }},
on_blast = mesecon.on_blastnode, on_blast = mesecon.on_blastnode,
on_rotate = screwdriver_exists and screwdriver.rotate_simple,
}) })
minetest.register_craft({ minetest.register_craft({

View File

@ -1 +1,2 @@
mesecons mesecons
screwdriver?

View File

@ -1,3 +1,5 @@
local screwdriver_exists = minetest.global_exists("screwdriver")
local function insulated_wire_get_rules(node) local function insulated_wire_get_rules(node)
local rules = {{x = 1, y = 0, z = 0}, local rules = {{x = 1, y = 0, z = 0},
{x =-1, y = 0, z = 0}} {x =-1, y = 0, z = 0}}
@ -39,6 +41,7 @@ minetest.register_node("mesecons_insulated:insulated_on", {
rules = insulated_wire_get_rules rules = insulated_wire_get_rules
}}, }},
on_blast = mesecon.on_blastnode, on_blast = mesecon.on_blastnode,
on_rotate = screwdriver_exists and screwdriver.rotate_simple,
}) })
minetest.register_node("mesecons_insulated:insulated_off", { minetest.register_node("mesecons_insulated:insulated_off", {
@ -72,6 +75,7 @@ minetest.register_node("mesecons_insulated:insulated_off", {
rules = insulated_wire_get_rules rules = insulated_wire_get_rules
}}, }},
on_blast = mesecon.on_blastnode, on_blast = mesecon.on_blastnode,
on_rotate = screwdriver_exists and screwdriver.rotate_simple,
}) })
minetest.register_craft({ minetest.register_craft({