Fix wind turbine and concentrator bugs
This commit is contained in:
parent
4570a10241
commit
54ed4e60c5
@ -65,6 +65,10 @@ local names = networks.register_junction("techage:concentrator", 2/8, Boxes, Tub
|
|||||||
end,
|
end,
|
||||||
}, 27)
|
}, 27)
|
||||||
|
|
||||||
|
for _, name in ipairs(names) do
|
||||||
|
Tube:set_valid_sides(name, {"B", "R", "F", "L", "D", "U"})
|
||||||
|
end
|
||||||
|
|
||||||
techage.register_node(names, {
|
techage.register_node(names, {
|
||||||
on_push_item = function(pos, in_dir, stack)
|
on_push_item = function(pos, in_dir, stack)
|
||||||
local push_dir = M(pos):get_int("push_dir")
|
local push_dir = M(pos):get_int("push_dir")
|
||||||
@ -110,6 +114,10 @@ names = networks.register_junction("techage:ta4_concentrator", 2/8, Boxes, Tube,
|
|||||||
end,
|
end,
|
||||||
}, 27)
|
}, 27)
|
||||||
|
|
||||||
|
for _, name in ipairs(names) do
|
||||||
|
Tube:set_valid_sides(name, {"B", "R", "F", "L", "D", "U"})
|
||||||
|
end
|
||||||
|
|
||||||
techage.register_node(names, {
|
techage.register_node(names, {
|
||||||
on_push_item = function(pos, in_dir, stack)
|
on_push_item = function(pos, in_dir, stack)
|
||||||
local push_dir = M(pos):get_int("push_dir")
|
local push_dir = M(pos):get_int("push_dir")
|
||||||
|
@ -117,9 +117,11 @@ local function stop_rotor(pos, nvm, state)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function can_start(pos, nvm)
|
local function can_start(pos, nvm)
|
||||||
|
check_rotor(pos, nvm)
|
||||||
if nvm.error then
|
if nvm.error then
|
||||||
return nvm.error
|
return nvm.error
|
||||||
end
|
end
|
||||||
|
add_rotor(pos, nvm)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -308,6 +310,7 @@ techage.register_node({"techage:ta4_wind_turbine"}, {
|
|||||||
on_node_load = function(pos)
|
on_node_load = function(pos)
|
||||||
local nvm = techage.get_nvm(pos)
|
local nvm = techage.get_nvm(pos)
|
||||||
add_rotor(pos, nvm, true)
|
add_rotor(pos, nvm, true)
|
||||||
|
start_rotor(pos, nvm)
|
||||||
minetest.get_node_timer(pos):start(CYCLE_TIME)
|
minetest.get_node_timer(pos):start(CYCLE_TIME)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user