-
Notifications
You must be signed in to change notification settings - Fork 28
api.md
wsor4035 edited this page Dec 14, 2021
·
1 revision
Pipeworks has an api that allows other mods to use its functionality.
Here is documented how to use the api.
Note: This may be incomplete and can change at any time.
-
pipeworks.tube_inject_item(pos, start_pos, velocity, item, owner)- Injects an item into a tube.
-
ownershould be a playername but can benil. - Returns the newly added object.
pipeworks.scan_for_tube_objects(pos)-
pipeworks.notvel(possibilities, vel)-
possibilitiesis a list of vectors. - Returns the all entries
valofpossibilitieswhereval.x ~= -vel.x or val.y ~= -vel.y or val.z ~= -vel.zin a new list.
-
pipeworks.register_tube(name, def, ...)pipeworks.after_dig(pos)pipeworks.after_place(pos)
(incomplete)
tube = {
insert_object = func(pos, node, stack, direction, owner),
can_insert = func(pos, node, stack, direction, owner),
input_inventory = "main",
return_input_invref = func(pos, node, direction, player_name),
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1},
can_remove = func(frompos, fromnode, stack, dir, frominvname, spos),
remove_items(frompos, fromnode, stack, dir, count, frominvname, spos),
}pipeworks.scan_for_pipe_objects(pos)pipeworks.spigot_check(pos, node)pipeworks.check_for_liquids(pos)pipeworks.get_axis_dir(nodetable, pattern)-
pipeworks.rotate_on_place(itemstack, placer, pointed_thing)- Can be used as
on_placefor pipe devices.
- Can be used as
pipeworks.scan_pipe_surroundings(pos)pipeworks.check_for_inflows(pos,node)pipeworks.fountainhead_check(pos,node)pipeworks.look_for_stackable_tanks(pos)pipeworks.fix_after_rotation(pos, node, user, mode, new_param2)pipeworks.check_sources = function(pos,node)
pipeworks.load_position(pos)pipeworks.vector_dot(a, b)pipeworks.may_configure(pos, player)pipeworks.facedir_to_right_dir(facedir)pipeworks.facedir_to_top_dir(facedir)pipeworks.table_contains(tbl, element)pipeworks.vector_cross(a, b)-
pipeworks.replace_name(tbl,tr,name)- never used
-
pipeworks.fix_image_names(table, replacement)- never used
pipeworks.table_recursive_replace(tbl, pattern, replace_with)pipeworks.string_startswith(str, substr)-
pipeworks.add_node_box(t, b)- never used
pipeworks.table_extend(tbl, tbl2)