1
0
Fork 0

Merge pull request 'Properly fix smokers, & blast_furnaces to work at twice the rate of a furnace.' (#2344) from fix_blast_furnaces_and_smokers_properly into master

Reviewed-on: MineClone2/MineClone2#2344
Reviewed-by: cora <cora@noreply.git.minetest.land>
This commit is contained in:
cora 2022-06-21 10:32:15 +00:00
commit 432ec760b7
2 changed files with 8 additions and 8 deletions

View File

@ -288,7 +288,8 @@ local function blast_furnace_node_timer(pos, elapsed)
-- Cooking -- Cooking
-- --
local el = elapsed_game_time -- Run the blast_furnace at twice the speed of a furnace.
local el = elapsed_game_time * 2
-- Check if we have cookable content: cookable -- Check if we have cookable content: cookable
local aftercooked local aftercooked
@ -329,13 +330,12 @@ local function blast_furnace_node_timer(pos, elapsed)
elseif active then elseif active then
el = math.min(el, fuel_totaltime - fuel_time) el = math.min(el, fuel_totaltime - fuel_time)
-- The furnace is currently active and has enough fuel -- The furnace is currently active and has enough fuel
fuel_time = (fuel_time + el) *2 --multiply speed of fuel consumption to match proper output fuel_time = fuel_time + el
end end
-- If there is a cookable item then check if it is ready yet -- If there is a cookable item then check if it is ready yet
if cookable and active then if cookable and active then
-- In the src_time variable, the *2 is the multiplication that makes the blast furnace work faster than a normal furnace. src_time = src_time + el
src_time = (src_time + el)*2
-- Place result in dst list if done -- Place result in dst list if done
if src_time >= cooked.time then if src_time >= cooked.time then
inv:add_item("dst", cooked.item) inv:add_item("dst", cooked.item)

View File

@ -288,7 +288,8 @@ local function smoker_node_timer(pos, elapsed)
-- Cooking -- Cooking
-- --
local el = elapsed_game_time -- Run the smoker at twice the speed of a furnace.
local el = elapsed_game_time * 2
-- Check if we have cookable content: cookable -- Check if we have cookable content: cookable
local aftercooked local aftercooked
@ -329,13 +330,12 @@ local function smoker_node_timer(pos, elapsed)
elseif active then elseif active then
el = math.min(el, fuel_totaltime - fuel_time) el = math.min(el, fuel_totaltime - fuel_time)
-- The furnace is currently active and has enough fuel -- The furnace is currently active and has enough fuel
fuel_time = ( fuel_time + el ) * 2 fuel_time = fuel_time + el
end end
-- If there is a cookable item then check if it is ready yet -- If there is a cookable item then check if it is ready yet
if cookable and active then if cookable and active then
-- In the src_time variable, the *2 is the multiplication that makes the smoker work faster than a normal furnace. src_time = src_time + el
src_time = (src_time + el)*2
-- Place result in dst list if done -- Place result in dst list if done
if src_time >= cooked.time then if src_time >= cooked.time then
inv:add_item("dst", cooked.item) inv:add_item("dst", cooked.item)