Adapt to minecart v2.00
This commit is contained in:
parent
7f39cceb0f
commit
a784069777
@ -27,8 +27,9 @@ end
|
|||||||
|
|
||||||
local function switch_on(pos)
|
local function switch_on(pos)
|
||||||
logic.swap_node(pos, "techage:ta3_cartdetector_on")
|
logic.swap_node(pos, "techage:ta3_cartdetector_on")
|
||||||
logic.send_on(pos, M(pos))
|
if logic.send_on(pos, M(pos)) then
|
||||||
minetest.after(1, switch_off, pos)
|
minetest.after(1, switch_off, pos)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function node_timer(pos)
|
local function node_timer(pos)
|
||||||
@ -135,7 +136,7 @@ techage.register_node({"techage:ta3_cartdetector_off", "techage:ta3_cartdetector
|
|||||||
if topic == "on" then
|
if topic == "on" then
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local dir = minetest.facedir_to_dir(node.param2)
|
local dir = minetest.facedir_to_dir(node.param2)
|
||||||
minecart.punch_cart(pos, nil, 1.5, dir)
|
minecart.punch_cart(pos, nil, 1.6, dir)
|
||||||
elseif topic == "state" then
|
elseif topic == "state" then
|
||||||
local node = techage.get_node_lvm(pos)
|
local node = techage.get_node_lvm(pos)
|
||||||
if node.name == "techage:ta3_cartdetector_on" then
|
if node.name == "techage:ta3_cartdetector_on" then
|
||||||
@ -152,3 +153,5 @@ techage.register_node({"techage:ta3_cartdetector_off", "techage:ta3_cartdetector
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Register default cart in addition
|
||||||
|
minecart.tEntityNames["carts:cart"] = true
|
@ -64,6 +64,7 @@ function techage.logic.send_on(pos, meta, time)
|
|||||||
minetest.get_node_timer(pos):start(time)
|
minetest.get_node_timer(pos):start(time)
|
||||||
end
|
end
|
||||||
techage.send_multi(own_num, numbers, "on")
|
techage.send_multi(own_num, numbers, "on")
|
||||||
|
return own_num == numbers
|
||||||
end
|
end
|
||||||
|
|
||||||
function techage.logic.send_off(pos, meta)
|
function techage.logic.send_off(pos, meta)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user