1
0
mirror of https://github.com/mt-mods/pipeworks.git synced 2025-07-25 03:30:16 +02:00
Commit Graph

89 Commits

Author SHA1 Message Date
efe6d34190 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)
2023-06-21 23:28:51 +02:00
c8b478d3c3 use minetest.get_item_group() 2023-06-21 23:26:37 +02:00
2d8ddc083e remove unused line 2023-06-15 04:13:29 +02:00
929768a12a 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.
2023-06-15 03:57:12 +02:00
c1792bbc1b add warning to ensure double-check was not needed 2023-06-15 03:56:55 +02:00
061c17ce51 remove double-check of available materials 2023-06-15 03:56:48 +02:00
a8570f6071 use has_room_for_output 2023-06-15 03:56:35 +02:00
2638d41d48 add function has_room_for_output
moving the output space calculation into its own function
helps keep autocraft() short and overseeable
2023-06-15 03:56:27 +02:00
7c210a5841 bugfix: when item has no groups
"" and unknown items have no def and thus no groups
2023-06-15 03:56:16 +02:00
978b5c723e new craft format: decremented_input
craft.decremented_input now only holds the items. Extra parameters are
dropped
2023-06-15 03:56:05 +02:00
1aaeb9e287 use get_matching_craft to get best craft
this line was buggy anyhow
2023-06-15 03:55:49 +02:00
149491a06b indentation adjusting 2023-06-15 03:55:40 +02:00
001cd5824b return right away if there is a chached craft
gives us more horizontal space to work with
2023-06-15 03:55:29 +02:00
d05c21700d 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
2023-06-15 03:55:13 +02:00
eb36ea30dc reuse hash that is asigned to variable anyway 2023-06-15 02:47:51 +02:00
9be6239ec5 only whitespace changes 2023-06-15 02:46:11 +02:00
2f70be2d90 reorder and change back var name 2023-06-14 16:03:00 +02:00
df79b74f2f Merge branch 'fix-autocrafter-replacements' into autocraftergroups 2023-06-14 15:58:42 +02:00
d8a364e731 remove unnecessary check and move some code 2023-06-13 22:07:53 +10:00
caa33e6375 fix autocrafter replacements 2023-06-13 16:27:23 +10:00
855937aec3 make all nodes diggable in mcl* survival mode 2022-12-02 15:54:21 -05:00
e3d94cb3a8 fix digiline formspec spacing (#27) 2022-05-07 17:04:06 -04:00
37eef73695 add I3 support + update to formspecs v2 (#22)
* add fs helper inv function

* add fs helper prepends function

* add trash can, vacuum tube, teleport tube. wielders, autocrafter, mesetube, injectors

* fixed missed texture to make game agnostic

* fix luacheck
2022-04-16 14:51:59 -04:00
5aa0501872 make pipeworks Game agnostic (#16)
* make it boot in non mtg

* make water flow

* fix water texture warnings

* fix missing steel texture issues

* remove depreciated/unnessary default function calls

* make sounds work

* fix default formspec crashes

* fix wierd tab spacing

* additionally game dig group support

* move crafts to crafts.lua

* make crafts support various games
2022-03-14 21:39:58 -04:00
7d3a61e595 Fix toggling of autocrafter when digilines is not installed (#5)
Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
2021-12-26 17:12:15 +11:00
60673db480 Add support for recipes with groups to autocrafter 2021-08-25 18:59:51 +01:00
7ba685344c fix autocrafter 2021-05-29 17:37:10 +10:00
29bac67d3a Skip protection check on formspec close
Prevents protector flip/player being hurt/protection violation if the
player closes the formspec without attempting any changes (sorting tube
and autocrafter).
2021-05-06 18:02:19 +02:00
fc6efb450c add support for Unified Inventory categories 2021-04-02 15:48:28 -04:00
17a602a5a1 Remove unused loop variables, trailing whitespace and fix mixed-whitespace indentations 2021-02-05 17:17:50 +01:00
b2d2ccbcba Remove or comment unused code and declare some variables local 2021-02-03 18:08:50 +01:00
505fc7cc49 Add "get_recipe" digiline command for querying the current autocrafter recipe.
Useful for having the player teach the luacontroller how to craft various items.
2020-07-23 01:49:37 +02:00
62bc13078f Add translation support
- Created `locale/template.txt`
- Fixed some typos
- Replace some `print("[pipeworks]"..` with `pipeworks.logger()`
- Removed "You hacker, you" from descriptions
2020-02-18 17:34:52 +00:00
f37b21e632 fix autocrafter recipe 2018-11-15 03:51:56 +03:00
d7dfd11364 use basic_materials mod where possible 2018-10-30 20:45:48 -04:00
acc2b6802e fix scale on autocrafter's on/off switch 2017-04-12 07:09:35 -04:00
c15023a5d1 Tweak listring behavior of autocrafter
Now goes player->source->player and destination->player
2017-03-28 18:02:10 -05:00
1a15a8b453 Add digilines support to autocrafter
"on" and "off" messages turn it on or off, "single" crafts one item, and sending nested tables in the shape of the crafting grid sets the craft. Example message:
{
{"default:wood","default:wood","default:wood"},
{"default:wood","","default:wood"},
{"default:wood","default:wood","default:wood"}
}
2017-02-26 15:35:51 -06:00
Tim
4fdf73fbcd add list rings to pipework inventories 2016-08-29 18:28:43 +02:00
b1b9a7e994 Don't use item_drop(, nil,) 2016-04-01 22:20:07 -07:00
6de437b83d fix 2 other minetest.item_drops 2015-11-18 10:07:00 +01:00
Tim
d167aacf4d add ownership/protection handling for device configuration
take any available ownership into account before deciding on area protection
2015-03-11 19:36:41 +01:00
Tim
13e878398c revert accidental revert (810ae99 -- autocrafter.lua) of f79956c 2015-02-02 03:16:15 +01:00
Tim
810ae99008 reduce texturename repetition via __index 2015-01-31 14:47:06 +01:00
Tim
f79956c0b6 improve handling of shapeless recipes in the autocrafter recipe filling function 2015-01-30 21:09:43 +01:00
Tim
fcba05fd78 move autocrafter, tp-tube and filter-injector crafts to their respective code files 2015-01-29 20:31:08 +01:00
Tim
373c7951d2 add sanity check for upgrade cases of autocrafters with broken metadata (especially for can_dig) 2015-01-29 17:06:09 +01:00
Tim
73b3466a7b improve autocrafter infotext handling
use the item description and provide more information in paused states
2015-01-29 17:06:09 +01:00
Tim
3bcf3b5f2f use on_destruct instead of after_dig_node to clean up the cache entry to avoid any leaking during worldediting 2015-01-28 21:47:50 +01:00
Tim
b009e46590 call after_recipe_change also when moving the output item to src or dst to stop the crafter as expected 2015-01-28 21:45:43 +01:00