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
2018-02-13 13:42:24 -05:00
2024-01-13 20:41:28 -05:00
2016-08-29 18:25:40 +02:00
2023-09-02 15:17:14 -04:00
2017-11-03 23:02:36 -04:00
2024-01-13 20:41:28 -05:00
2023-09-01 15:00:50 +02:00
2024-01-13 20:40:01 -05:00
2023-09-01 15:00:50 +02:00
2017-09-25 23:21:15 -04:00
2023-09-01 15:00:50 +02:00
2022-08-16 00:30:42 +02:00
2016-03-27 22:31:33 -07:00
2019-09-23 15:41:56 -04:00
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.
Description
Fork pipeworks is a mod for Minetest allowing the crafting and usage of pipes and tubes
Readme 11 MiB
Languages
Lua 100%