2019-03-08 00:00:09 +01:00
|
|
|
|
local S = minetest.get_translator("mcl_crafting_table")
|
|
|
|
|
|
2017-06-03 02:09:56 +02:00
|
|
|
|
minetest.register_node("mcl_crafting_table:crafting_table", {
|
2019-03-08 00:00:09 +01:00
|
|
|
|
description = S("Crafting Table"),
|
2020-02-19 04:54:17 +01:00
|
|
|
|
_tt_help = S("Gives access to 3×3 crafting grid"),
|
2019-03-08 00:00:09 +01:00
|
|
|
|
_doc_items_longdesc = S("A crafting table is a block which grants you access to a 3×3 crafting grid which allows you to perform advanced crafts."),
|
|
|
|
|
_doc_items_usagehelp = S("Rightclick the crafting table to access the 3×3 crafting grid."),
|
2017-06-03 02:09:56 +02:00
|
|
|
|
_doc_items_hidden = false,
|
|
|
|
|
is_ground_content = false,
|
|
|
|
|
tiles = {"crafting_workbench_top.png", "default_wood.png", "crafting_workbench_side.png",
|
|
|
|
|
"crafting_workbench_side.png", "crafting_workbench_front.png", "crafting_workbench_front.png"},
|
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
|
groups = {handy=1,axey=1, deco_block=1, material_wood=1},
|
|
|
|
|
on_rightclick = function(pos, node, player, itemstack)
|
|
|
|
|
player:get_inventory():set_width("craft", 3)
|
|
|
|
|
player:get_inventory():set_size("craft", 9)
|
|
|
|
|
|
|
|
|
|
local form = "size[9,8.75]"..
|
|
|
|
|
"background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png^crafting_inventory_workbench.png]"..
|
2019-03-07 12:42:08 +01:00
|
|
|
|
mcl_vars.inventory_header..
|
2019-03-16 05:21:27 +01:00
|
|
|
|
"label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
2017-06-03 02:09:56 +02:00
|
|
|
|
"list[current_player;main;0,4.5;9,3;9]"..
|
|
|
|
|
"list[current_player;main;0,7.74;9,1;]"..
|
2019-03-16 05:21:27 +01:00
|
|
|
|
"label[1.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Crafting"))).."]"..
|
2017-06-03 02:09:56 +02:00
|
|
|
|
"list[current_player;craft;1.75,0.5;3,3;]"..
|
|
|
|
|
"list[current_player;craftpreview;6.1,1.5;1,1;]"..
|
2017-06-08 20:59:34 +02:00
|
|
|
|
"image_button[0.75,1.5;1,1;craftguide_book.png;__mcl_craftguide;]"..
|
2019-03-16 03:18:16 +01:00
|
|
|
|
"tooltip[__mcl_craftguide;"..minetest.formspec_escape(S("Recipe book")).."]"..
|
2017-06-03 02:09:56 +02:00
|
|
|
|
"listring[current_player;main]"..
|
|
|
|
|
"listring[current_player;craft]"
|
|
|
|
|
|
|
|
|
|
minetest.show_formspec(player:get_player_name(), "main", form)
|
|
|
|
|
end,
|
|
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
|
|
|
|
_mcl_blast_resistance = 12.5,
|
|
|
|
|
_mcl_hardness = 2.5,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
|
output = "mcl_crafting_table:crafting_table",
|
|
|
|
|
recipe = {
|
|
|
|
|
{"group:wood", "group:wood"},
|
|
|
|
|
{"group:wood", "group:wood"}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
|
type = "fuel",
|
|
|
|
|
recipe = "mcl_crafting_table:crafting_table",
|
|
|
|
|
burntime = 15,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
minetest.register_alias("crafting:workbench", "mcl_crafting_table:crafting_table")
|
|
|
|
|
minetest.register_alias("mcl_inventory:workbench", "mcl_crafting_table:crafting_table")
|