correct smelter swapping
parent
c61bef845a
commit
5db782bade
|
@ -4,6 +4,7 @@ local viscosity=1
|
||||||
minerdream.ingot_stack_max = minetest.settings:get("minerdream.ingot_stack_max") or 250
|
minerdream.ingot_stack_max = minetest.settings:get("minerdream.ingot_stack_max") or 250
|
||||||
minerdream.lump_stack_max = minetest.settings:get("minerdream.lump_stack_max") or 999
|
minerdream.lump_stack_max = minetest.settings:get("minerdream.lump_stack_max") or 999
|
||||||
minerdream.dust_cooking_time_reduce = minetest.settings:get("minerdream.dust_cooking_time_reduce") or 2
|
minerdream.dust_cooking_time_reduce = minetest.settings:get("minerdream.dust_cooking_time_reduce") or 2
|
||||||
|
minerdream.smelter_refractory_duration = minetest.settings:get("minerdream.smelter_refractory_duration") or 5000
|
||||||
|
|
||||||
minerdream.steel_wire="minerdream:steel_wire"
|
minerdream.steel_wire="minerdream:steel_wire"
|
||||||
if minetest.get_modpath("basic_materials") == nil then
|
if minetest.get_modpath("basic_materials") == nil then
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
minerdream.ingot_stack_max (Max stack for ingots) int 250 99 1000
|
minerdream.ingot_stack_max (Max stack for ingots) int 250 99 1000
|
||||||
minerdream.lump_stack_max (Max stack for lumps) int 999 99 1000
|
minerdream.lump_stack_max (Max stack for lumps) int 999 99 1000
|
||||||
minerdream.dust_cooking_time_reduce (Recucing factor for cooking dust instead of lump) float 2 1 5
|
minerdream.dust_cooking_time_reduce (Recucing factor for cooking dust instead of lump) float 2 1 5
|
||||||
|
minerdream.smelter_refractory_duration (Smelting time the refractory lasts) int 6000 600 50000
|
||||||
|
|
|
@ -164,7 +164,7 @@ local function smelter_node_timer(pos, elapsed)
|
||||||
-- is refrac slot filled or empty?
|
-- is refrac slot filled or empty?
|
||||||
if not inv:is_empty("refrac") and (refraclist[1]:get_name() == "default:clay_brick") then
|
if not inv:is_empty("refrac") and (refraclist[1]:get_name() == "default:clay_brick") then
|
||||||
inv:remove_item("refrac",ItemStack("default:clay_brick"))
|
inv:remove_item("refrac",ItemStack("default:clay_brick"))
|
||||||
refrac_time=refrac_time + 6000
|
refrac_time=refrac_time + minerdream.smelter_refractory_duration
|
||||||
else
|
else
|
||||||
cookable = false
|
cookable = false
|
||||||
end
|
end
|
||||||
|
@ -233,8 +233,9 @@ local function smelter_node_timer(pos, elapsed)
|
||||||
local formspec
|
local formspec
|
||||||
local item_state
|
local item_state
|
||||||
local item_percent = 0
|
local item_percent = 0
|
||||||
|
local refrac_percent = 0
|
||||||
if cookable then
|
if cookable then
|
||||||
refrac_percent = math.floor (refrac_time / 60)
|
refrac_percent = math.min(100, math.floor (refrac_time / minerdream.smelter_refractory_duration * 100))
|
||||||
item_percent = math.floor(src_time / cooked.time * 100)
|
item_percent = math.floor(src_time / cooked.time * 100)
|
||||||
if item_percent > 100 then
|
if item_percent > 100 then
|
||||||
item_state = "100% (output full)"
|
item_state = "100% (output full)"
|
||||||
|
@ -266,7 +267,7 @@ local function smelter_node_timer(pos, elapsed)
|
||||||
fuel_state = "0%"
|
fuel_state = "0%"
|
||||||
end
|
end
|
||||||
formspec = M.get_smelter_inactive_formspec()
|
formspec = M.get_smelter_inactive_formspec()
|
||||||
swap_node(pos, "default:smelter")
|
swap_node(pos, "minerdream:smelter")
|
||||||
-- stop timer on the inactive furnace
|
-- stop timer on the inactive furnace
|
||||||
minetest.get_node_timer(pos):stop()
|
minetest.get_node_timer(pos):stop()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue