Port a lot more (basically everything apart from gates, pistons and extrawire crossing) to the new nodedef system. There are some problems with wall button and wall lever (in the way they visually connect to wires)

This commit is contained in:
Jeija
2012-12-09 00:42:30 +01:00
parent cf6080f723
commit b37bdbf55c
16 changed files with 336 additions and 379 deletions

View File

@ -1,5 +1,11 @@
--PISTONS
local update = function(pos, node)
local timer = minetest.env:get_node_timer(pos)
timer:stop()
timer:start(0)
end
minetest.register_node("mesecons_pistons:piston_normal", {
description = "Piston",
tiles = {"jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_side.png"},
@ -25,8 +31,10 @@ minetest.register_node("mesecons_pistons:piston_normal", {
end
return false
end,
mesecons = {effector={
action_change = update
}}
})
mesecon:register_effector("mesecons_pistons:piston_normal", "mesecons_pistons:piston_normal")
minetest.register_node("mesecons_pistons:piston_sticky", {
description = "Sticky Piston",
@ -53,8 +61,10 @@ minetest.register_node("mesecons_pistons:piston_sticky", {
end
return false
end,
mesecons = {effector={
action_change = update
}}
})
mesecon:register_effector("mesecons_pistons:piston_sticky", "mesecons_pistons:piston_sticky")
minetest.register_craft({
output = '"mesecons_pistons:piston_normal" 2',
@ -127,18 +137,6 @@ minetest.register_node("mesecons_pistons:piston_pusher_sticky", {
mesecon:register_mvps_stopper("mesecons_pistons:piston_pusher_normal")
mesecon:register_mvps_stopper("mesecons_pistons:piston_pusher_sticky")
local update = function(pos, node)
if node.name ~= "mesecons_pistons:piston_normal" and node.name ~= "mesecons_pistons:piston_sticky" then
return
end
local timer = minetest.env:get_node_timer(pos)
timer:stop()
timer:start(0)
end
mesecon:register_on_signal_on(update) --push action
mesecon:register_on_signal_off(update) --pull action
function mesecon:piston_push(pos)
local node = minetest.env:get_node(pos)
local dir = mesecon:piston_get_direction(node)