[Mod] Craft Table [v1.0.0][craft_table]

Post Reply
User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

[Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Post

Image
Description:
Add a craft table with a 3x3 grid and modify the inventory craft grid to 2x2.

Recipes:
Image
*Any wood type can be used

Requirements:
  • Minetest 5.1.0 (or later)
  • default mod
Supported mods:
  • sfinv
  • xdecor
License of code: LGPL 3.0

License of textures and sounds: CC BY-SA 3.0 and WTFPL
Thanks for BlockMen by craft table textures

Download: craft_table-master.ZIP

Links:
Attachments
recipe craft table.png
recipe craft table.png (13.56 KiB) Viewed 2066 times
screenshot.png
screenshot.png (109.54 KiB) Viewed 2066 times

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Craft Table [v1.0.0][craft_table]

by Miniontoby » Post

That makes Minetest more like Minecraft. Cool mod
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Post

Good ideas should be taken advantage of.
Minetest really is the game more similar to Minecraft than GTAV.

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Craft Table [v1.0.0][craft_table]

by Miniontoby » Post

Please put it on content.minetest.net for more simple downloading
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Post

Miniontoby wrote:Please put it on content.minetest.net for more simple downloading
Working on it. I am awaiting approval.

Martno
Member
Posts: 80
Joined: Thu May 28, 2015 07:09
Location: Hungary

Re: [Mod] Craft Table [v1.0.0][craft_table]

by Martno » Post

Hello
This mod is not working for me. I can't put anything on the 2x2 grid. Everything is going back to my inventory instantly. I use Minetest 5.1.

Astrobe
Member
Posts: 570
Joined: Sun Apr 01, 2018 10:46

Re: [Mod] Craft Table [v1.0.0][craft_table]

by Astrobe » Post

I confirm there is an issue with the 2x2 in 5.1, using sfinv.

FWIW, I disabled it entirely. It allows to make a craft table on the spot, which kind of defeats its purpose. In the same "hard mode survival" spirit, one could consider making the crafting recipe of the table optional too. The game designer can come up with ways for the players to get them (quests, NPC trade, dungeon loot, ...).

I guess it is difficult to deal with the bazillion of inventory mods in this context. It is not clear to me what register_craft_predict() does, but it seems it could be used to prevent crafting (that would avoid touching existing formspecs). I could try it myself, but I am not familiar with formspecs and inventories, so I am afraid of missing some corner case even if it is appears to work.

Also, is there a reason why the inventory of the table is dropped when one closes the formspec? I was expecting a behavior similar to furnaces and chests (one cannot remove the node if it is not "empty").

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Post

Are you sure you are not using other mods? And is you using the stable version of 5.1?

Astrobe
Member
Posts: 570
Joined: Sun Apr 01, 2018 10:46

Re: [Mod] Craft Table [v1.0.0][craft_table]

by Astrobe » Post

BrunoMine wrote:Are you sure you are not using other mods? And is you using the stable version of 5.1?
I would say that I use fewer mods than average; I have also modified most of them, so I know them pretty well generally speaking. I do use 5.1 stable.

User avatar
bhree
Member
Posts: 169
Joined: Tue Jun 19, 2018 07:45
GitHub: bhree
IRC: bhree
In-game: bhree
Location: Alone In The Wild Land
Contact:

Re: [Mod] Craft Table [v1.0.0][craft_table]

by bhree » Post

Code: Select all

-- Clear metadata when exit from craft table formspec
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") --maybe should add this line to return to 2x2 mode after finishing accessing the table
	end
end)

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Post

Astrobe wrote: Also, is there a reason why the inventory of the table is dropped when one closes the formspec? I was expecting a behavior similar to furnaces and chests (one cannot remove the node if it is not "empty").
Well, technically the items are on the table, just take them back. XD

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Post

Martno wrote:Everything is going back to my inventory instantly. I use Minetest 5.1.
I tested it and this is not happening to me. Can you explain to me exactly what you did, what mods and etc.

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Post

bhree wrote:

Code: Select all

-- Clear metadata when exit from craft table formspec
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") --maybe should add this line to return to 2x2 mode after finishing accessing the table
	end
end)
I could do that, but is is not the safest way to return the inventory 2x2 because it can be changed by another mod, that is, I must always define this the moment the inventory is accessed.

Astrobe
Member
Posts: 570
Joined: Sun Apr 01, 2018 10:46

Re: [Mod] Craft Table [v1.0.0][craft_table]

by Astrobe » Post

BrunoMine wrote:
Astrobe wrote: Also, is there a reason why the inventory of the table is dropped when one closes the formspec? I was expecting a behavior similar to furnaces and chests (one cannot remove the node if it is not "empty").
Well, technically the items are on the table, just take them back. XD
Sure but is there a technical reason why they are "popped"? I figured out after some use that this behavior is probably intended to prevent players from forgetting something there, but OTOH when you realize you miss an ingredient in the middle of a craft that you have to fetch from some chest, you have to restart from scratch.

For my game I don't mind the former but the latter is a bit annoying. I also believe that items could vanish if a player is disconnected and cannot come back in time. So if you tell me there is no corner case that forced the implementation of that behavior, I can try to change it.

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Post

if you allow items to stay on the bench (like a chest) allow other players to pick up your items while you use them. furthermore i don't know how to code this, since the crafting grid is an player attribute (and not a node attribute). maybe there is a way but it doesn't seem viable.

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests