minetest-mods / i3

:rocket: A next-generation inventory for Minetest 5.6+
Other
41 stars 26 forks source link

Quick Crafting not giving replacements back in latest dev version of Minetest #87

Closed falsechicken closed 1 year ago

falsechicken commented 1 year ago

Describe the bug It appears in the latest dev version of Minetest replacements are not working when quick crafting.

To Reproduce Compile latest dev version of Minetest.

Pull latest version of i3

Pull latest version of the farming mod ( tested with https://notabug.org/TenPlus1/farming/commit/28fda57767035e2c46c85098671230f06c5c637c )

Use mortar and pestle to quick craft multiple flour from wheat. Mortar and pestle are consumed when they should be returned as mortar and pestle are defined as a replacement in the flour recipe:

https://notabug.org/TenPlus1/farming/src/master/crops/wheat.lua#L80

minetest.register_craft({
    output = "farming:flour",
    recipe = {
        {"farming:wheat", "farming:wheat", "farming:wheat"},
        {"farming:wheat", "farming:mortar_pestle", ""}
    },
    replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}}
})

Screenshots screenshot_20230119_084121 screenshot_20230119_084132 screenshot_20230119_084136

Additional context I3 Version: https://github.com/minetest-mods/i3/commit/b6b97aa284d65312d12836c1971cb1767ac519df

Minetest Version: https://github.com/minetest/minetest/commit/e21d5613a6288d53edd004d8e020d69792a6d1bf

LuaJit: Enabled

OS: Ubuntu 22.04.1 LTS

kilbith commented 1 year ago

https://github.com/minetest-mods/i3/commit/889259ac5eda45e89973e6b2cecd3e7bf3066267

Please test.

falsechicken commented 1 year ago

This one is still occurring. Behavior seems the same.

EDIT: Edited the issue to reflect current information.

kilbith commented 1 year ago

https://github.com/minetest-mods/i3/commit/b6b97aa284d65312d12836c1971cb1767ac519df

Try again.

falsechicken commented 1 year ago

Unfortunately not. Still consumes the item.

EDIT: Just to make sure I was not crazy I crafted flour the standard way and it does indeed work as intended. It's only quick crafting.

kilbith commented 1 year ago

Make sure that farming:mortar_pestle has the group food_mortar_pestle in its definition.

Anyway I'm not too bothered to fix this.

Try to increase this variable (2, 3, 4, etc.) and see what it does: https://github.com/minetest-mods/i3/blob/d55994c535d2226f40a5616150c87ec55b44e882/src/caches.lua#L181

kilbith commented 1 year ago

Try this commit: https://github.com/minetest-mods/i3/commit/3b1d5691187d60306f1e390f239cce5efc813d00

falsechicken commented 1 year ago

That seemed to do it! Thanks!