From 5a74e01e1fb3be3570ee2d3935a4d4b6c52c372f Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Fri, 4 Mar 2022 16:48:58 +0000 Subject: [PATCH 1/7] updated furnace init.lua --- mods/ITEMS/mcl_furnaces/init.lua | 563 +------------------------------ 1 file changed, 5 insertions(+), 558 deletions(-) diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index d2f357e3c..adf8210cc 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -1,559 +1,6 @@ +-- Load files +local modpath = minetest.get_modpath(minetest.get_current_modname()) -local S = minetest.get_translator(minetest.get_current_modname()) - -local LIGHT_ACTIVE_FURNACE = 13 - --- --- Formspecs --- - -local function active_formspec(fuel_percent, item_percent) - return "size[9,8.75]".. - "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. - "list[current_player;main;0,4.5;9,3;9]".. - mcl_formspec.get_itemslot_bg(0,4.5,9,3).. - "list[current_player;main;0,7.74;9,1;]".. - mcl_formspec.get_itemslot_bg(0,7.74,9,1).. - "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]".. - "list[context;src;2.75,0.5;1,1;]".. - 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(2.75,2.5,1,1).. - "list[context;dst;5.75,1.5;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:".. - (100-fuel_percent)..":default_furnace_fire_fg.png]".. - "image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[lowpart:".. - (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. - -- Craft guide button temporarily removed due to Minetest bug. - -- TODO: Add it back when the Minetest bug is fixed. - --"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. - --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - "listring[context;fuel]".. - "listring[current_player;main]" -end - -local inactive_formspec = "size[9,8.75]".. - "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. - "list[current_player;main;0,4.5;9,3;9]".. - mcl_formspec.get_itemslot_bg(0,4.5,9,3).. - "list[current_player;main;0,7.74;9,1;]".. - mcl_formspec.get_itemslot_bg(0,7.74,9,1).. - "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]".. - "list[context;src;2.75,0.5;1,1;]".. - 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(2.75,2.5,1,1).. - "list[context;dst;5.75,1.5;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]".. - "image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]".. - -- Craft guide button temporarily removed due to Minetest bug. - -- TODO: Add it back when the Minetest bug is fixed. - --"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. - --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - "listring[context;fuel]".. - "listring[current_player;main]" - -local receive_fields = function(pos, formname, fields, sender) - if fields.craftguide then - mcl_craftguide.show(sender:get_player_name()) - end -end - -local function give_xp(pos, player) - local meta = minetest.get_meta(pos) - local dir = vector.divide(minetest.facedir_to_dir(minetest.get_node(pos).param2),-1.95) - local xp = meta:get_int("xp") - if xp > 0 then - if player then - mcl_experience.add_xp(player, xp) - else - mcl_experience.throw_xp(vector.add(pos, dir), xp) - end - meta:set_int("xp", 0) - end -end - --- --- Node callback functions that are the same for active and inactive furnace --- - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - end - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - if listname == "fuel" then - -- Special case: empty bucket (not a fuel, but used for sponge drying) - if stack:get_name() == "mcl_buckets:bucket_empty" then - if inv:get_stack(listname, index):get_count() == 0 then - return 1 - else - return 0 - end - end - - -- Test stack with size 1 because we burn one fuel at a time - local teststack = ItemStack(stack) - teststack:set_count(1) - local output, decremented_input = minetest.get_craft_result({method="fuel", width=1, items={teststack}}) - if output.time ~= 0 then - -- Only allow to place 1 item if fuel get replaced by recipe. - -- This is the case for lava buckets. - local replace_item = decremented_input.items[1] - if replace_item:is_empty() then - -- For most fuels, just allow to place everything - return stack:get_count() - else - if inv:get_stack(listname, index):get_count() == 0 then - return 1 - else - return 0 - end - end - else - return 0 - end - elseif listname == "src" then - return stack:get_count() - elseif listname == "dst" then - return 0 - end -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local stack = inv:get_stack(from_list, from_index) - return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - end - return stack:get_count() -end - -local function on_metadata_inventory_take(pos, listname, index, stack, player) - -- Award smelting achievements - if listname == "dst" then - if stack:get_name() == "mcl_core:iron_ingot" then - awards.unlock(player:get_player_name(), "mcl:acquireIron") - elseif stack:get_name() == "mcl_fishing:fish_cooked" then - awards.unlock(player:get_player_name(), "mcl:cookFish") - end - give_xp(pos, player) - end -end - -local function on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - if from_list == "dst" then - give_xp(pos, player) - end -end - -local function spawn_flames(pos, param2) - local minrelpos, maxrelpos - local dir = minetest.facedir_to_dir(param2) - if dir.x > 0 then - minrelpos = { x = -0.6, y = -0.05, z = -0.25 } - maxrelpos = { x = -0.55, y = -0.45, z = 0.25 } - elseif dir.x < 0 then - minrelpos = { x = 0.55, y = -0.05, z = -0.25 } - maxrelpos = { x = 0.6, y = -0.45, z = 0.25 } - elseif dir.z > 0 then - minrelpos = { x = -0.25, y = -0.05, z = -0.6 } - maxrelpos = { x = 0.25, y = -0.45, z = -0.55 } - elseif dir.z < 0 then - minrelpos = { x = -0.25, y = -0.05, z = 0.55 } - maxrelpos = { x = 0.25, y = -0.45, z = 0.6 } - else - return - end - mcl_particles.add_node_particlespawner(pos, { - amount = 4, - time = 0, - minpos = vector.add(pos, minrelpos), - maxpos = vector.add(pos, maxrelpos), - minvel = { x = -0.01, y = 0, z = -0.01 }, - maxvel = { x = 0.01, y = 0.1, z = 0.01 }, - minexptime = 0.3, - maxexptime = 0.6, - minsize = 0.4, - maxsize = 0.8, - texture = "mcl_particles_flame.png", - glow = LIGHT_ACTIVE_FURNACE, - }, "low") -end - -local function swap_node(pos, name) - local node = minetest.get_node(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) - if name == "mcl_furnaces:furnace_active" then - spawn_flames(pos, node.param2) - else - mcl_particles.delete_node_particlespawners(pos) - end -end - -local function furnace_node_timer(pos, elapsed) - -- - -- Inizialize metadata - -- - local meta = minetest.get_meta(pos) - local fuel_time = meta:get_float("fuel_time") or 0 - local src_time = meta:get_float("src_time") or 0 - local src_item = meta:get_string("src_item") or "" - local fuel_totaltime = meta:get_float("fuel_totaltime") or 0 - - local inv = meta:get_inventory() - local srclist, fuellist - - local cookable, cooked - local active = true - local fuel - - srclist = inv:get_list("src") - fuellist = inv:get_list("fuel") - - -- Check if src item has been changed - if srclist[1]:get_name() ~= src_item then - -- Reset cooking progress in this case - src_time = 0 - src_item = srclist[1]:get_name() - end - - local update = true - local elapsed_game_time = mcl_time.get_irl_seconds_passed_at_pos_or_nil(pos) or elapsed - while elapsed_game_time > 0.00001 and update do - -- - -- Cooking - -- - - local el = elapsed_game_time - - -- Check if we have cookable content: cookable - local aftercooked - cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) - cookable = cooked.time ~= 0 - if cookable then - -- Successful cooking requires space in dst slot and time - if not inv:room_for_item("dst", cooked.item) then - cookable = false - end - end - - if cookable then -- fuel lasts long enough, adjust el to cooking duration - el = math.min(el, cooked.time - src_time) - end - - -- Check if we have enough fuel to burn - active = fuel_time < fuel_totaltime - if cookable and not active then - -- We need to get new fuel - local afterfuel - fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) - - if fuel.time == 0 then - -- No valid fuel in fuel list -- stop - fuel_totaltime = 0 - src_time = 0 - update = false - else - -- Take fuel from fuel list - inv:set_stack("fuel", 1, afterfuel.items[1]) - fuel_time = 0 - fuel_totaltime = fuel.time - el = math.min(el, fuel_totaltime) - active = true - fuellist = inv:get_list("fuel") - end - elseif active then - el = math.min(el, fuel_totaltime - fuel_time) - -- The furnace is currently active and has enough fuel - fuel_time = fuel_time + el - end - - -- If there is a cookable item then check if it is ready yet - if cookable and active then - src_time = src_time + el - -- Place result in dst list if done - if src_time >= cooked.time then - inv:add_item("dst", cooked.item) - inv:set_stack("src", 1, aftercooked.items[1]) - - -- Unique recipe: Pour water into empty bucket after cooking wet sponge successfully - if inv:get_stack("fuel", 1):get_name() == "mcl_buckets:bucket_empty" then - if srclist[1]:get_name() == "mcl_sponges:sponge_wet" then - inv:set_stack("fuel", 1, "mcl_buckets:bucket_water") - fuellist = inv:get_list("fuel") - -- Also for river water - elseif srclist[1]:get_name() == "mcl_sponges:sponge_wet_river_water" then - inv:set_stack("fuel", 1, "mcl_buckets:bucket_river_water") - fuellist = inv:get_list("fuel") - end - end - - srclist = inv:get_list("src") - src_time = 0 - - meta:set_int("xp", meta:get_int("xp") + 1) -- ToDo give each recipe an idividial XP count - end - end - - elapsed_game_time = elapsed_game_time - el - end - - if fuel and fuel_totaltime > fuel.time then - fuel_totaltime = fuel.time - end - if srclist and srclist[1]:is_empty() then - src_time = 0 - end - - -- - -- Update formspec and node - -- - local formspec = inactive_formspec - local item_percent = 0 - if cookable then - item_percent = math.floor(src_time / cooked.time * 100) - end - - local result = false - - if active then - local fuel_percent = 0 - if fuel_totaltime > 0 then - fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) - end - formspec = active_formspec(fuel_percent, item_percent) - swap_node(pos, "mcl_furnaces:furnace_active") - -- make sure timer restarts automatically - result = true - else - swap_node(pos, "mcl_furnaces:furnace") - -- stop timer on the inactive furnace - minetest.get_node_timer(pos):stop() - end - - -- - -- Set meta values - -- - meta:set_float("fuel_totaltime", fuel_totaltime) - meta:set_float("fuel_time", fuel_time) - meta:set_float("src_time", src_time) - if srclist then - meta:set_string("src_item", src_item) - else - meta:set_string("src_item", "") - end - meta:set_string("formspec", formspec) - - return result -end - -local on_rotate, after_rotate_active -if minetest.get_modpath("screwdriver") then - on_rotate = screwdriver.rotate_simple - after_rotate_active = function(pos) - local node = minetest.get_node(pos) - mcl_particles.delete_node_particlespawners(pos) - if node.name == "mcl_furnaces:furnace" then - return - end - spawn_flames(pos, node.param2) - end -end - -minetest.register_node("mcl_furnaces:furnace", { - description = S("Furnace"), - _tt_help = S("Uses fuel to smelt or cook items"), - _doc_items_longdesc = S("Furnaces cook or smelt several items, using a furnace fuel, into something else."), - _doc_items_usagehelp = - S([[ - Use the furnace to open the furnace menu. - Place a furnace fuel in the lower slot and the source material in the upper slot. - The furnace will slowly use its fuel to smelt the item. - The result will be placed into the output slot at the right side. - ]]).."\n".. - S("Use the recipe book to see what you can smelt, what you can use as fuel and how long it will burn."), - _doc_items_hidden = false, - tiles = { - "default_furnace_top.png", "default_furnace_bottom.png", - "default_furnace_side.png", "default_furnace_side.png", - "default_furnace_side.png", "default_furnace_front.png" - }, - paramtype2 = "facedir", - groups = {pickaxey=1, container=4, deco_block=1, material_stone=1}, - is_ground_content = false, - sounds = mcl_sounds.node_sound_stone_defaults(), - - on_timer = furnace_node_timer, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - local meta = minetest.get_meta(pos) - local meta2 = meta:to_table() - meta:from_table(oldmetadata) - local inv = meta:get_inventory() - for _, listname in ipairs({"src", "dst", "fuel"}) do - local stack = inv:get_stack(listname, 1) - 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} - minetest.add_item(p, stack) - end - end - meta:from_table(meta2) - end, - - on_construct = function(pos) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", inactive_formspec) - local inv = meta:get_inventory() - inv:set_size("src", 1) - inv:set_size("fuel", 1) - inv:set_size("dst", 1) - end, - on_destruct = function(pos) - mcl_particles.delete_node_particlespawners(pos) - give_xp(pos) - end, - - on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - -- Reset accumulated game time when player works with furnace: - mcl_time.touch(pos) - minetest.get_node_timer(pos):start(1.0) - - on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - end, - on_metadata_inventory_put = function(pos) - -- Reset accumulated game time when player works with furnace: - mcl_time.touch(pos) - -- start timer function, it will sort out whether furnace can burn or not. - minetest.get_node_timer(pos):start(1.0) - end, - on_metadata_inventory_take = function(pos, listname, index, stack, player) - -- Reset accumulated game time when player works with furnace: - mcl_time.touch(pos) - -- start timer function, it will helpful if player clears dst slot - minetest.get_node_timer(pos):start(1.0) - - on_metadata_inventory_take(pos, listname, index, stack, player) - end, - - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - on_receive_fields = receive_fields, - _mcl_blast_resistance = 3.5, - _mcl_hardness = 3.5, - on_rotate = on_rotate, -}) - -minetest.register_node("mcl_furnaces:furnace_active", { - description = S("Burning Furnace"), - _doc_items_create_entry = false, - tiles = { - "default_furnace_top.png", "default_furnace_bottom.png", - "default_furnace_side.png", "default_furnace_side.png", - "default_furnace_side.png", "default_furnace_front_active.png", - }, - paramtype2 = "facedir", - paramtype = "light", - light_source = LIGHT_ACTIVE_FURNACE, - drop = "mcl_furnaces:furnace", - groups = {pickaxey=1, container=4, deco_block=1, not_in_creative_inventory=1, material_stone=1}, - is_ground_content = false, - sounds = mcl_sounds.node_sound_stone_defaults(), - on_timer = furnace_node_timer, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - local meta = minetest.get_meta(pos) - local meta2 = meta - meta:from_table(oldmetadata) - local inv = meta:get_inventory() - for _, listname in ipairs({"src", "dst", "fuel"}) do - local stack = inv:get_stack(listname, 1) - 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} - minetest.add_item(p, stack) - end - end - meta:from_table(meta2:to_table()) - end, - - on_construct = function(pos) - local node = minetest.get_node(pos) - spawn_flames(pos, node.param2) - end, - on_destruct = function(pos) - mcl_particles.delete_node_particlespawners(pos) - give_xp(pos) - end, - - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - on_metadata_inventory_move = on_metadata_inventory_move, - on_metadata_inventory_take = on_metadata_inventory_take, - on_receive_fields = receive_fields, - _mcl_blast_resistance = 3.5, - _mcl_hardness = 3.5, - on_rotate = on_rotate, - after_rotate = after_rotate_active, -}) - -minetest.register_craft({ - output = "mcl_furnaces:furnace", - recipe = { - { "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" }, - { "mcl_core:cobble", "", "mcl_core:cobble" }, - { "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" }, - } -}) - --- Add entry alias for the Help -if minetest.get_modpath("doc") then - doc.add_entry_alias("nodes", "mcl_furnaces:furnace", "nodes", "mcl_furnaces:furnace_active") -end - -minetest.register_lbm({ - label = "Active furnace flame particles", - name = "mcl_furnaces:flames", - nodenames = {"mcl_furnaces:furnace_active"}, - run_at_every_load = true, - action = function(pos, node) - spawn_flames(pos, node.param2) - end, -}) - --- Legacy -minetest.register_lbm({ - label = "Update furnace formspecs (0.60.0)", - name = "mcl_furnaces:update_formspecs_0_60_0", - -- Only update inactive furnaces because active ones should update themselves - nodenames = { "mcl_furnaces:furnace" }, - run_at_every_load = false, - action = function(pos, node) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", inactive_formspec) - end, -}) +dofile(modpath.."/blast_furnace.lua") -- Load Blast Furnaces +dofile(modpath.."/furnace.lua") -- Load Furnaces +dofile(modpath.."/smoker.lua") -- Load Smokers \ No newline at end of file From c4a669a61b5ebe53c84595b65206fa4dcf54acf6 Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Fri, 4 Mar 2022 16:50:29 +0000 Subject: [PATCH 2/7] added blast furnace textures --- .../textures/blast_furnace_front.png | Bin 0 -> 643 bytes .../textures/blast_furnace_front_on.png | Bin 0 -> 745 bytes .../textures/blast_furnace_front_on_e.png | Bin 0 -> 5777 bytes .../textures/blast_furnace_front_on_e_s.png | Bin 0 -> 5318 bytes .../mcl_furnaces/textures/blast_furnace_side.png | Bin 0 -> 636 bytes 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 mods/ITEMS/mcl_furnaces/textures/blast_furnace_front.png create mode 100644 mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on.png create mode 100644 mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on_e.png create mode 100644 mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on_e_s.png create mode 100644 mods/ITEMS/mcl_furnaces/textures/blast_furnace_side.png diff --git a/mods/ITEMS/mcl_furnaces/textures/blast_furnace_front.png b/mods/ITEMS/mcl_furnaces/textures/blast_furnace_front.png new file mode 100644 index 0000000000000000000000000000000000000000..02acd6d31bde7cbdf750831a887688611bf3296f GIT binary patch literal 643 zcmV-}0(||6P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2jc=1 z5ePQpIEL~700IL^L_t(I%Y~E8YZFlv#eXRSad;E)rG=J^(}Lnh4Rm1*LS2;5MW74+ z0bMBW1Q&vI)k+tELJ>jSxDnj8i!O>Zm7r3=LJ3hQBucU}lLS(dPGx2svWknCNv0`y zH}~B8-aYr+_YqoKUG4zP#-};U@`WGF#-{^*a(s+Rqsip>7@@V*<<8E>JphuoZ;>nf zJd?AD`sd5(+XIj*0G#bQ3zgyPcN+ikX~A$TIt@9s;a(%5mggtng+m!&-(y0?LWRB#J%h89rBQZ zLF;upjRzF~T?GJ!VUSABQLUJ4Zf^jvxxEpl~U<^lMcJA_VW_%FD@QKO@=zJlXcozc+?B;wb(c6o~TnG7>G z6EvDfoIfXMwN5y0)wy!@1^|ubkzb>Dj*Da4e9s@CMIw|-MI75^fA3TG@kAni*K(=Y dS7h4&`~}=|;%wiHP?`V$002ovPDHLkV1h~G8~gwO literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on.png b/mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on.png new file mode 100644 index 0000000000000000000000000000000000000000..712bac83fc55a7fd7aeba895ef2bab7d22797cee GIT binary patch literal 745 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2jc=1 z5eyT|P?xa)00L=AL_t(Y$L*BQOB7)k$3H70HqK1+u8KdV)kCzl3473%Ko4Rb`~h|F z;Hg8Amku3*=(L1~U?C!i5V{2Y1$K#4q{JXW77c{8a8K^cE-0>J>uU1G?K=38iL}l@A|R0T{V{ zjdbSwsfldcuJgHlYYfTU%>!Ur7667}@HZHSK_n6(o!KVz5xAE%DTL5%jr(7-r zaD0612Re=ez=L~t0FYG$31EJ4*>_SD#SaE(YHA83P!xsv#btyLOpXpC$*O`70?V=p zhr@MMYZK|Z9RpsFeWODk&t zL^~P*nCjGs#o7Wk%d-4Ku47OOGiSKL)6ITm4;}-+WdIO~L>L$g& zN~QiSIKfuKE$)>|0Efi_EiD&F^j)F%QV;JJ7KryJ*gM$g{5geU@rc7>fy>dW0PG#? z`!Q14cCbq&zHY3eY8u&{ZR}Eswbf7V@MxM}HM_H2WmGD;3}jVdaQMcV9-QgHZ}nhq zVw_C!{{QQNhiFG*^<|#mpY$Nw(da+xSgZ{*XZV8hs~$+TdN7oT2gJh@6gJ(prw6q- b(*yVkK$4}i$+C1F00000NkvXXu0mjfJgiYg literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on_e.png b/mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on_e.png new file mode 100644 index 0000000000000000000000000000000000000000..f154d47e1311260f1ee0b9fdd164136576a426fc GIT binary patch literal 5777 zcmeHKd0bOh77idHJ1VFMY6z%^WDg;U1X&UZVl)s?aKo3E7kHA5 zYKX1Xa4Q@RXB#TuMSyPy@Wv154?bO%y*!V@^^>PYMq?3>4zJdzWT+g$V<~C`kLXbu z4yV8Nc>1ioM`LW>#5u*JFJ6_g=HywpPE6wv46dl|173b2EUEkdwq z=T5!x<0EJ0^o*hxR6c!n`k}}7;@RI;+TMS@X@paGuDG9f{-7i;2KuNXe9^LTIq}0_ zIc|PAvj2WX=Rlln<_Z}D=wVjTU+=uL6S7uR9&PYBD{8i!;2t=P=#|m%hW9$6z9{P% zFU0@$K7H1ySsoeA)`uG4p}37HzY3DSefnGH0k8v}6V5x^t=Uve*im0yUhUozKxbN= zrW4P+8jW*HSEf-<1>6)#+_s#QFbJopW+kS9Y|U~fhgE_{yJ-X;$D4N!Vz;v|wz!Ng zKDRvv7ZiOJXM4#ydbA_6!@|kV)$2qak5}!H6&BvOxopSQoiCl>urXU@Yii4-7siD( z%GpaF9nxcy5*=sw);*bPRWL+AV$IpTv0(W4rpPVxe=6MBbSa=@O(8?ksEKcxymG^Y zc3zW`t9y#n<5o`^PQ$L8IT^CP^xB>ETc>Pb{`x#-fUSYyW4OCt zTOS(Q95lJx>VV#T=n!mT+U)51g=x)k%`K&kP1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!JB`9 zSHWYE-ul0I77v0-FG7h`5E4UzLTwUAlie+3)?w)(9+H_PTIVvud++=B-uK?5jt&nd z0J}TeTz5_z-`U;SUb<_Q62Ar`YLybHqr-#A+xN!+JlT6dr`<%2$H;sh05u*j5#Hb3 za4N~U|(10aeb090YIym zPP@teqsKNk9EJcmQjh@%f=jlxHu-UW4nQF%Y_TJSZNmV|WtUd#C+kv>cBEM9(SS`{ ztN0&d4UtwcX{}l;C!l2LX zJ9lxUU@*F%kP~#;O)9kw04k-MeEU+zk%F{gGGMd+Mp+>z>@r=&S9VX#TBprS0X%Po z{fGDLM;eSS0O+3ekoi2Gw_@XA(4U*A#$&#oo*?si`x`$Uf0%kOBLnEPn{%IL>-`60 WB Date: Fri, 4 Mar 2022 16:52:32 +0000 Subject: [PATCH 3/7] Add 'mods/ITEMS/mcl_furnaces/furnace.lua' --- mods/ITEMS/mcl_furnaces/furnace.lua | 558 ++++++++++++++++++++++++++++ 1 file changed, 558 insertions(+) create mode 100644 mods/ITEMS/mcl_furnaces/furnace.lua diff --git a/mods/ITEMS/mcl_furnaces/furnace.lua b/mods/ITEMS/mcl_furnaces/furnace.lua new file mode 100644 index 000000000..81bef41f7 --- /dev/null +++ b/mods/ITEMS/mcl_furnaces/furnace.lua @@ -0,0 +1,558 @@ +local S = minetest.get_translator(minetest.get_current_modname()) + +local LIGHT_ACTIVE_FURNACE = 13 + +-- +-- Formspecs +-- + +local function active_formspec(fuel_percent, item_percent) + return "size[9,8.75]".. + "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. + "list[current_player;main;0,4.5;9,3;9]".. + mcl_formspec.get_itemslot_bg(0,4.5,9,3).. + "list[current_player;main;0,7.74;9,1;]".. + mcl_formspec.get_itemslot_bg(0,7.74,9,1).. + "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]".. + "list[context;src;2.75,0.5;1,1;]".. + 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(2.75,2.5,1,1).. + "list[context;dst;5.75,1.5;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:".. + (100-fuel_percent)..":default_furnace_fire_fg.png]".. + "image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[lowpart:".. + (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. + -- Craft guide button temporarily removed due to Minetest bug. + -- TODO: Add it back when the Minetest bug is fixed. + --"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. + --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. + "listring[context;dst]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + "listring[context;fuel]".. + "listring[current_player;main]" +end + +local inactive_formspec = "size[9,8.75]".. + "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. + "list[current_player;main;0,4.5;9,3;9]".. + mcl_formspec.get_itemslot_bg(0,4.5,9,3).. + "list[current_player;main;0,7.74;9,1;]".. + mcl_formspec.get_itemslot_bg(0,7.74,9,1).. + "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]".. + "list[context;src;2.75,0.5;1,1;]".. + 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(2.75,2.5,1,1).. + "list[context;dst;5.75,1.5;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]".. + "image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]".. + -- Craft guide button temporarily removed due to Minetest bug. + -- TODO: Add it back when the Minetest bug is fixed. + --"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. + --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. + "listring[context;dst]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + "listring[context;fuel]".. + "listring[current_player;main]" + +local receive_fields = function(pos, formname, fields, sender) + if fields.craftguide then + mcl_craftguide.show(sender:get_player_name()) + end +end + +local function give_xp(pos, player) + local meta = minetest.get_meta(pos) + local dir = vector.divide(minetest.facedir_to_dir(minetest.get_node(pos).param2),-1.95) + local xp = meta:get_int("xp") + if xp > 0 then + if player then + mcl_experience.add_xp(player, xp) + else + mcl_experience.throw_xp(vector.add(pos, dir), xp) + end + meta:set_int("xp", 0) + end +end + +-- +-- Node callback functions that are the same for active and inactive furnace +-- + +local function allow_metadata_inventory_put(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + end + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if listname == "fuel" then + -- Special case: empty bucket (not a fuel, but used for sponge drying) + if stack:get_name() == "mcl_buckets:bucket_empty" then + if inv:get_stack(listname, index):get_count() == 0 then + return 1 + else + return 0 + end + end + + -- Test stack with size 1 because we burn one fuel at a time + local teststack = ItemStack(stack) + teststack:set_count(1) + local output, decremented_input = minetest.get_craft_result({method="fuel", width=1, items={teststack}}) + if output.time ~= 0 then + -- Only allow to place 1 item if fuel get replaced by recipe. + -- This is the case for lava buckets. + local replace_item = decremented_input.items[1] + if replace_item:is_empty() then + -- For most fuels, just allow to place everything + return stack:get_count() + else + if inv:get_stack(listname, index):get_count() == 0 then + return 1 + else + return 0 + end + end + else + return 0 + end + elseif listname == "src" then + return stack:get_count() + elseif listname == "dst" then + return 0 + end +end + +local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stack = inv:get_stack(from_list, from_index) + return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) +end + +local function allow_metadata_inventory_take(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + end + return stack:get_count() +end + +local function on_metadata_inventory_take(pos, listname, index, stack, player) + -- Award smelting achievements + if listname == "dst" then + if stack:get_name() == "mcl_core:iron_ingot" then + awards.unlock(player:get_player_name(), "mcl:acquireIron") + elseif stack:get_name() == "mcl_fishing:fish_cooked" then + awards.unlock(player:get_player_name(), "mcl:cookFish") + end + give_xp(pos, player) + end +end + +local function on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + if from_list == "dst" then + give_xp(pos, player) + end +end + +local function spawn_flames(pos, param2) + local minrelpos, maxrelpos + local dir = minetest.facedir_to_dir(param2) + if dir.x > 0 then + minrelpos = { x = -0.6, y = -0.05, z = -0.25 } + maxrelpos = { x = -0.55, y = -0.45, z = 0.25 } + elseif dir.x < 0 then + minrelpos = { x = 0.55, y = -0.05, z = -0.25 } + maxrelpos = { x = 0.6, y = -0.45, z = 0.25 } + elseif dir.z > 0 then + minrelpos = { x = -0.25, y = -0.05, z = -0.6 } + maxrelpos = { x = 0.25, y = -0.45, z = -0.55 } + elseif dir.z < 0 then + minrelpos = { x = -0.25, y = -0.05, z = 0.55 } + maxrelpos = { x = 0.25, y = -0.45, z = 0.6 } + else + return + end + mcl_particles.add_node_particlespawner(pos, { + amount = 4, + time = 0, + minpos = vector.add(pos, minrelpos), + maxpos = vector.add(pos, maxrelpos), + minvel = { x = -0.01, y = 0, z = -0.01 }, + maxvel = { x = 0.01, y = 0.1, z = 0.01 }, + minexptime = 0.3, + maxexptime = 0.6, + minsize = 0.4, + maxsize = 0.8, + texture = "mcl_particles_flame.png", + glow = LIGHT_ACTIVE_FURNACE, + }, "low") +end + +local function swap_node(pos, name) + local node = minetest.get_node(pos) + if node.name == name then + return + end + node.name = name + minetest.swap_node(pos, node) + if name == "mcl_furnaces:furnace_active" then + spawn_flames(pos, node.param2) + else + mcl_particles.delete_node_particlespawners(pos) + end +end + +local function furnace_node_timer(pos, elapsed) + -- + -- Inizialize metadata + -- + local meta = minetest.get_meta(pos) + local fuel_time = meta:get_float("fuel_time") or 0 + local src_time = meta:get_float("src_time") or 0 + local src_item = meta:get_string("src_item") or "" + local fuel_totaltime = meta:get_float("fuel_totaltime") or 0 + + local inv = meta:get_inventory() + local srclist, fuellist + + local cookable, cooked + local active = true + local fuel + + srclist = inv:get_list("src") + fuellist = inv:get_list("fuel") + + -- Check if src item has been changed + if srclist[1]:get_name() ~= src_item then + -- Reset cooking progress in this case + src_time = 0 + src_item = srclist[1]:get_name() + end + + local update = true + local elapsed_game_time = mcl_time.get_irl_seconds_passed_at_pos_or_nil(pos) or elapsed + while elapsed_game_time > 0.00001 and update do + -- + -- Cooking + -- + + local el = elapsed_game_time + + -- Check if we have cookable content: cookable + local aftercooked + cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) + cookable = cooked.time ~= 0 + if cookable then + -- Successful cooking requires space in dst slot and time + if not inv:room_for_item("dst", cooked.item) then + cookable = false + end + end + + if cookable then -- fuel lasts long enough, adjust el to cooking duration + el = math.min(el, cooked.time - src_time) + end + + -- Check if we have enough fuel to burn + active = fuel_time < fuel_totaltime + if cookable and not active then + -- We need to get new fuel + local afterfuel + fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) + + if fuel.time == 0 then + -- No valid fuel in fuel list -- stop + fuel_totaltime = 0 + src_time = 0 + update = false + else + -- Take fuel from fuel list + inv:set_stack("fuel", 1, afterfuel.items[1]) + fuel_time = 0 + fuel_totaltime = fuel.time + el = math.min(el, fuel_totaltime) + active = true + fuellist = inv:get_list("fuel") + end + elseif active then + el = math.min(el, fuel_totaltime - fuel_time) + -- The furnace is currently active and has enough fuel + fuel_time = fuel_time + el + end + + -- If there is a cookable item then check if it is ready yet + if cookable and active then + src_time = src_time + el + -- Place result in dst list if done + if src_time >= cooked.time then + inv:add_item("dst", cooked.item) + inv:set_stack("src", 1, aftercooked.items[1]) + + -- Unique recipe: Pour water into empty bucket after cooking wet sponge successfully + if inv:get_stack("fuel", 1):get_name() == "mcl_buckets:bucket_empty" then + if srclist[1]:get_name() == "mcl_sponges:sponge_wet" then + inv:set_stack("fuel", 1, "mcl_buckets:bucket_water") + fuellist = inv:get_list("fuel") + -- Also for river water + elseif srclist[1]:get_name() == "mcl_sponges:sponge_wet_river_water" then + inv:set_stack("fuel", 1, "mcl_buckets:bucket_river_water") + fuellist = inv:get_list("fuel") + end + end + + srclist = inv:get_list("src") + src_time = 0 + + meta:set_int("xp", meta:get_int("xp") + 1) -- ToDo give each recipe an idividial XP count + end + end + + elapsed_game_time = elapsed_game_time - el + end + + if fuel and fuel_totaltime > fuel.time then + fuel_totaltime = fuel.time + end + if srclist and srclist[1]:is_empty() then + src_time = 0 + end + + -- + -- Update formspec and node + -- + local formspec = inactive_formspec + local item_percent = 0 + if cookable then + item_percent = math.floor(src_time / cooked.time * 100) + end + + local result = false + + if active then + local fuel_percent = 0 + if fuel_totaltime > 0 then + fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) + end + formspec = active_formspec(fuel_percent, item_percent) + swap_node(pos, "mcl_furnaces:furnace_active") + -- make sure timer restarts automatically + result = true + else + swap_node(pos, "mcl_furnaces:furnace") + -- stop timer on the inactive furnace + minetest.get_node_timer(pos):stop() + end + + -- + -- Set meta values + -- + meta:set_float("fuel_totaltime", fuel_totaltime) + meta:set_float("fuel_time", fuel_time) + meta:set_float("src_time", src_time) + if srclist then + meta:set_string("src_item", src_item) + else + meta:set_string("src_item", "") + end + meta:set_string("formspec", formspec) + + return result +end + +local on_rotate, after_rotate_active +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.rotate_simple + after_rotate_active = function(pos) + local node = minetest.get_node(pos) + mcl_particles.delete_node_particlespawners(pos) + if node.name == "mcl_furnaces:furnace" then + return + end + spawn_flames(pos, node.param2) + end +end + +minetest.register_node("mcl_furnaces:furnace", { + description = S("Furnace"), + _tt_help = S("Uses fuel to smelt or cook items"), + _doc_items_longdesc = S("Furnaces cook or smelt several items, using a furnace fuel, into something else."), + _doc_items_usagehelp = + S([[ + Use the furnace to open the furnace menu. + Place a furnace fuel in the lower slot and the source material in the upper slot. + The furnace will slowly use its fuel to smelt the item. + The result will be placed into the output slot at the right side. + ]]).."\n".. + S("Use the recipe book to see what you can smelt, what you can use as fuel and how long it will burn."), + _doc_items_hidden = false, + tiles = { + "default_furnace_top.png", "default_furnace_bottom.png", + "default_furnace_side.png", "default_furnace_side.png", + "default_furnace_side.png", "default_furnace_front.png" + }, + paramtype2 = "facedir", + groups = {pickaxey=1, container=4, deco_block=1, material_stone=1}, + is_ground_content = false, + sounds = mcl_sounds.node_sound_stone_defaults(), + + on_timer = furnace_node_timer, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + local meta = minetest.get_meta(pos) + local meta2 = meta:to_table() + meta:from_table(oldmetadata) + local inv = meta:get_inventory() + for _, listname in ipairs({"src", "dst", "fuel"}) do + local stack = inv:get_stack(listname, 1) + 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} + minetest.add_item(p, stack) + end + end + meta:from_table(meta2) + end, + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", inactive_formspec) + local inv = meta:get_inventory() + inv:set_size("src", 1) + inv:set_size("fuel", 1) + inv:set_size("dst", 1) + end, + on_destruct = function(pos) + mcl_particles.delete_node_particlespawners(pos) + give_xp(pos) + end, + + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + -- Reset accumulated game time when player works with furnace: + mcl_time.touch(pos) + minetest.get_node_timer(pos):start(1.0) + + on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + end, + on_metadata_inventory_put = function(pos) + -- Reset accumulated game time when player works with furnace: + mcl_time.touch(pos) + -- start timer function, it will sort out whether furnace can burn or not. + minetest.get_node_timer(pos):start(1.0) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + -- Reset accumulated game time when player works with furnace: + mcl_time.touch(pos) + -- start timer function, it will helpful if player clears dst slot + minetest.get_node_timer(pos):start(1.0) + + on_metadata_inventory_take(pos, listname, index, stack, player) + end, + + allow_metadata_inventory_put = allow_metadata_inventory_put, + allow_metadata_inventory_move = allow_metadata_inventory_move, + allow_metadata_inventory_take = allow_metadata_inventory_take, + on_receive_fields = receive_fields, + _mcl_blast_resistance = 3.5, + _mcl_hardness = 3.5, + on_rotate = on_rotate, +}) + +minetest.register_node("mcl_furnaces:furnace_active", { + description = S("Burning Furnace"), + _doc_items_create_entry = false, + tiles = { + "default_furnace_top.png", "default_furnace_bottom.png", + "default_furnace_side.png", "default_furnace_side.png", + "default_furnace_side.png", "default_furnace_front_active.png", + }, + paramtype2 = "facedir", + paramtype = "light", + light_source = LIGHT_ACTIVE_FURNACE, + drop = "mcl_furnaces:furnace", + groups = {pickaxey=1, container=4, deco_block=1, not_in_creative_inventory=1, material_stone=1}, + is_ground_content = false, + sounds = mcl_sounds.node_sound_stone_defaults(), + on_timer = furnace_node_timer, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + local meta = minetest.get_meta(pos) + local meta2 = meta + meta:from_table(oldmetadata) + local inv = meta:get_inventory() + for _, listname in ipairs({"src", "dst", "fuel"}) do + local stack = inv:get_stack(listname, 1) + 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} + minetest.add_item(p, stack) + end + end + meta:from_table(meta2:to_table()) + end, + + on_construct = function(pos) + local node = minetest.get_node(pos) + spawn_flames(pos, node.param2) + end, + on_destruct = function(pos) + mcl_particles.delete_node_particlespawners(pos) + give_xp(pos) + end, + + allow_metadata_inventory_put = allow_metadata_inventory_put, + allow_metadata_inventory_move = allow_metadata_inventory_move, + allow_metadata_inventory_take = allow_metadata_inventory_take, + on_metadata_inventory_move = on_metadata_inventory_move, + on_metadata_inventory_take = on_metadata_inventory_take, + on_receive_fields = receive_fields, + _mcl_blast_resistance = 3.5, + _mcl_hardness = 3.5, + on_rotate = on_rotate, + after_rotate = after_rotate_active, +}) + +minetest.register_craft({ + output = "mcl_furnaces:furnace", + recipe = { + { "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" }, + { "mcl_core:cobble", "", "mcl_core:cobble" }, + { "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" }, + } +}) + +-- Add entry alias for the Help +if minetest.get_modpath("doc") then + doc.add_entry_alias("nodes", "mcl_furnaces:furnace", "nodes", "mcl_furnaces:furnace_active") +end + +minetest.register_lbm({ + label = "Active furnace flame particles", + name = "mcl_furnaces:flames", + nodenames = {"mcl_furnaces:furnace_active"}, + run_at_every_load = true, + action = function(pos, node) + spawn_flames(pos, node.param2) + end, +}) + +-- Legacy +minetest.register_lbm({ + label = "Update furnace formspecs (0.60.0)", + name = "mcl_furnaces:update_formspecs_0_60_0", + -- Only update inactive furnaces because active ones should update themselves + nodenames = { "mcl_furnaces:furnace" }, + run_at_every_load = false, + action = function(pos, node) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", inactive_formspec) + end, +}) From 6d4a58026200386b9debf0e63fef07bb14f26e53 Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Fri, 4 Mar 2022 16:53:53 +0000 Subject: [PATCH 4/7] added blast_furnace.lua --- mods/ITEMS/mcl_furnaces/blast_furnace.lua | 548 ++++++++++++++++++++++ 1 file changed, 548 insertions(+) create mode 100644 mods/ITEMS/mcl_furnaces/blast_furnace.lua diff --git a/mods/ITEMS/mcl_furnaces/blast_furnace.lua b/mods/ITEMS/mcl_furnaces/blast_furnace.lua new file mode 100644 index 000000000..4e14d9305 --- /dev/null +++ b/mods/ITEMS/mcl_furnaces/blast_furnace.lua @@ -0,0 +1,548 @@ + +local S = minetest.get_translator(minetest.get_current_modname()) + +local LIGHT_ACTIVE_FURNACE = 13 + +-- +-- Formspecs +-- + +local function active_formspec(fuel_percent, item_percent) + return "size[9,8.75]".. + "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. + "list[current_player;main;0,4.5;9,3;9]".. + mcl_formspec.get_itemslot_bg(0,4.5,9,3).. + "list[current_player;main;0,7.74;9,1;]".. + mcl_formspec.get_itemslot_bg(0,7.74,9,1).. + "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Blast Furnace"))).."]".. + "list[context;src;2.75,0.5;1,1;]".. + 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(2.75,2.5,1,1).. + "list[context;dst;5.75,1.5;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:".. + (100-fuel_percent)..":default_furnace_fire_fg.png]".. + "image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[lowpart:".. + (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. + -- Craft guide button temporarily removed due to Minetest bug. + -- TODO: Add it back when the Minetest bug is fixed. + --"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. + --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. + "listring[context;dst]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + "listring[context;fuel]".. + "listring[current_player;main]" +end + +local inactive_formspec = "size[9,8.75]".. + "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. + "list[current_player;main;0,4.5;9,3;9]".. + mcl_formspec.get_itemslot_bg(0,4.5,9,3).. + "list[current_player;main;0,7.74;9,1;]".. + mcl_formspec.get_itemslot_bg(0,7.74,9,1).. + "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Blast Furnace"))).."]".. + "list[context;src;2.75,0.5;1,1;]".. + 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(2.75,2.5,1,1).. + "list[context;dst;5.75,1.5;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]".. + "image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]".. + -- Craft guide button temporarily removed due to Minetest bug. + -- TODO: Add it back when the Minetest bug is fixed. + --"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. + --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. + "listring[context;dst]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + "listring[context;fuel]".. + "listring[current_player;main]" + +local receive_fields = function(pos, formname, fields, sender) + if fields.craftguide then + mcl_craftguide.show(sender:get_player_name()) + end +end + +local function give_xp(pos, player) + local meta = minetest.get_meta(pos) + local dir = vector.divide(minetest.facedir_to_dir(minetest.get_node(pos).param2),-1.95) + local xp = meta:get_int("xp") + if xp > 0 then + if player then + mcl_experience.add_xp(player, xp) + else + mcl_experience.throw_xp(vector.add(pos, dir), xp) + end + meta:set_int("xp", 0) + end +end + +-- +-- Node callback functions that are the same for active and inactive furnace +-- + +local function allow_metadata_inventory_put(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + end + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if listname == "fuel" then + + -- Test stack with size 1 because we burn one fuel at a time + local teststack = ItemStack(stack) + teststack:set_count(1) + local output, decremented_input = minetest.get_craft_result({method="fuel", width=1, items={teststack}}) + if output.time ~= 0 then + -- Only allow to place 1 item if fuel get replaced by recipe. + -- This is the case for lava buckets. + local replace_item = decremented_input.items[1] + if replace_item:is_empty() then + -- For most fuels, just allow to place everything + return stack:get_count() + else + if inv:get_stack(listname, index):get_count() == 0 then + return 1 + else + return 0 + end + end + else + return 0 + end + elseif listname == "src" then + return stack:get_count() + elseif listname == "dst" then + return 0 + end +end + +local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stack = inv:get_stack(from_list, from_index) + return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) +end + +local function allow_metadata_inventory_take(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + end + return stack:get_count() +end + +local function on_metadata_inventory_take(pos, listname, index, stack, player) + -- Award smelting achievements + if listname == "dst" then + if stack:get_name() == "mcl_core:iron_ingot" then + awards.unlock(player:get_player_name(), "mcl:acquireIron") + end + give_xp(pos, player) + end +end + +local function on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + if from_list == "dst" then + give_xp(pos, player) + end +end + +local function spawn_flames(pos, param2) + local minrelpos, maxrelpos + local dir = minetest.facedir_to_dir(param2) + if dir.x > 0 then + minrelpos = { x = -0.6, y = -0.05, z = -0.25 } + maxrelpos = { x = -0.55, y = -0.45, z = 0.25 } + elseif dir.x < 0 then + minrelpos = { x = 0.55, y = -0.05, z = -0.25 } + maxrelpos = { x = 0.6, y = -0.45, z = 0.25 } + elseif dir.z > 0 then + minrelpos = { x = -0.25, y = -0.05, z = -0.6 } + maxrelpos = { x = 0.25, y = -0.45, z = -0.55 } + elseif dir.z < 0 then + minrelpos = { x = -0.25, y = -0.05, z = 0.55 } + maxrelpos = { x = 0.25, y = -0.45, z = 0.6 } + else + return + end + mcl_particles.add_node_particlespawner(pos, { + amount = 4, + time = 0, + minpos = vector.add(pos, minrelpos), + maxpos = vector.add(pos, maxrelpos), + minvel = { x = -0.01, y = 0, z = -0.01 }, + maxvel = { x = 0.01, y = 0.1, z = 0.01 }, + minexptime = 0.3, + maxexptime = 0.6, + minsize = 0.4, + maxsize = 0.8, + texture = "mcl_particles_flame.png", + glow = LIGHT_ACTIVE_FURNACE, + }, "low") +end + +local function swap_node(pos, name) + local node = minetest.get_node(pos) + if node.name == name then + return + end + node.name = name + minetest.swap_node(pos, node) + if name == "mcl_furnaces:blast_furnace_active" then + spawn_flames(pos, node.param2) + else + mcl_particles.delete_node_particlespawners(pos) + end +end + +local function furnace_node_timer(pos, elapsed) + -- + -- Inizialize metadata + -- + local meta = minetest.get_meta(pos) + local fuel_time = meta:get_float("fuel_time") or 0 + local src_time = meta:get_float("src_time") or 0 + local src_item = meta:get_string("src_item") or "" + local fuel_totaltime = meta:get_float("fuel_totaltime") or 0 + + local inv = meta:get_inventory() + local srclist, fuellist + + local cookable, cooked + local active = true + local fuel + + srclist = inv:get_list("src") + fuellist = inv:get_list("fuel") + + -- Check if src item has been changed + if srclist[1]:get_name() ~= src_item then + -- Reset cooking progress in this case + src_time = 0 + src_item = srclist[1]:get_name() + end + + local update = true + local elapsed_game_time = mcl_time.get_irl_seconds_passed_at_pos_or_nil(pos) or elapsed + while elapsed_game_time > 0.00001 and update do + -- + -- Cooking + -- + + local el = elapsed_game_time + + -- Check if we have cookable content: cookable + local aftercooked + cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) + cookable = false + cookableItems = {"mcl_raw_ores:raw_iron", "mcl_raw_ores:raw_gold", "mcl_copper:raw_copper", "mcl_nether:ancient_debris"} + cookable = false + --for _, item in ipairs(cookableItems) do + for _,item in ipairs(cookableItems) do + local stack = inv:get_stack("src",1) + if stack:get_name() == item then + cookable = true + end + end + if cookable then + -- Successful cooking requires space in dst slot and time + if not inv:room_for_item("dst", cooked.item) then + cookable = false + end + end + + if cookable then -- fuel lasts long enough, adjust el to cooking duration + el = math.min(el, cooked.time - src_time) + end + + -- Check if we have enough fuel to burn + active = fuel_time < fuel_totaltime + if cookable and not active then + -- We need to get new fuel + local afterfuel + fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) + + if fuel.time == 0 then + -- No valid fuel in fuel list -- stop + fuel_totaltime = 0 + src_time = 0 + update = false + else + -- Take fuel from fuel list + inv:set_stack("fuel", 1, afterfuel.items[1]) + fuel_time = 0 + fuel_totaltime = fuel.time + el = math.min(el, fuel_totaltime) + active = true + fuellist = inv:get_list("fuel") + end + elseif active then + el = math.min(el, fuel_totaltime - fuel_time) + -- The furnace is currently active and has enough fuel + fuel_time = fuel_time + el + end + + -- If there is a cookable item then check if it is ready yet + if cookable and active then + -- in the src_time variable, the *1.5 is the multiplication that makes the blast furnace work faster than a normal furnace. I (PrairieWind) have it at 1.5 times faster, but it can be OP and 2 times faster, or 1.2 times faster. All are good numbers. + src_time = (src_time + el)*1.5 + -- Place result in dst list if done + if src_time >= cooked.time then + inv:add_item("dst", cooked.item) + inv:set_stack("src", 1, aftercooked.items[1]) + + srclist = inv:get_list("src") + src_time = 0 + + meta:set_int("xp", meta:get_int("xp") + 1) -- ToDo give each recipe an idividial XP count + end + end + + elapsed_game_time = elapsed_game_time - el + end + + if fuel and fuel_totaltime > fuel.time then + fuel_totaltime = fuel.time + end + if srclist and srclist[1]:is_empty() then + src_time = 0 + end + + -- + -- Update formspec and node + -- + local formspec = inactive_formspec + local item_percent = 0 + if cookable then + item_percent = math.floor(src_time / cooked.time * 100) + end + + local result = false + + if active then + local fuel_percent = 0 + if fuel_totaltime > 0 then + fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) + end + formspec = active_formspec(fuel_percent, item_percent) + swap_node(pos, "mcl_furnaces:blast_furnace_active") + -- make sure timer restarts automatically + result = true + else + swap_node(pos, "mcl_furnaces:blast_furnace") + -- stop timer on the inactive furnace + minetest.get_node_timer(pos):stop() + end + + -- + -- Set meta values + -- + meta:set_float("fuel_totaltime", fuel_totaltime) + meta:set_float("fuel_time", fuel_time) + meta:set_float("src_time", src_time) + if srclist then + meta:set_string("src_item", src_item) + else + meta:set_string("src_item", "") + end + meta:set_string("formspec", formspec) + + return result +end + +local on_rotate, after_rotate_active +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.rotate_simple + after_rotate_active = function(pos) + local node = minetest.get_node(pos) + mcl_particles.delete_node_particlespawners(pos) + if node.name == "mcl_furnaces:blast_furnace" then + return + end + spawn_flames(pos, node.param2) + end +end + +minetest.register_node("mcl_furnaces:blast_furnace", { + description = S("Blast Furnace"), + _tt_help = S("Uses fuel to smelt or cook items"), + _doc_items_longdesc = S("Blast Furnaces cook or smelt several items, using a furnace fuel, into something else, but faster than a normal furnace."), + _doc_items_usagehelp = + S([[ + Use the furnace to open the furnace menu. + Place a furnace fuel in the lower slot and the source material in the upper slot. + The furnace will slowly use its fuel to smelt the item. + The result will be placed into the output slot at the right side. + ]]).."\n".. + S("Use the recipe book to see what you can smelt, what you can use as fuel and how long it will burn."), + _doc_items_hidden = false, + tiles = { + "blast_furnace_top.png", "blast_furnace_top.png", + "blast_furnace_side.png", "blast_furnace_side.png", + "blast_furnace_side.png", "blast_furnace_front.png" + }, + paramtype2 = "facedir", + groups = {pickaxey=1, container=4, deco_block=1, material_stone=1}, + is_ground_content = false, + sounds = mcl_sounds.node_sound_stone_defaults(), + + on_timer = furnace_node_timer, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + local meta = minetest.get_meta(pos) + local meta2 = meta:to_table() + meta:from_table(oldmetadata) + local inv = meta:get_inventory() + for _, listname in ipairs({"src", "dst", "fuel"}) do + local stack = inv:get_stack(listname, 1) + 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} + minetest.add_item(p, stack) + end + end + meta:from_table(meta2) + end, + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", inactive_formspec) + local inv = meta:get_inventory() + inv:set_size("src", 1) + inv:set_size("fuel", 1) + inv:set_size("dst", 1) + end, + on_destruct = function(pos) + mcl_particles.delete_node_particlespawners(pos) + give_xp(pos) + end, + + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + -- Reset accumulated game time when player works with furnace: + mcl_time.touch(pos) + minetest.get_node_timer(pos):start(1.0) + + on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + end, + on_metadata_inventory_put = function(pos) + -- Reset accumulated game time when player works with furnace: + mcl_time.touch(pos) + -- start timer function, it will sort out whether furnace can burn or not. + minetest.get_node_timer(pos):start(1.0) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + -- Reset accumulated game time when player works with furnace: + mcl_time.touch(pos) + -- start timer function, it will helpful if player clears dst slot + minetest.get_node_timer(pos):start(1.0) + + on_metadata_inventory_take(pos, listname, index, stack, player) + end, + + allow_metadata_inventory_put = allow_metadata_inventory_put, + allow_metadata_inventory_move = allow_metadata_inventory_move, + allow_metadata_inventory_take = allow_metadata_inventory_take, + on_receive_fields = receive_fields, + _mcl_blast_resistance = 3.5, + _mcl_hardness = 3.5, + on_rotate = on_rotate, +}) + +minetest.register_node("mcl_furnaces:blast_furnace_active", { + description = S("Active Blast Furnace"), + _doc_items_create_entry = false, + tiles = { + "blast_furnace_top.png", "blast_furnace_top.png", + "blast_furnace_side.png", "blast_furnace_side.png", + "blast_furnace_side.png", {name = "blast_furnace_front_on.png", + animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 48}}, + }, + paramtype2 = "facedir", + paramtype = "light", + light_source = LIGHT_ACTIVE_FURNACE, + drop = "mcl_furnaces:blast_furnace", + groups = {pickaxey=1, container=4, deco_block=1, not_in_creative_inventory=1, material_stone=1}, + is_ground_content = false, + sounds = mcl_sounds.node_sound_stone_defaults(), + on_timer = furnace_node_timer, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + local meta = minetest.get_meta(pos) + local meta2 = meta + meta:from_table(oldmetadata) + local inv = meta:get_inventory() + for _, listname in ipairs({"src", "dst", "fuel"}) do + local stack = inv:get_stack(listname, 1) + 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} + minetest.add_item(p, stack) + end + end + meta:from_table(meta2:to_table()) + end, + + on_construct = function(pos) + local node = minetest.get_node(pos) + spawn_flames(pos, node.param2) + end, + on_destruct = function(pos) + mcl_particles.delete_node_particlespawners(pos) + give_xp(pos) + end, + + allow_metadata_inventory_put = allow_metadata_inventory_put, + allow_metadata_inventory_move = allow_metadata_inventory_move, + allow_metadata_inventory_take = allow_metadata_inventory_take, + on_metadata_inventory_move = on_metadata_inventory_move, + on_metadata_inventory_take = on_metadata_inventory_take, + on_receive_fields = receive_fields, + _mcl_blast_resistance = 3.5, + _mcl_hardness = 3.5, + on_rotate = on_rotate, + after_rotate = after_rotate_active, +}) + +minetest.register_craft({ + output = "mcl_furnaces:blast_furnace", + recipe = { + { "mcl_core:iron_ingot", "mcl_core:iron_ingot", "mcl_core:iron_ingot" }, + { "mcl_core:iron_ingot", "mcl_furnaces:furnace", "mcl_core:iron_ingot" }, + { "mcl_core:stone_smooth", "mcl_core:stone_smooth", "mcl_core:stone_smooth" }, + } +}) + +-- Add entry alias for the Help +if minetest.get_modpath("doc") then + doc.add_entry_alias("nodes", "mcl_furnaces:blast_furnace", "nodes", "mcl_furnaces:blast_furnace_active") +end + +minetest.register_lbm({ + label = "Active furnace flame particles", + name = "mcl_furnaces:flames", + nodenames = {"mcl_furnaces:blast_furnace_active"}, + run_at_every_load = true, + action = function(pos, node) + spawn_flames(pos, node.param2) + end, +}) + +-- Legacy +minetest.register_lbm({ + label = "Update furnace formspecs (0.60.0)", + name = "mcl_furnaces:update_formspecs_0_60_0", + -- Only update inactive furnaces because active ones should update themselves + nodenames = { "mcl_furnaces:blast_furnace" }, + run_at_every_load = false, + action = function(pos, node) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", inactive_formspec) + end, +}) From 832eb497baa1696bcb1a1f3d85e5c7e65dd7266b Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Fri, 4 Mar 2022 16:58:19 +0000 Subject: [PATCH 5/7] added smoker.lua --- mods/ITEMS/mcl_furnaces/smoker.lua | 549 +++++++++++++++++++++++++++++ 1 file changed, 549 insertions(+) create mode 100644 mods/ITEMS/mcl_furnaces/smoker.lua diff --git a/mods/ITEMS/mcl_furnaces/smoker.lua b/mods/ITEMS/mcl_furnaces/smoker.lua new file mode 100644 index 000000000..ba53f3fc1 --- /dev/null +++ b/mods/ITEMS/mcl_furnaces/smoker.lua @@ -0,0 +1,549 @@ + +local S = minetest.get_translator(minetest.get_current_modname()) + +local LIGHT_ACTIVE_FURNACE = 13 + +-- +-- Formspecs +-- + +local function active_formspec(fuel_percent, item_percent) + return "size[9,8.75]".. + "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. + "list[current_player;main;0,4.5;9,3;9]".. + mcl_formspec.get_itemslot_bg(0,4.5,9,3).. + "list[current_player;main;0,7.74;9,1;]".. + mcl_formspec.get_itemslot_bg(0,7.74,9,1).. + "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Smoker"))).."]".. + "list[context;src;2.75,0.5;1,1;]".. + 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(2.75,2.5,1,1).. + "list[context;dst;5.75,1.5;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:".. + (100-fuel_percent)..":default_furnace_fire_fg.png]".. + "image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[lowpart:".. + (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. + -- Craft guide button temporarily removed due to Minetest bug. + -- TODO: Add it back when the Minetest bug is fixed. + --"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. + --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. + "listring[context;dst]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + "listring[context;fuel]".. + "listring[current_player;main]" +end + +local inactive_formspec = "size[9,8.75]".. + "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. + "list[current_player;main;0,4.5;9,3;9]".. + mcl_formspec.get_itemslot_bg(0,4.5,9,3).. + "list[current_player;main;0,7.74;9,1;]".. + mcl_formspec.get_itemslot_bg(0,7.74,9,1).. + "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Smoker"))).."]".. + "list[context;src;2.75,0.5;1,1;]".. + 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(2.75,2.5,1,1).. + "list[context;dst;5.75,1.5;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]".. + "image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]".. + -- Craft guide button temporarily removed due to Minetest bug. + -- TODO: Add it back when the Minetest bug is fixed. + --"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. + --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. + "listring[context;dst]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + "listring[context;fuel]".. + "listring[current_player;main]" + +local receive_fields = function(pos, formname, fields, sender) + if fields.craftguide then + mcl_craftguide.show(sender:get_player_name()) + end +end + +local function give_xp(pos, player) + local meta = minetest.get_meta(pos) + local dir = vector.divide(minetest.facedir_to_dir(minetest.get_node(pos).param2),-1.95) + local xp = meta:get_int("xp") + if xp > 0 then + if player then + mcl_experience.add_xp(player, xp) + else + mcl_experience.throw_xp(vector.add(pos, dir), xp) + end + meta:set_int("xp", 0) + end +end + +-- +-- Node callback functions that are the same for active and inactive furnace +-- + +local function allow_metadata_inventory_put(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + end + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if listname == "fuel" then + return 0 + end + + -- Test stack with size 1 because we burn one fuel at a time + local teststack = ItemStack(stack) + teststack:set_count(1) + local output, decremented_input = minetest.get_craft_result({method="fuel", width=1, items={teststack}}) + if output.time ~= 0 then + -- Only allow to place 1 item if fuel get replaced by recipe. + -- This is the case for lava buckets. + local replace_item = decremented_input.items[1] + if replace_item:is_empty() then + -- For most fuels, just allow to place everything + return stack:get_count() + else + if inv:get_stack(listname, index):get_count() == 0 then + return 1 + else + return 0 + end + end + else + return 0 + end + elseif listname == "src" then + return stack:get_count() + elseif listname == "dst" then + return 0 + end +end + +local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stack = inv:get_stack(from_list, from_index) + return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) +end + +local function allow_metadata_inventory_take(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + end + return stack:get_count() +end + +local function on_metadata_inventory_take(pos, listname, index, stack, player) + -- Award smelting achievements + if listname == "dst" then + if stack:get_name() == "mcl_fishing:fish_cooked" then + awards.unlock(player:get_player_name(), "mcl:cookFish") + end + give_xp(pos, player) + end +end + +local function on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + if from_list == "dst" then + give_xp(pos, player) + end +end + +local function spawn_flames(pos, param2) + local minrelpos, maxrelpos + local dir = minetest.facedir_to_dir(param2) + if dir.x > 0 then + minrelpos = { x = -0.6, y = -0.05, z = -0.25 } + maxrelpos = { x = -0.55, y = -0.45, z = 0.25 } + elseif dir.x < 0 then + minrelpos = { x = 0.55, y = -0.05, z = -0.25 } + maxrelpos = { x = 0.6, y = -0.45, z = 0.25 } + elseif dir.z > 0 then + minrelpos = { x = -0.25, y = -0.05, z = -0.6 } + maxrelpos = { x = 0.25, y = -0.45, z = -0.55 } + elseif dir.z < 0 then + minrelpos = { x = -0.25, y = -0.05, z = 0.55 } + maxrelpos = { x = 0.25, y = -0.45, z = 0.6 } + else + return + end + mcl_particles.add_node_particlespawner(pos, { + amount = 4, + time = 0, + minpos = vector.add(pos, minrelpos), + maxpos = vector.add(pos, maxrelpos), + minvel = { x = -0.01, y = 0, z = -0.01 }, + maxvel = { x = 0.01, y = 0.1, z = 0.01 }, + minexptime = 0.3, + maxexptime = 0.6, + minsize = 0.4, + maxsize = 0.8, + texture = "mcl_particles_flame.png", + glow = LIGHT_ACTIVE_FURNACE, + }, "low") +end + +local function swap_node(pos, name) + local node = minetest.get_node(pos) + if node.name == name then + return + end + node.name = name + minetest.swap_node(pos, node) + if name == "mcl_furnaces:smoker_active" then + spawn_flames(pos, node.param2) + else + mcl_particles.delete_node_particlespawners(pos) + end +end + +local function furnace_node_timer(pos, elapsed) + -- + -- Inizialize metadata + -- + local meta = minetest.get_meta(pos) + local fuel_time = meta:get_float("fuel_time") or 0 + local src_time = meta:get_float("src_time") or 0 + local src_item = meta:get_string("src_item") or "" + local fuel_totaltime = meta:get_float("fuel_totaltime") or 0 + + local inv = meta:get_inventory() + local srclist, fuellist + + local cookable, cooked + local active = true + local fuel + + srclist = inv:get_list("src") + fuellist = inv:get_list("fuel") + + -- Check if src item has been changed + if srclist[1]:get_name() ~= src_item then + -- Reset cooking progress in this case + src_time = 0 + src_item = srclist[1]:get_name() + end + + local update = true + local elapsed_game_time = mcl_time.get_irl_seconds_passed_at_pos_or_nil(pos) or elapsed + while elapsed_game_time > 0.00001 and update do + -- + -- Cooking + -- + + local el = elapsed_game_time + + -- Check if we have cookable content: cookable + local aftercooked + cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) + cookable = false + cookableItems = {"mcl_fishing:fish_raw", "mcl_fishing:salmon_raw", "mcl_farming:potato_item", "mcl_mobitems:mutton", "mcl_mobitems:beef", "mcl_mobitems:chicken", "mcl_mobitems:porkchop", "mcl_mobitems:rabbit"} + --for _, item in ipairs(cookableItems) do + for _,item in ipairs(cookableItems) do + local stack = inv:get_stack("src",1) + if stack:get_name() == item then + cookable = true + end + end + if cookable then + -- Successful cooking requires space in dst slot and time + if not inv:room_for_item("dst", cooked.item) then + cookable = false + end + end + + if cookable then -- fuel lasts long enough, adjust el to cooking duration + el = math.min(el, cooked.time - src_time) + end + + -- Check if we have enough fuel to burn + active = fuel_time < fuel_totaltime + if cookable and not active then + -- We need to get new fuel + local afterfuel + fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) + + if fuel.time == 0 then + -- No valid fuel in fuel list -- stop + fuel_totaltime = 0 + src_time = 0 + update = false + else + -- Take fuel from fuel list + inv:set_stack("fuel", 1, afterfuel.items[1]) + fuel_time = 0 + fuel_totaltime = fuel.time + el = math.min(el, fuel_totaltime) + active = true + fuellist = inv:get_list("fuel") + end + elseif active then + el = math.min(el, fuel_totaltime - fuel_time) + -- The furnace is currently active and has enough fuel + fuel_time = fuel_time + el + end + + -- If there is a cookable item then check if it is ready yet + if cookable and active then + -- in the src_time variable, the *1.5 is the multiplication that makes the smoker work faster than a normal furnace. I (PrairieWind) have it at 1.5 times faster, but it can be OP and 2 times faster, or 1.2 times faster. All are good numbers. + src_time = (src_time + el)*1.5 + -- Place result in dst list if done + if src_time >= cooked.time then + inv:add_item("dst", cooked.item) + inv:set_stack("src", 1, aftercooked.items[1]) + + srclist = inv:get_list("src") + src_time = 0 + + meta:set_int("xp", meta:get_int("xp") + 1) -- ToDo give each recipe an idividial XP count + end + end + + elapsed_game_time = elapsed_game_time - el + end + + if fuel and fuel_totaltime > fuel.time then + fuel_totaltime = fuel.time + end + if srclist and srclist[1]:is_empty() then + src_time = 0 + end + + -- + -- Update formspec and node + -- + local formspec = inactive_formspec + local item_percent = 0 + if cookable then + item_percent = math.floor(src_time / cooked.time * 100) + end + + local result = false + + if active then + local fuel_percent = 0 + if fuel_totaltime > 0 then + fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) + end + formspec = active_formspec(fuel_percent, item_percent) + swap_node(pos, "mcl_furnaces:smoker_active") + -- make sure timer restarts automatically + result = true + else + swap_node(pos, "mcl_furnaces:smoker") + -- stop timer on the inactive furnace + minetest.get_node_timer(pos):stop() + end + + -- + -- Set meta values + -- + meta:set_float("fuel_totaltime", fuel_totaltime) + meta:set_float("fuel_time", fuel_time) + meta:set_float("src_time", src_time) + if srclist then + meta:set_string("src_item", src_item) + else + meta:set_string("src_item", "") + end + meta:set_string("formspec", formspec) + + return result +end + +local on_rotate, after_rotate_active +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.rotate_simple + after_rotate_active = function(pos) + local node = minetest.get_node(pos) + mcl_particles.delete_node_particlespawners(pos) + if node.name == "mcl_furnaces:smoker" then + return + end + spawn_flames(pos, node.param2) + end +end + +minetest.register_node("mcl_furnaces:smoker", { + description = S("Smoker"), + _tt_help = S("Uses fuel to smelt or cook items"), + _doc_items_longdesc = S("Smokers cook or smelt several items, using a furnace fuel, into something else, but faster than a normal furnace."), + _doc_items_usagehelp = + S([[ + Use the furnace to open the furnace menu. + Place a furnace fuel in the lower slot and the source material in the upper slot. + The furnace will slowly use its fuel to smelt the item. + The result will be placed into the output slot at the right side. + ]]).."\n".. + S("Use the recipe book to see what you can smelt, what you can use as fuel and how long it will burn."), + _doc_items_hidden = false, + tiles = { + "smoker_top.png", "smoker_top.png", + "smoker_side.png", "smoker_side.png", + "smoker_side.png", "smoker_front.png" + }, + paramtype2 = "facedir", + groups = {pickaxey=1, container=4, deco_block=1, material_stone=1}, + is_ground_content = false, + sounds = mcl_sounds.node_sound_stone_defaults(), + + on_timer = furnace_node_timer, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + local meta = minetest.get_meta(pos) + local meta2 = meta:to_table() + meta:from_table(oldmetadata) + local inv = meta:get_inventory() + for _, listname in ipairs({"src", "dst", "fuel"}) do + local stack = inv:get_stack(listname, 1) + 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} + minetest.add_item(p, stack) + end + end + meta:from_table(meta2) + end, + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", inactive_formspec) + local inv = meta:get_inventory() + inv:set_size("src", 1) + inv:set_size("fuel", 1) + inv:set_size("dst", 1) + end, + on_destruct = function(pos) + mcl_particles.delete_node_particlespawners(pos) + give_xp(pos) + end, + + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + -- Reset accumulated game time when player works with furnace: + mcl_time.touch(pos) + minetest.get_node_timer(pos):start(1.0) + + on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + end, + on_metadata_inventory_put = function(pos) + -- Reset accumulated game time when player works with furnace: + mcl_time.touch(pos) + -- start timer function, it will sort out whether furnace can burn or not. + minetest.get_node_timer(pos):start(1.0) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + -- Reset accumulated game time when player works with furnace: + mcl_time.touch(pos) + -- start timer function, it will helpful if player clears dst slot + minetest.get_node_timer(pos):start(1.0) + + on_metadata_inventory_take(pos, listname, index, stack, player) + end, + + allow_metadata_inventory_put = allow_metadata_inventory_put, + allow_metadata_inventory_move = allow_metadata_inventory_move, + allow_metadata_inventory_take = allow_metadata_inventory_take, + on_receive_fields = receive_fields, + _mcl_blast_resistance = 3.5, + _mcl_hardness = 3.5, + on_rotate = on_rotate, +}) + +minetest.register_node("mcl_furnaces:smoker_active", { + description = S("Burning Furnace"), + _doc_items_create_entry = false, + tiles = { + "smoker_top.png", "smoker_top.png", + "smoker_side.png", "smoker_side.png", + "smoker_side.png", {name = "smoker_front_on.png", + animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 48}}, + }, + paramtype2 = "facedir", + paramtype = "light", + light_source = LIGHT_ACTIVE_FURNACE, + drop = "mcl_furnaces:smoker", + groups = {pickaxey=1, container=4, deco_block=1, not_in_creative_inventory=1, material_stone=1}, + is_ground_content = false, + sounds = mcl_sounds.node_sound_stone_defaults(), + on_timer = furnace_node_timer, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + local meta = minetest.get_meta(pos) + local meta2 = meta + meta:from_table(oldmetadata) + local inv = meta:get_inventory() + for _, listname in ipairs({"src", "dst", "fuel"}) do + local stack = inv:get_stack(listname, 1) + 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} + minetest.add_item(p, stack) + end + end + meta:from_table(meta2:to_table()) + end, + + on_construct = function(pos) + local node = minetest.get_node(pos) + spawn_flames(pos, node.param2) + end, + on_destruct = function(pos) + mcl_particles.delete_node_particlespawners(pos) + give_xp(pos) + end, + + allow_metadata_inventory_put = allow_metadata_inventory_put, + allow_metadata_inventory_move = allow_metadata_inventory_move, + allow_metadata_inventory_take = allow_metadata_inventory_take, + on_metadata_inventory_move = on_metadata_inventory_move, + on_metadata_inventory_take = on_metadata_inventory_take, + on_receive_fields = receive_fields, + _mcl_blast_resistance = 3.5, + _mcl_hardness = 3.5, + on_rotate = on_rotate, + after_rotate = after_rotate_active, +}) + +minetest.register_craft({ + output = "mcl_furnaces:smoker", + recipe = { + { "", "group:tree", "" }, + { "group:tree", "mcl_furnaces:furnace", "group:tree" }, + { "", "group:tree", "" }, + } +}) + +-- Add entry alias for the Help +if minetest.get_modpath("doc") then + doc.add_entry_alias("nodes", "mcl_furnaces:smoker", "nodes", "mcl_furnaces:smoker_active") +end + +minetest.register_lbm({ + label = "Active furnace flame particles", + name = "mcl_furnaces:flames", + nodenames = {"mcl_furnaces:smoker_active"}, + run_at_every_load = true, + action = function(pos, node) + spawn_flames(pos, node.param2) + end, +}) + +-- Legacy +minetest.register_lbm({ + label = "Update furnace formspecs (0.60.0)", + name = "mcl_furnaces:update_formspecs_0_60_0", + -- Only update inactive furnaces because active ones should update themselves + nodenames = { "mcl_furnaces:smoker" }, + run_at_every_load = false, + action = function(pos, node) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", inactive_formspec) + end, +}) From 5dbd695bbc72f2dfe9f9b6ff64bf17b630e9e062 Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Fri, 4 Mar 2022 16:59:37 +0000 Subject: [PATCH 6/7] added smoker textures --- .../mcl_furnaces/textures/smoker_bottom.png | Bin 0 -> 496 bytes .../ITEMS/mcl_furnaces/textures/smoker_front.png | Bin 0 -> 525 bytes .../mcl_furnaces/textures/smoker_front_on.png | Bin 0 -> 809 bytes .../mcl_furnaces/textures/smoker_front_on_e.png | Bin 0 -> 7080 bytes .../textures/smoker_front_on_e_s.png | Bin 0 -> 5340 bytes 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 mods/ITEMS/mcl_furnaces/textures/smoker_bottom.png create mode 100644 mods/ITEMS/mcl_furnaces/textures/smoker_front.png create mode 100644 mods/ITEMS/mcl_furnaces/textures/smoker_front_on.png create mode 100644 mods/ITEMS/mcl_furnaces/textures/smoker_front_on_e.png create mode 100644 mods/ITEMS/mcl_furnaces/textures/smoker_front_on_e_s.png diff --git a/mods/ITEMS/mcl_furnaces/textures/smoker_bottom.png b/mods/ITEMS/mcl_furnaces/textures/smoker_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..cccc5a697263d59c911d253fa67453224eef36e0 GIT binary patch literal 496 zcmVf!R^r`gx+%KDbP#r`EyHgDA)%l5J;06>R^N2g_TerhxD+ODy=;iiFwa_ z^Q~Q8oIe4)|L_rj$@ej_Z13!ae{36lxdLGA^5Xoda=-b-1^}|iDJz34asbN8BniF! z8Gk6mCfVEG3B%zv`?3g5o#^kA$RZDV|GwJaB@3C`3Z-=ja@PFQTW;^ZarW*s*cQ_% z<$M7^=8UBy3zXJO?jHbn{z3$2k++gS0Ht+EupT?a!Cvo-UD|_BY&w*cN#I-ssmNP(2Ogr=Z@Nj#{lSQi zED{6&Cif4FA7?mYQy4#g>L;zo)xTcf)JqnE?ZX3pI#;7`blgp5Z61+qtEIn(`{=lv zq7Vnmwn}D}ZABCE1ch?GNUHfm@uIY5F`e?VvxPI3@#AcnOsfdA3OWE+{iw+VP>4;= mdME#l#wOPoQ`*zo)A=t4QMLUS$B3Z-0000Px#32;bRa{vGi!2kdb!2!6DYwZ9400(qQO+^Rd3=Rb(2uqJ4WB>pGpGibPR4C7F zQNd2zKoEUcIh3&5;KZ(_2wVgN44e?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 nJT?!;V#z~!FcwSxWjy!^fJ~{s3zS3Y00000NkvXXu0mjfQQl=x literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_furnaces/textures/smoker_front_on_e.png b/mods/ITEMS/mcl_furnaces/textures/smoker_front_on_e.png new file mode 100644 index 0000000000000000000000000000000000000000..e571d18ed9baccbe434aa9480778af28174a77e0 GIT binary patch literal 7080 zcmeHKdpy+H`yb?z601Za(;!M?t}Zh>?gmpPLhhI5@|iJ=nK3gAgHj5)6=EZ#B)X`r zqzjc=BDc1rv}D7|N~tW8OTM2`Tl#(Xx8L8sUcc{u8FM-3yr1{;ocDR2bIxa<>lQ~P zMNLHr1foQ8vUdZ&Rlqk=K@R-X2%7SOKo*O|9^OJXiU`W%a~Ui)02M~_04NZ}Vn85K zztsN_nx(gX*`7H;iiI>{t@$$5?Nw%-{jVMAo@B3x{jIbHwvmx8Ojp;YF<=Dta&BgN z&(60$__ZBPnK1QDo$1)>SmZx8Id%9Rs(woASDn6w`X8o`#>Qq|jj*cWj!o?N(7z)k z$YE2q(R)hq$ZN#QVfB(54X=Nd6T5hD?DJB`*96zdZ+JgW6e}Zxnp47rv*C-Yf(FOW zXMGSS#TZVd&Egv0-P?AzN0pOXAR_7WTl8;A8@?;F&GSzi^d3nlfPM3Bg$>&r0S5bUgctG$B-raiS{BdT_Tj#-(n75k< zdCL<@H}B;s&(#f!Dm91J0IWYlq&qwQ{i*_ZWB2bp@}qc4Dn?yE!21sYXe#^8H>b-|cvc)AAf+JBCq( zDXW52-Dh?wc-#FGrvj4N0>!T$_&x5i(}~L)->4~c=}zN(hMD`Jo@0QUu4&{=`}HH$|IXjI&S%1Jhh6s z<5=!(_sF5L$44CDamBeh$43&T_Gwyeo7I2?;4)KJB@g6V`y-@P@Ift9mrKuiN2?Fj zhntYmTbpE=rKuVUj|wjojO}~MZH&7Ge>i2;n`?DoiTbsj(pPy$r?r3Eap#qKdBw2l zn$1xv*MO*O%_Rd3GS&CG2Td+n#Vy-8F8}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c Date: Fri, 4 Mar 2022 17:11:16 +0000 Subject: [PATCH 7/7] updated README --- mods/ITEMS/mcl_furnaces/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ITEMS/mcl_furnaces/README.md b/mods/ITEMS/mcl_furnaces/README.md index c7282124b..01ddc0a68 100644 --- a/mods/ITEMS/mcl_furnaces/README.md +++ b/mods/ITEMS/mcl_furnaces/README.md @@ -6,6 +6,7 @@ License of source code LGPLv2.1 Based on code from Minetest Game. Modified by Wuzzy. +Smokers and Blast Furnaces added and modified by PrairieWind and j45. License of media ----------------