Fork pipeworks is a mod for Minetest allowing the crafting and usage of pipes and tubes
Go to file
Luke aka SwissalpS 360ed9bdde
Autocrafter groups support (#74)
* Add support for recipes with groups to autocrafter

* fix autocrafter replacements

* remove unnecessary check and move some code

* reorder and change back var name

* only whitespace changes

* reuse hash that is asigned to variable anyway

* add get_matching_craft

function that looks for the best matching recipe according to what user
put in recipe inventory

some crafts use groups in multiple recipes

* return right away if there is a chached craft

gives us more horizontal space to work with

* indentation adjusting

* use get_matching_craft to get best craft

this line was buggy anyhow

* new craft format: decremented_input

craft.decremented_input now only holds the items. Extra parameters are
dropped

* bugfix: when item has no groups

"" and unknown items have no def and thus no groups

* add function has_room_for_output

moving the output space calculation into its own function
helps keep autocraft() short and overseeable

* use has_room_for_output

* remove double-check of available materials

* add warning to ensure double-check was not needed

* rebuild cache whenever recipe inv changes

no need to check if still current, this only happens when user is
interacting and can only be better to do so.
Otherwise we would have to check groups etc. again just to check, so
might as well reset cache.

* remove unused line

* use minetest.get_item_group()

* whitespace cleanup

make code easier to read and give it a more
"thoughtthrough" look than the "smash it in to make it work" look it has
had.

(I'm holding back, there would be more to do overall through this mod)

* add .editorconfig

this should also help keep consistency throughout this mod

* changelog updated

at least the most recent more important ones

* whitespace changelog (trailing spaces)

---------

Co-authored-by: rubenwardy <rw@rubenwardy.com>
Co-authored-by: OgelGames <olliverdc28@gmail.com>
Co-authored-by: wsor4035 <24964441+wsor4035@users.noreply.github.com>
2024-01-13 20:41:28 -05:00
.github/workflows code and registrations cleanup (#101) 2024-01-13 20:40:01 -05:00
locale Improve formspecs for better mobile usability and consistency 2021-04-02 19:47:48 +00:00
models fix some broken models 2018-02-13 13:42:24 -05:00
pressure_logic replace global_exists with get_modpath 2023-11-21 14:35:51 +11:00
textures use basic_materials mod where possible 2018-10-30 20:45:48 -04:00
todo todo: remove item for directionality code 2017-10-19 13:43:11 +01:00
tubes code and registrations cleanup (#101) 2024-01-13 20:40:01 -05:00
.editorconfig Autocrafter groups support (#74) 2024-01-13 20:41:28 -05:00
.gitignore update .gitignore 2016-08-29 18:25:40 +02:00
.luacheckrc MineClone containers support (#81) 2023-09-02 15:17:14 -04:00
autocrafter.lua Autocrafter groups support (#74) 2024-01-13 20:41:28 -05:00
autodetect-finite-water.lua add finite water feature toggle and auto-detect code 2017-10-03 20:53:49 +01:00
autoplace_pipes.lua added straight-only pipe 2017-11-03 23:02:36 -04:00
autoplace_tubes.lua Remove unused loop variables, trailing whitespace and fix mixed-whitespace indentations 2021-02-05 17:17:50 +01:00
changelog.txt Autocrafter groups support (#74) 2024-01-13 20:41:28 -05:00
common.lua code and registrations cleanup (#101) 2024-01-13 20:40:01 -05:00
compat-chests.lua Better Hades Revisited support (#30) 2022-05-12 22:52:17 -04:00
compat-furnaces.lua prevent tubes from connecting to the front of furnaces to match chests 2022-08-13 23:59:46 -04:00
crafts.lua code and registrations cleanup (#101) 2024-01-13 20:40:01 -05:00
default_settings.lua Add configurable globalstep interval (#32) 2022-05-24 19:13:41 -04:00
devices.lua Mineclone dig times balanced (#84) 2023-09-01 15:00:50 +02:00
filter-injector.lua Mineclone dig times balanced (#84) 2023-09-01 15:00:50 +02:00
flowing_logic.lua make pipeworks Game agnostic (#16) 2022-03-14 21:39:58 -04:00
init.lua code and registrations cleanup (#101) 2024-01-13 20:40:01 -05:00
item_transport.lua Return early from on_step (#33) 2022-05-15 10:58:35 -04:00
legacy.lua Mineclone dig times balanced (#84) 2023-09-01 15:00:50 +02:00
LICENSE license fixups: update to LGPL3.0 for code, add CC-by-SA 4.0 for media 2018-11-08 18:22:12 -05:00
luaentity.lua Fix crash if add_entity fails (#88) 2023-09-16 18:19:03 +02:00
materials.lua code and registrations cleanup (#101) 2024-01-13 20:40:01 -05:00
mcl_barrels.lua MineClone containers support (#81) 2023-09-02 15:17:14 -04:00
mcl_furnaces.lua MineClone smoker and blast furnace support (#85) 2023-09-06 15:33:41 +02:00
mod.conf bump min_minetest_version to 5.5.0 for vector.zero() 2024-01-05 16:11:23 +11:00
models.lua Add lua controlled tube (#199) 2017-09-25 23:21:15 -04:00
pipes.lua Mineclone dig times balanced (#84) 2023-09-01 15:00:50 +02:00
README typo fix 2022-08-16 00:30:42 +02:00
screenshot.png Add screenshot.png 2016-03-27 22:31:33 -07:00
settingtypes.txt log when items teleport through tubes (#66) 2023-05-18 19:49:12 +02:00
signs_compat.lua add signs_lib placement rules 2019-09-23 15:41:56 -04:00
trashcan.lua Mineclone dig times balanced (#84) 2023-09-01 15:00:50 +02:00
wielder.lua Mineclone dig times balanced (#84) 2023-09-01 15:00:50 +02:00

This mod uses nodeboxes to supply a complete set of 3D pipes and tubes, 
along devices that work with them.

See https://github.com/mt-mods/pipeworks/wiki/ for detailed information about usage of this mod.

Unlike the previous version of this mod, these pipes are rounded, and when 
placed, they'll automatically join together as needed.  Pipes can go vertically 
or horizontally, and there are enough nodes defined to allow for all possible 
connections.  Valves and pumps can only be placed horizontally, and will 
automatically rotate and join with neighboring pipes as objects are added, as 
well as joining with each other under certain circumstances.

Pipes come in two variants: one type bears one or more dark windows on each 
pipe, suggesting they're empty, while the other type bears green-tinted 
windows, as if full (the two colors should also be easy to select if you want 
to change them in a paint program).  These windows only appear on straight 
lengths and on certain junctions.

This mod is a work in progress.

Please note that owing to the nature of this mod, I have opted to use 64px 
textures.  Anything less just looks terrible.

The teleport tube database used to be kept in a file named 'teleport_tubes'.
The database is now kept in mod storage. The migration from 'teleport_tubes' is
automatic. The old file is then kept around but is not used at all.