Add basic screwdriver support

This commit is contained in:
Wuzzy 2017-12-05 14:09:39 +01:00
parent 2b9f37b3e8
commit 320567e1f2
33 changed files with 144 additions and 5 deletions

View file

@ -1,3 +1,4 @@
mesecons
mcl_sounds
doc?
screwdriver?

View file

@ -196,6 +196,11 @@ local groups = {
attached_node = 1,
}
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.disallow
end
for _, mode in pairs{"comp", "sub"} do
for _, state in pairs{mesecon.state.on, mesecon.state.off} do
local state_str = state_strs[state]
@ -255,7 +260,8 @@ for _, state in pairs{mesecon.state.on, mesecon.state.off} do
rules = comparator_get_input_rules,
action_change = update_self,
}
}
},
on_rotate = on_rotate,
}
if mode == "comp" and state == mesecon.state.off then

View file

@ -8,3 +8,4 @@ mcl_nether
3d_armor_stand
3d_armor
doc?
screwdriver?

View file

@ -26,6 +26,11 @@ local setup_dispenser = function(pos)
inv:set_size("main", 9)
end
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.rotate_simple
end
-- Shared core definition table
local dispenserdef = {
is_ground_content = false,
@ -363,7 +368,8 @@ local dispenserdef = {
end
end,
rules = mesecon.rules.alldirs,
}}
}},
on_rotate = on_rotate,
}
-- Horizontal dispenser

View file

@ -2,3 +2,4 @@ mcl_init
mesecons
mcl_util
doc?
screwdriver?

View file

@ -26,6 +26,11 @@ local setup_dropper = function(pos)
inv:set_size("main", 9)
end
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.rotate_simple
end
-- Shared core definition table
local dropperdef = {
is_ground_content = false,
@ -91,7 +96,8 @@ local dropperdef = {
end
end,
rules = mesecon.rules.alldirs,
}}
}},
on_rotate = on_rotate,
}
-- Horizontal dropper

View file

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

View file

@ -95,6 +95,11 @@ else
help = false
end
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.disallow
end
minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
description = "Redstone Repeater",
inventory_image = icon,
@ -156,7 +161,8 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
rules = delayer_get_input_rules,
action_on = delayer_activate
}
}
},
on_rotate = on_rotate,
})
@ -215,7 +221,8 @@ minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), {
rules = delayer_get_input_rules,
action_off = delayer_deactivate
}
}
},
on_rotate = on_rotate,
})
end

View file

@ -2,3 +2,4 @@ mesecons
mesecons_mvps
mcl_mobitems
doc?
screwdriver?

View file

@ -173,6 +173,11 @@ local pistonspec_normal = {
local usagehelp_piston = "This block can have one of 6 possible orientations. On placement, the pusher will face you."
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.disallow
end
-- offstate
minetest.register_node("mesecons_pistons:piston_normal_off", {
description = "Piston",
@ -200,6 +205,7 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
})
-- onstate
@ -230,6 +236,7 @@ minetest.register_node("mesecons_pistons:piston_normal_on", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
})
-- pusher
@ -254,6 +261,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_normal", {
node_box = piston_pusher_box,
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
on_rotate = on_rotate,
})
-- Sticky ones
@ -296,6 +304,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
})
-- onstate
@ -326,6 +335,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
})
-- pusher
@ -350,6 +360,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_sticky", {
node_box = piston_pusher_box,
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
on_rotate = on_rotate,
})
--
@ -406,6 +417,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_off", {
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
})
-- onstate
@ -436,6 +448,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_on", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
})
-- pusher
@ -460,6 +473,7 @@ minetest.register_node("mesecons_pistons:piston_up_pusher_normal", {
node_box = piston_up_pusher_box,
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
on_rotate = on_rotate,
})
@ -499,6 +513,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_off", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
})
-- onstate
@ -529,6 +544,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_on", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
})
-- pusher
@ -553,6 +569,7 @@ minetest.register_node("mesecons_pistons:piston_up_pusher_sticky", {
node_box = piston_up_pusher_box,
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
on_rotate = on_rotate,
})
--
@ -611,6 +628,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_off", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
})
-- onstate
@ -641,6 +659,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_on", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
})
-- pusher
@ -665,6 +684,7 @@ minetest.register_node("mesecons_pistons:piston_down_pusher_normal", {
node_box = piston_down_pusher_box,
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
on_rotate = on_rotate,
})
-- Sticky
@ -701,6 +721,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_off", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
})
-- onstate
@ -731,6 +752,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_on", {
}},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
on_rotate = on_rotate,
})
-- pusher
@ -755,6 +777,7 @@ minetest.register_node("mesecons_pistons:piston_down_pusher_sticky", {
node_box = piston_down_pusher_box,
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,
on_rotate = on_rotate,
})