group_number="all"-- special value to indicate no number was provided
end
localgroup_info=hopper.groups[group_identifier]
ifgroup_info==nilthen
group_info={}
end
ifgroup_info[group_number]==nilthen
group_info[group_number]={}
end
group_info[group_number][entry[1]]=entry[3]
hopper.groups[group_identifier]=group_info
neighbor_node="group:"..group_identifier
-- result is a table of the form groups[group_identifier][group_number][relative_position][inventory_name]
else
localnode_info=hopper.containers[target_node]
ifnode_info==nilthen
node_info={}
end
node_info[entry[1]]=entry[3]
hopper.containers[target_node]=node_info
neighbor_node=target_node
-- result is a table of the form containers[target_node_name][relative_position][inventory_name]
end
localalready_in_neighbors=false
for_,valueinpairs(hopper.neighbors)do
ifvalue==neighbor_nodethen
already_in_neighbors=true
break
end
end
ifnotalready_in_neighborsthen
table.insert(hopper.neighbors,neighbor_node)
end
end
end
-- "top" indicates what inventory the hopper will take items from if this node is located at the hopper's wide end
-- "side" indicates what inventory the hopper will put items into if this node is located at the hopper's narrow end and at the same height as the hopper
-- "bottom" indicates what inventory the hopper will put items into if this node is located at the hopper's narrow end and either above or below the hopper.