Crafting in inventory doesn't work sometimes #82

Closed
opened 2025-09-10 22:13:40 +00:00 by gsg_josh · 7 comments
gsg_josh commented 2025-09-10 22:13:40 +00:00 (Migrated from codeberg.org)

Check craft_table. If necessary we can replace this functionality if we have to.

What seems to be happening is that sometimes, when you try to craft something in your inventory (I'm trying to turn trees into wood) and when the crafting input boxes just reject the item entirely.

Check craft_table. If necessary we can replace this functionality if we have to. What seems to be happening is that sometimes, when you try to craft something in your inventory (I'm trying to turn trees into wood) and when the crafting input boxes just reject the item entirely.
gsg_josh commented 2025-09-10 22:14:23 +00:00 (Migrated from codeberg.org)

Restarting seems to fix it, we'll have to see if this becomes a big issue.

Restarting seems to fix it, we'll have to see if this becomes a big issue.
gsg_josh commented 2025-09-10 22:36:29 +00:00 (Migrated from codeberg.org)

this is a known issue since Dec 2021. Someone even submitted a pull request to fix it in Feb 2024 but it appears that the mod is unsupported. We can make these changes though.

this is a [known issue since Dec 2021](https://github.com/BrunoMine/craft_table/issues/2). Someone even submitted a [pull request to fix it](https://github.com/BrunoMine/craft_table/pull/5) in Feb 2024 but it appears that the mod is unsupported. We can make these changes though.
gsg_josh commented 2025-09-10 23:13:57 +00:00 (Migrated from codeberg.org)

So it happens after you craft at the table once. Let's see if we can fix it easily by overriding core.register_on_player_receive_fields()

minetest.register_on_player_receive_fields(function(player, formname, fields)
   if formname == "craft_table:craft_table" and fields.quit then
   	local meta = player:get_meta()
   	drop_craft(player, minetest.deserialize(meta:get_string("craft_table:craft_table_pos")))
   	meta:set_string("craft_table:craft_table_pos", "")
   	meta:set_string("craft_table:craft_table_grid", "2x2") -- This is new
   end
end)
So it happens after you craft at the table once. Let's see if we can fix it easily by overriding core.register_on_player_receive_fields() ``` minetest.register_on_player_receive_fields(function(player, formname, fields) if formname == "craft_table:craft_table" and fields.quit then local meta = player:get_meta() drop_craft(player, minetest.deserialize(meta:get_string("craft_table:craft_table_pos"))) meta:set_string("craft_table:craft_table_pos", "") meta:set_string("craft_table:craft_table_grid", "2x2") -- This is new end end) ```
gsg_josh commented 2025-09-10 23:18:35 +00:00 (Migrated from codeberg.org)

Nope there's more. Don't have time to chase this down but we'll see what needs to be done. If necessary we'll fork the original project.

Nope there's more. Don't have time to chase this down but we'll see what needs to be done. If necessary we'll fork the original project.
gsg_josh commented 2025-09-11 20:37:46 +00:00 (Migrated from codeberg.org)

Okay so I made a new repo to fork the mod. I'll remove the current submodule and add that submodule

Okay so I made a new repo to fork the mod. I'll remove the current submodule and add that submodule
gsg_josh commented 2025-09-11 20:55:21 +00:00 (Migrated from codeberg.org)

Alright so I've applied the fix I found in the original and it does fix the problem, but it seems to break the drop_craft() functionality. This is a pretty big problem because you just lose your stuff. We'll have to take a look at this implementation and see why this is happening.

Alright so I've applied the fix I found in the original and it does fix the problem, but it seems to break the drop_craft() functionality. This is a pretty big problem because you just lose your stuff. We'll have to take a look at this implementation and see why this is happening.
gsg_josh commented 2025-09-11 20:57:25 +00:00 (Migrated from codeberg.org)

it's the minetest.env part that I took out. If you put it back it works correctly. Not sure why the other fix includes this. But working well now.

it's the minetest.env part that I took out. If you put it back it works correctly. Not sure why the other fix includes this. But working well now.
Sign in to join this conversation.
No description provided.