1
0
Fork 0

Furnaces formspec redo

This commit is contained in:
AFCMS 2022-09-18 16:56:26 +02:00
parent 5011e12209
commit 7c15fe6ac9
Signed by untrusted user: AFCMS
GPG Key ID: 8720389A25B652E3
3 changed files with 309 additions and 217 deletions

View File

@ -1,5 +1,6 @@
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
local C = minetest.colorize
local F = minetest.formspec_escape
local LIGHT_ACTIVE_FURNACE = 13 local LIGHT_ACTIVE_FURNACE = 13
@ -8,60 +9,82 @@ local LIGHT_ACTIVE_FURNACE = 13
-- --
local function active_formspec(fuel_percent, item_percent) local function active_formspec(fuel_percent, item_percent)
return "size[9,8.75]".. return table.concat({
"label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "formspec_version[4]",
"list[current_player;main;0,4.5;9,3;9]".. "size[11.75,10.425]",
mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "label[0.375,0.375;" .. F(C(mcl_formspec.label_color, S("Blast Furnace"))) .. "]",
"list[current_player;main;0,7.74;9,1;]".. mcl_formspec.get_itemslot_bg_v4(3.5, 0.75, 1, 1),
mcl_formspec.get_itemslot_bg(0,7.74,9,1).. "list[context;src;3.5,0.75;1,1;]",
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Blast Furnace"))).."]"..
"list[context;src;2.75,0.5;1,1;]".. "image[3.5,2;1,1;default_furnace_fire_bg.png^[lowpart:" ..
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1).. (100 - fuel_percent) .. ":default_furnace_fire_fg.png]",
"list[context;fuel;2.75,2.5;1,1;]"..
mcl_formspec.get_itemslot_bg(2.75,2.5,1,1).. mcl_formspec.get_itemslot_bg_v4(3.5, 3.25, 1, 1),
"list[context;dst;5.75,1.5;1,1;]".. "list[context;fuel;3.5,3.25;1,1;]",
mcl_formspec.get_itemslot_bg(5.75,1.5,1,1)..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. "image[5.25,2;1.5,1;gui_furnace_arrow_bg.png^[lowpart:" ..
(100-fuel_percent)..":default_furnace_fire_fg.png]".. (item_percent) .. ":gui_furnace_arrow_fg.png^[transformR270]",
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[lowpart:".. mcl_formspec.get_itemslot_bg_v4(7.875, 2, 1, 1, 0.2),
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. "list[context;dst;7.875,2;1,1;]",
"label[0.375,4.7;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
"list[current_player;main;0.375,5.1;9,3;9]",
mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"list[current_player;main;0.375,9.05;9,1;]",
-- Craft guide button temporarily removed due to Minetest bug. -- Craft guide button temporarily removed due to Minetest bug.
-- TODO: Add it back when the Minetest bug is fixed. -- TODO: Add it back when the Minetest bug is fixed.
--"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. --"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
--"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]"..
"listring[context;dst]"..
"listring[current_player;main]".. "listring[context;dst]",
"listring[context;src]".. "listring[current_player;main]",
"listring[current_player;main]".. "listring[context;src]",
"listring[context;fuel]".. "listring[current_player;main]",
"listring[current_player;main]" "listring[context;fuel]",
"listring[current_player;main]",
})
end end
local inactive_formspec = "size[9,8.75]".. local inactive_formspec = table.concat({
"label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "formspec_version[4]",
"list[current_player;main;0,4.5;9,3;9]".. "size[11.75,10.425]",
mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "label[0.375,0.375;" .. F(C(mcl_formspec.label_color, S("Blast Furnace"))) .. "]",
"list[current_player;main;0,7.74;9,1;]".. mcl_formspec.get_itemslot_bg_v4(3.5, 0.75, 1, 1),
mcl_formspec.get_itemslot_bg(0,7.74,9,1).. "list[context;src;3.5,0.75;1,1;]",
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Blast Furnace"))).."]"..
"list[context;src;2.75,0.5;1,1;]".. "image[3.5,2;1,1;default_furnace_fire_bg.png]",
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1)..
"list[context;fuel;2.75,2.5;1,1;]".. mcl_formspec.get_itemslot_bg_v4(3.5, 3.25, 1, 1),
mcl_formspec.get_itemslot_bg(2.75,2.5,1,1).. "list[context;fuel;3.5,3.25;1,1;]",
"list[context;dst;5.75,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.75,1.5,1,1).. "image[5.25,2;1.5,1;gui_furnace_arrow_bg.png^[transformR270]",
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]".. mcl_formspec.get_itemslot_bg_v4(7.875, 2, 1, 1, 0.2),
"list[context;dst;7.875,2;1,1;]",
"label[0.375,4.7;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
"list[current_player;main;0.375,5.1;9,3;9]",
mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"list[current_player;main;0.375,9.05;9,1;]",
-- Craft guide button temporarily removed due to Minetest bug. -- Craft guide button temporarily removed due to Minetest bug.
-- TODO: Add it back when the Minetest bug is fixed. -- TODO: Add it back when the Minetest bug is fixed.
--"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. --"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
--"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]"..
"listring[context;dst]"..
"listring[current_player;main]".. "listring[context;dst]",
"listring[context;src]".. "listring[current_player;main]",
"listring[current_player;main]".. "listring[context;src]",
"listring[context;fuel]".. "listring[current_player;main]",
"listring[current_player;main]" "listring[context;fuel]",
"listring[current_player;main]",
})
local receive_fields = function(pos, formname, fields, sender) local receive_fields = function(pos, formname, fields, sender)
if fields.craftguide then if fields.craftguide then
@ -415,7 +438,8 @@ end
minetest.register_node("mcl_blast_furnace:blast_furnace", { minetest.register_node("mcl_blast_furnace:blast_furnace", {
description = S("Blast Furnace"), description = S("Blast Furnace"),
_tt_help = S("Smelts ores faster than furnace"), _tt_help = S("Smelts ores faster than furnace"),
_doc_items_longdesc = S("Blast Furnaces smelt several items, mainly ores and armor, using a furnace fuel, but twice as fast as a normal furnace."), _doc_items_longdesc = S(
"Blast Furnaces smelt several items, mainly ores and armor, using a furnace fuel, but twice as fast as a normal furnace."),
_doc_items_usagehelp = _doc_items_usagehelp =
S("Use the blast furnace to open the furnace menu.") .. "\n" .. S("Use the blast furnace to open the furnace menu.") .. "\n" ..
S("Place a furnace fuel in the lower slot and the source material in the upper slot.") .. "\n" .. S("Place a furnace fuel in the lower slot and the source material in the upper slot.") .. "\n" ..
@ -442,7 +466,11 @@ minetest.register_node("mcl_blast_furnace:blast_furnace", {
for _, listname in ipairs({ "src", "dst", "fuel" }) do for _, listname in ipairs({ "src", "dst", "fuel" }) do
local stack = inv:get_stack(listname, 1) local stack = inv:get_stack(listname, 1)
if not stack:is_empty() then if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} local p = {
x = pos.x + math.random(0, 10) / 10 - 0.5,
y = pos.y,
z = pos.z + math.random(0, 10) / 10 - 0.5
}
minetest.add_item(p, stack) minetest.add_item(p, stack)
end end
end end
@ -499,8 +527,10 @@ minetest.register_node("mcl_blast_furnace:blast_furnace_active", {
tiles = { tiles = {
"blast_furnace_top.png", "blast_furnace_top.png", "blast_furnace_top.png", "blast_furnace_top.png",
"blast_furnace_side.png", "blast_furnace_side.png", "blast_furnace_side.png", "blast_furnace_side.png",
"blast_furnace_side.png", {name = "blast_furnace_front_on.png", "blast_furnace_side.png", {
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 48}}, name = "blast_furnace_front_on.png",
animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 48 }
},
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
paramtype = "light", paramtype = "light",
@ -519,7 +549,11 @@ minetest.register_node("mcl_blast_furnace:blast_furnace_active", {
for _, listname in ipairs({ "src", "dst", "fuel" }) do for _, listname in ipairs({ "src", "dst", "fuel" }) do
local stack = inv:get_stack(listname, 1) local stack = inv:get_stack(listname, 1)
if not stack:is_empty() then if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} local p = {
x = pos.x + math.random(0, 10) / 10 - 0.5,
y = pos.y,
z = pos.z + math.random(0, 10) / 10 - 0.5
}
minetest.add_item(p, stack) minetest.add_item(p, stack)
end end
end end
@ -570,4 +604,3 @@ minetest.register_lbm({
spawn_flames(pos, node.param2) spawn_flames(pos, node.param2)
end, end,
}) })

View File

@ -1,5 +1,6 @@
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
local C = minetest.colorize
local F = minetest.formspec_escape
local LIGHT_ACTIVE_FURNACE = 13 local LIGHT_ACTIVE_FURNACE = 13
@ -8,60 +9,82 @@ local LIGHT_ACTIVE_FURNACE = 13
-- --
local function active_formspec(fuel_percent, item_percent) local function active_formspec(fuel_percent, item_percent)
return "size[9,8.75]".. return table.concat({
"label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "formspec_version[4]",
"list[current_player;main;0,4.5;9,3;9]".. "size[11.75,10.425]",
mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "label[0.375,0.375;" .. F(C(mcl_formspec.label_color, S("Furnace"))) .. "]",
"list[current_player;main;0,7.74;9,1;]".. mcl_formspec.get_itemslot_bg_v4(3.5, 0.75, 1, 1),
mcl_formspec.get_itemslot_bg(0,7.74,9,1).. "list[context;src;3.5,0.75;1,1;]",
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]"..
"list[context;src;2.75,0.5;1,1;]".. "image[3.5,2;1,1;default_furnace_fire_bg.png^[lowpart:" ..
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1).. (100 - fuel_percent) .. ":default_furnace_fire_fg.png]",
"list[context;fuel;2.75,2.5;1,1;]"..
mcl_formspec.get_itemslot_bg(2.75,2.5,1,1).. mcl_formspec.get_itemslot_bg_v4(3.5, 3.25, 1, 1),
"list[context;dst;5.75,1.5;1,1;]".. "list[context;fuel;3.5,3.25;1,1;]",
mcl_formspec.get_itemslot_bg(5.75,1.5,1,1)..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. "image[5.25,2;1.5,1;gui_furnace_arrow_bg.png^[lowpart:" ..
(100-fuel_percent)..":default_furnace_fire_fg.png]".. (item_percent) .. ":gui_furnace_arrow_fg.png^[transformR270]",
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[lowpart:".. mcl_formspec.get_itemslot_bg_v4(7.875, 2, 1, 1, 0.2),
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. "list[context;dst;7.875,2;1,1;]",
"label[0.375,4.7;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
"list[current_player;main;0.375,5.1;9,3;9]",
mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"list[current_player;main;0.375,9.05;9,1;]",
-- Craft guide button temporarily removed due to Minetest bug. -- Craft guide button temporarily removed due to Minetest bug.
-- TODO: Add it back when the Minetest bug is fixed. -- TODO: Add it back when the Minetest bug is fixed.
--"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. --"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
--"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]"..
"listring[context;dst]"..
"listring[current_player;main]".. "listring[context;dst]",
"listring[context;src]".. "listring[current_player;main]",
"listring[current_player;main]".. "listring[context;src]",
"listring[context;fuel]".. "listring[current_player;main]",
"listring[current_player;main]" "listring[context;fuel]",
"listring[current_player;main]",
})
end end
local inactive_formspec = "size[9,8.75]".. local inactive_formspec = table.concat({
"label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "formspec_version[4]",
"list[current_player;main;0,4.5;9,3;9]".. "size[11.75,10.425]",
mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "label[0.375,0.375;" .. F(C(mcl_formspec.label_color, S("Furnace"))) .. "]",
"list[current_player;main;0,7.74;9,1;]".. mcl_formspec.get_itemslot_bg_v4(3.5, 0.75, 1, 1),
mcl_formspec.get_itemslot_bg(0,7.74,9,1).. "list[context;src;3.5,0.75;1,1;]",
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]"..
"list[context;src;2.75,0.5;1,1;]".. "image[3.5,2;1,1;default_furnace_fire_bg.png]",
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1)..
"list[context;fuel;2.75,2.5;1,1;]".. mcl_formspec.get_itemslot_bg_v4(3.5, 3.25, 1, 1),
mcl_formspec.get_itemslot_bg(2.75,2.5,1,1).. "list[context;fuel;3.5,3.25;1,1;]",
"list[context;dst;5.75,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.75,1.5,1,1).. "image[5.25,2;1.5,1;gui_furnace_arrow_bg.png^[transformR270]",
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]".. mcl_formspec.get_itemslot_bg_v4(7.875, 2, 1, 1, 0.2),
"list[context;dst;7.875,2;1,1;]",
"label[0.375,4.7;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
"list[current_player;main;0.375,5.1;9,3;9]",
mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"list[current_player;main;0.375,9.05;9,1;]",
-- Craft guide button temporarily removed due to Minetest bug. -- Craft guide button temporarily removed due to Minetest bug.
-- TODO: Add it back when the Minetest bug is fixed. -- TODO: Add it back when the Minetest bug is fixed.
--"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. --"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
--"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]"..
"listring[context;dst]"..
"listring[current_player;main]".. "listring[context;dst]",
"listring[context;src]".. "listring[current_player;main]",
"listring[current_player;main]".. "listring[context;src]",
"listring[context;fuel]".. "listring[current_player;main]",
"listring[current_player;main]" "listring[context;fuel]",
"listring[current_player;main]",
})
local receive_fields = function(pos, formname, fields, sender) local receive_fields = function(pos, formname, fields, sender)
if fields.craftguide then if fields.craftguide then
@ -465,7 +488,8 @@ minetest.register_node("mcl_furnaces:furnace", {
for _, listname in ipairs({ "src", "dst", "fuel" }) do for _, listname in ipairs({ "src", "dst", "fuel" }) do
local stack = inv:get_stack(listname, 1) local stack = inv:get_stack(listname, 1)
if not stack:is_empty() then if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} local p = { x = pos.x + math.random(0, 10) / 10 - 0.5, y = pos.y,
z = pos.z + math.random(0, 10) / 10 - 0.5 }
minetest.add_item(p, stack) minetest.add_item(p, stack)
end end
end end
@ -541,7 +565,8 @@ minetest.register_node("mcl_furnaces:furnace_active", {
for _, listname in ipairs({ "src", "dst", "fuel" }) do for _, listname in ipairs({ "src", "dst", "fuel" }) do
local stack = inv:get_stack(listname, 1) local stack = inv:get_stack(listname, 1)
if not stack:is_empty() then if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} local p = { x = pos.x + math.random(0, 10) / 10 - 0.5, y = pos.y,
z = pos.z + math.random(0, 10) / 10 - 0.5 }
minetest.add_item(p, stack) minetest.add_item(p, stack)
end end
end end

View File

@ -1,5 +1,6 @@
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
local C = minetest.colorize
local F = minetest.formspec_escape
local LIGHT_ACTIVE_FURNACE = 13 local LIGHT_ACTIVE_FURNACE = 13
@ -8,60 +9,82 @@ local LIGHT_ACTIVE_FURNACE = 13
-- --
local function active_formspec(fuel_percent, item_percent) local function active_formspec(fuel_percent, item_percent)
return "size[9,8.75]".. return table.concat({
"label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "formspec_version[4]",
"list[current_player;main;0,4.5;9,3;9]".. "size[11.75,10.425]",
mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "label[0.375,0.375;" .. F(C(mcl_formspec.label_color, S("Smoker"))) .. "]",
"list[current_player;main;0,7.74;9,1;]".. mcl_formspec.get_itemslot_bg_v4(3.5, 0.75, 1, 1),
mcl_formspec.get_itemslot_bg(0,7.74,9,1).. "list[context;src;3.5,0.75;1,1;]",
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Smoker"))).."]"..
"list[context;src;2.75,0.5;1,1;]".. "image[3.5,2;1,1;default_furnace_fire_bg.png^[lowpart:" ..
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1).. (100 - fuel_percent) .. ":default_furnace_fire_fg.png]",
"list[context;fuel;2.75,2.5;1,1;]"..
mcl_formspec.get_itemslot_bg(2.75,2.5,1,1).. mcl_formspec.get_itemslot_bg_v4(3.5, 3.25, 1, 1),
"list[context;dst;5.75,1.5;1,1;]".. "list[context;fuel;3.5,3.25;1,1;]",
mcl_formspec.get_itemslot_bg(5.75,1.5,1,1)..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. "image[5.25,2;1.5,1;gui_furnace_arrow_bg.png^[lowpart:" ..
(100-fuel_percent)..":default_furnace_fire_fg.png]".. (item_percent) .. ":gui_furnace_arrow_fg.png^[transformR270]",
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[lowpart:".. mcl_formspec.get_itemslot_bg_v4(7.875, 2, 1, 1, 0.2),
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. "list[context;dst;7.875,2;1,1;]",
"label[0.375,4.7;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
"list[current_player;main;0.375,5.1;9,3;9]",
mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"list[current_player;main;0.375,9.05;9,1;]",
-- Craft guide button temporarily removed due to Minetest bug. -- Craft guide button temporarily removed due to Minetest bug.
-- TODO: Add it back when the Minetest bug is fixed. -- TODO: Add it back when the Minetest bug is fixed.
--"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. --"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
--"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]"..
"listring[context;dst]"..
"listring[current_player;main]".. "listring[context;dst]",
"listring[context;src]".. "listring[current_player;main]",
"listring[current_player;main]".. "listring[context;src]",
"listring[context;fuel]".. "listring[current_player;main]",
"listring[current_player;main]" "listring[context;fuel]",
"listring[current_player;main]",
})
end end
local inactive_formspec = "size[9,8.75]".. local inactive_formspec = table.concat({
"label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "formspec_version[4]",
"list[current_player;main;0,4.5;9,3;9]".. "size[11.75,10.425]",
mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "label[0.375,0.375;" .. F(C(mcl_formspec.label_color, S("Smoker"))) .. "]",
"list[current_player;main;0,7.74;9,1;]".. mcl_formspec.get_itemslot_bg_v4(3.5, 0.75, 1, 1),
mcl_formspec.get_itemslot_bg(0,7.74,9,1).. "list[context;src;3.5,0.75;1,1;]",
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Smoker"))).."]"..
"list[context;src;2.75,0.5;1,1;]".. "image[3.5,2;1,1;default_furnace_fire_bg.png]",
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1)..
"list[context;fuel;2.75,2.5;1,1;]".. mcl_formspec.get_itemslot_bg_v4(3.5, 3.25, 1, 1),
mcl_formspec.get_itemslot_bg(2.75,2.5,1,1).. "list[context;fuel;3.5,3.25;1,1;]",
"list[context;dst;5.75,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.75,1.5,1,1).. "image[5.25,2;1.5,1;gui_furnace_arrow_bg.png^[transformR270]",
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]".. mcl_formspec.get_itemslot_bg_v4(7.875, 2, 1, 1, 0.2),
"list[context;dst;7.875,2;1,1;]",
"label[0.375,4.7;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
"list[current_player;main;0.375,5.1;9,3;9]",
mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"list[current_player;main;0.375,9.05;9,1;]",
-- Craft guide button temporarily removed due to Minetest bug. -- Craft guide button temporarily removed due to Minetest bug.
-- TODO: Add it back when the Minetest bug is fixed. -- TODO: Add it back when the Minetest bug is fixed.
--"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. --"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
--"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]"..
"listring[context;dst]"..
"listring[current_player;main]".. "listring[context;dst]",
"listring[context;src]".. "listring[current_player;main]",
"listring[current_player;main]".. "listring[context;src]",
"listring[context;fuel]".. "listring[current_player;main]",
"listring[current_player;main]" "listring[context;fuel]",
"listring[current_player;main]",
})
local receive_fields = function(pos, formname, fields, sender) local receive_fields = function(pos, formname, fields, sender)
if fields.craftguide then if fields.craftguide then
@ -415,7 +438,8 @@ end
minetest.register_node("mcl_smoker:smoker", { minetest.register_node("mcl_smoker:smoker", {
description = S("Smoker"), description = S("Smoker"),
_tt_help = S("Cooks food faster than furnace"), _tt_help = S("Cooks food faster than furnace"),
_doc_items_longdesc = S("Smokers cook several items, mainly raw foods, into cooked foods, but twice as fast as a normal furnace."), _doc_items_longdesc = S(
"Smokers cook several items, mainly raw foods, into cooked foods, but twice as fast as a normal furnace."),
_doc_items_usagehelp = _doc_items_usagehelp =
S("Use the smoker to open the furnace menu.") .. "\n" .. S("Use the smoker to open the furnace menu.") .. "\n" ..
S("Place a furnace fuel in the lower slot and the source material in the upper slot.") .. "\n" .. S("Place a furnace fuel in the lower slot and the source material in the upper slot.") .. "\n" ..
@ -442,7 +466,11 @@ minetest.register_node("mcl_smoker:smoker", {
for _, listname in ipairs({ "src", "dst", "fuel" }) do for _, listname in ipairs({ "src", "dst", "fuel" }) do
local stack = inv:get_stack(listname, 1) local stack = inv:get_stack(listname, 1)
if not stack:is_empty() then if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} local p = {
x = pos.x + math.random(0, 10) / 10 - 0.5,
y = pos.y,
z = pos.z + math.random(0, 10) / 10 - 0.5
}
minetest.add_item(p, stack) minetest.add_item(p, stack)
end end
end end
@ -499,8 +527,10 @@ minetest.register_node("mcl_smoker:smoker_active", {
tiles = { tiles = {
"smoker_top.png", "smoker_bottom.png", "smoker_top.png", "smoker_bottom.png",
"smoker_side.png", "smoker_side.png", "smoker_side.png", "smoker_side.png",
"smoker_side.png", {name = "smoker_front_on.png", "smoker_side.png", {
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 48}}, name = "smoker_front_on.png",
animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 48 }
},
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
paramtype = "light", paramtype = "light",
@ -519,7 +549,11 @@ minetest.register_node("mcl_smoker:smoker_active", {
for _, listname in ipairs({ "src", "dst", "fuel" }) do for _, listname in ipairs({ "src", "dst", "fuel" }) do
local stack = inv:get_stack(listname, 1) local stack = inv:get_stack(listname, 1)
if not stack:is_empty() then if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} local p = {
x = pos.x + math.random(0, 10) / 10 - 0.5,
y = pos.y,
z = pos.z + math.random(0, 10) / 10 - 0.5
}
minetest.add_item(p, stack) minetest.add_item(p, stack)
end end
end end