Add steem furnace

This commit is contained in:
ConfidentOwl 2023-01-01 19:03:59 +03:00
parent 88815c9ea9
commit ba3ba0ec94
1 changed files with 105 additions and 11 deletions

View File

@ -599,7 +599,7 @@ local function set_formspect_base_furnance(meta)
"listring[current_player;main]"
meta:set_string("formspec", formspec)
end
--froge hammer"
--Bronze furnance"
minetest.register_node("owl_tech:bronze_furnance", {
description = S("Bronze furnance"),
_doc_items_longdesc = S("Just a furnance - but use steam energy"),
@ -644,7 +644,7 @@ minetest.register_node("owl_tech:bronze_furnance", {
if owl_tech.get_item_redines(meta)>0 and owl_tech.get_item_redines(meta)<100 then --recipt real
local steam_new =owl_tech.get_pull_volume(meta,1)-10
owl_tech.set_pull_volume(meta,1,steam_new)
owl_tech.add_item_redines(meta,1)
owl_tech.add_item_redines(meta,10)
elseif owl_tech.get_item_redines(meta)>=100 then
input_its:set_count(input_its:get_count()-1) --Remove item from input slot
@ -661,10 +661,10 @@ minetest.register_node("owl_tech:bronze_furnance", {
local steam_new =owl_tech.get_pull_volume(meta,1)-10
owl_tech.set_pull_volume(meta,1,steam_new)
owl_tech.reset_item_redines(meta)
elseif 1000<= owl_tech.get_pull_volume(meta,1) and owl_tech.get_item_redines(meta)==0 then --begin for work
elseif 100<= owl_tech.get_pull_volume(meta,1) and owl_tech.get_item_redines(meta)==0 then --begin for work
local steam_new =owl_tech.get_pull_volume(meta,1)-10
owl_tech.set_pull_volume(meta,1,steam_new)
owl_tech.add_item_redines(meta,1)
owl_tech.add_item_redines(meta,10)
end
else
owl_tech.reset_item_redines(meta)
@ -724,7 +724,7 @@ local function set_formspect_steeel_macerator(meta)
meta:set_string("formspec", formspec)
end
--bronze_macerator"
--steel_macerator"
minetest.register_node("owl_tech:steel_macerator", {
description = S("Steel macerator"),
_doc_items_longdesc = S("Macerate dust"),
@ -827,14 +827,14 @@ minetest.register_node("owl_tech:steel_macerator", {
timer:start(0.2)
end
})
--Crafte "owl_tech:bronze_sieve"
--Crafte "owl_tech:steel_macerator"
minetest.register_craft({
type = "shaped",
output ="owl_tech:bronze_forge_hammer",
output = "owl_tech:steel_macerator",
recipe = {
{"owl_tech:steel_plate","owl_tech:steel_plate","owl_tech:steel_plate"},
{"mcl_core:flint", "mcl_core:flint", "mcl_core:flint"},
{"owl_tech:steel_plate","owl_tech:steel_frames","owl_tech:steel_plate"},
{"owl_tech:steel_plate","mcl_anvils:anvil","owl_tech:stell_plate"}
{"owl_tech:steel_plate","owl_tech:steel_plate","owl_tech:steel_plate"}
}
})
--alloy smelter
@ -866,7 +866,7 @@ local function set_formspect_steel_alloy_smelter(meta)
meta:set_string("formspec", formspec)
end
-------------------------------------------
--bronze_alloy_smelter
--steel_alloy_smelter
minetest.register_node("owl_tech:steel_alloy_smelter", {
description = S("Steel alloy smelter"),
_doc_items_longdesc = S("Smelt alll"),
@ -1120,3 +1120,97 @@ minetest.register_craft({
{"owl_tech:steel_plate","mcl_anvils:anvil","owl_tech:steel_plate"}
}
})
--Bronze furnance"
minetest.register_node("owl_tech:steel_furnance", {
description = S("Steel furnance"),
_doc_items_longdesc = S("Just a furnance - but use steam energy"),
tiles = {
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)",
"owl_tech_base_meshanism_side.png^[colorize:#a35900:128",
"owl_tech_base_meshanism_side.png^[colorize:#a35900:128",
"owl_tech_base_meshanism_side.png^[colorize:#a35900:128",
"owl_tech_base_meshanism_side.png^[colorize:#a35900:128",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_forge_face.png",
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2, owl_tech_machine=1},
sounds = mcl_sounds.node_sound_metal_defaults(),
paramtype2 = "facedir",
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
owl_tech.add_new_pull(meta,8000,1,0) --steam eat 25 steam in 1 tick
owl_tech.set_pull_fluid_whitlist(meta,1,"owl_tech_steam")--whitlist for make and output ONLY Steam
owl_tech.set_mashine_tire(meta,1) --all steam mishine has 1 tire
owl_tech.reset_item_redines(meta)
set_formspect_base_furnance(meta)
owl_tech.update_fluid_pipe_around(pos)
local timer =minetest.get_node_timer(pos)
local inv = meta:get_inventory()
inv:set_size("input_in", 1)
inv:set_size("dst", 1)
timer:start(0.2)
end,
on_timer = function(pos, elapsed)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local input_its = inv:get_stack('input_in', 1)
local dst_its = inv:get_stack('dst', 1)
local aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = {input_its:get_name()}})
if aftercooked.time>0 then
if owl_tech.get_item_redines(meta)>0 and owl_tech.get_item_redines(meta)<100 then --recipt real
local steam_new =owl_tech.get_pull_volume(meta,1)-10
owl_tech.set_pull_volume(meta,1,steam_new)
owl_tech.add_item_redines(meta,1)
elseif owl_tech.get_item_redines(meta)>=100 then
input_its:set_count(input_its:get_count()-1) --Remove item from input slot
inv:set_stack('input_in', 1, input_its)
if not dst_its:is_empty() then-- Add main output
dst_its:set_count(dst_its:get_count()+aftercooked.item:get_count())
inv:set_stack('dst', 1, dst_its)
else
local item =aftercooked.item
dst_its:add_item(item)
inv:set_stack('dst', 1, dst_its)
end
local steam_new =owl_tech.get_pull_volume(meta,1)-10
owl_tech.set_pull_volume(meta,1,steam_new)
owl_tech.reset_item_redines(meta)
elseif 100<= owl_tech.get_pull_volume(meta,1) and owl_tech.get_item_redines(meta)==0 then --begin for work
local steam_new =owl_tech.get_pull_volume(meta,1)-10
owl_tech.set_pull_volume(meta,1,steam_new)
owl_tech.add_item_redines(meta,1)
end
else
owl_tech.reset_item_redines(meta)
end
if minetest.get_item_group((minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})).name,"fluid_pipe") then --get from pipe steam
local meta_up = minetest.get_meta({x=pos.x,y=pos.y-1,z=pos.z})
local can_do ,inde_pull =owl_tech.test_add_fluid_in_any_pulls(meta,"owl_tech_steam",owl_tech.get_fluid_sand_in_tick(meta))
local can_do2 ,inde_pull_2 , remove_amount =owl_tech.test_remove_fluid_in_any_pulls(meta_up,"owl_tech_steam",owl_tech.get_fluid_sand_in_tick(meta_up))
if can_do and can_do2 then
owl_tech.add_fluid_in_node_pull(meta,"owl_tech_steam",remove_amount,inde_pull)
owl_tech.remove_fluid_in_node_pull(meta_up,remove_amount,inde_pull)
end
end
owl_tech.delit_name_fluid_if_0(meta)
set_formspect_base_furnance(meta)
timer:start(0.2)
end
})
--Crafte
minetest.register_craft({
type = "shaped",
output ="owl_tech:steel_furnance",
recipe = {
{"owl_tech:steel_plate","owl_tech:steel_plate","owl_tech:steel_plate"},
{"owl_tech:steel_plate","owl_tech:steel_frames","owl_tech:steel_plate"},
{"owl_tech:steel_plate","mcl_furnaces:furnace","owl_tech:steel_plate"}
}
})