fix pipeworks receiving #2

This commit is contained in:
Evert Prants 2020-05-27 21:04:27 +03:00
parent 1023ba489b
commit d86d68b417
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
4 changed files with 11 additions and 4 deletions

View File

@ -141,7 +141,7 @@ end
ele.register_base_device("elepower_farming:composter", { ele.register_base_device("elepower_farming:composter", {
description = "Composter\nConvert organic matter to Biofuel", description = "Composter\nConvert organic matter to Biofuel",
groups = {oddly_breakable_by_hand = 1, cracky = 1, fluid_container = 1, tube = 1}, groups = {oddly_breakable_by_hand = 1, cracky = 1, fluid_container = 1, tubedevice = 1, tubedevice_receiver = 1},
fluid_buffers = { fluid_buffers = {
output = { output = {
capacity = 8000, capacity = 8000,

View File

@ -178,6 +178,7 @@ ele.register_machine("elepower_farming:harvester", {
ele_user = 1, ele_user = 1,
cracky = 1, cracky = 1,
tubedevice = 1, tubedevice = 1,
tubedevice_receiver = 0,
fluid_container = 1, fluid_container = 1,
}, },
fluid_buffers = { fluid_buffers = {

View File

@ -39,7 +39,8 @@ function elepm.register_storage(nodename, nodedef)
nodedef.groups["ele_machine"] = 1 nodedef.groups["ele_machine"] = 1
nodedef.groups["ele_storage"] = 1 nodedef.groups["ele_storage"] = 1
nodedef.groups["ele_provider"] = 1 nodedef.groups["ele_provider"] = 1
nodedef.groups["tube"] = 1 nodedef.groups["tubedevice"] = 1
nodedef.groups["tubedevice_receiver"] = 1
nodedef.can_dig = can_dig nodedef.can_dig = can_dig

View File

@ -314,8 +314,8 @@ function ele.register_base_device(nodename, nodedef)
if pw and nodedef.groups and (nodedef.groups["tubedevice"] or nodedef.groups["tube"]) then if pw and nodedef.groups and (nodedef.groups["tubedevice"] or nodedef.groups["tube"]) then
if nodedef['tube'] == false then if nodedef['tube'] == false then
nodedef['tube'] = nil nodedef['tube'] = nil
nodedef.groups["tubedevice"] = 0 nodedef.groups["tubedevice"] = nil
nodedef.groups["tube"] = 0 nodedef.groups["tube"] = nil
elseif nodedef['tube'] then elseif nodedef['tube'] then
for key,val in pairs(tube) do for key,val in pairs(tube) do
if not nodedef['tube'][key] then if not nodedef['tube'][key] then
@ -329,6 +329,11 @@ function ele.register_base_device(nodename, nodedef)
if nodedef.groups['tubedevice_receiver'] ~= 0 and nodedef['tube'] then if nodedef.groups['tubedevice_receiver'] ~= 0 and nodedef['tube'] then
nodedef.groups.tubedevice_receiver = 1 nodedef.groups.tubedevice_receiver = 1
end end
if nodedef.groups.tube and not nodedef.groups.tubedevice then
nodedef.groups.tube = nil
nodedef.groups.tubedevice = 1
end
end end
-- Node IO Support -- Node IO Support