Crafting and Crafting

This commit is contained in:
ConfidentOwl 2022-12-27 22:02:00 +03:00
parent 94c1ed1b15
commit 9822b60f17
4 changed files with 209 additions and 89 deletions

View File

@ -163,4 +163,14 @@ minetest.register_node("owl_tech:bronze_blast_furnace_controller", {
set_formspect_bronze_blast_furnance(meta)
timer:start(0.2)
end
})
--Crafte controller
minetest.register_craft({
type = "shaped",
output = "owl_tech:bronze_blast_furnace_controller",
recipe = {
{"mcl_furnaces:furnace","owl_tech:bronze_plate","mcl_furnaces:furnace"},
{"owl_tech:bronze_plate","mcl_furnaces:furnace","owl_tech:bronze_plate"},
{"owl_tech:bronze_plate","owl_tech:bronze_plate","owl_tech:bronze_plate"}
}
})

View File

@ -1,79 +1,3 @@
local S = minetest.get_translator(minetest.get_current_modname())
local decor_list={
{"iron","Iron ","#f7f7f7"},
{"copper","Copper ","#ff5e00"},
{"tin","Tin ","#c9c9c9"},
{"gold","Gold ","#ffe600"},
{"silver","Silver ","#d1d1d1"},
{"lead","Lead ","#9092ab"},
{"steal","Steal ","#575757"},
{"bronze","Bronze ","#a35900"},
}
for i, value in pairs(decor_list) do
minetest.register_node("owl_tech:"..value[1].."_briks", {
description = S(value[2].." briks"),
_doc_items_longdesc = S("Part of multiblocks -safe for decor"),
tiles = {
"owl_tech_base_briks.png^[colorize:"..value[3]..":128"
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2 },
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5
})
minetest.register_node("owl_tech:"..value[1].."_frames", {
description = S(value[2].." frames"),
_doc_items_longdesc = S("Part of multiblocks -safe for decor"),
tiles = {
"owl_tech_base_frame.png^[colorize:"..value[3]..":128"
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2 },
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5
})
minetest.register_node("owl_tech:"..value[1].."_grid", {
description = S(value[2].." grid"),
_doc_items_longdesc = S("Part of multiblocks -safe for decor"),
tiles = {
"owl_tech_base_grid.png^[colorize:"..value[3]..":128"
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2 },
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5
})
minetest.register_node("owl_tech:"..value[1].."_tiles", {
description = S(value[2].." tiles"),
_doc_items_longdesc = S("Part of multiblocks -safe for decor"),
tiles = {
"owl_tech_base_tiles.png^[colorize:"..value[3]..":128"
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2 },
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5
})
minetest.register_node("owl_tech:"..value[1].."_big_tiles", {
description = S(value[2].." big tiles"),
_doc_items_longdesc = S("Part of multiblocks -safe for decor"), --_big_tiles
tiles = {
"owl_tech_base_big_tiles.png^[colorize:"..value[3]..":128"
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2 },
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5
})
end

View File

@ -99,20 +99,20 @@ for i, value in ipairs(ore_for_delite) do
end]]
--wanila res remove !!!!
-- 1)tech_name 2)useal name 3)ineed ore ? 4)pickasxe_level 5)color 6)intrument uses
-- 1)tech_name 2)useal name 3)ineed ore ? 4)pickasxe_level 5)color 6)intrument uses 7)can simple burn ore in furnance ( and dusts)
local metals_ore_array={
{"iron","Iron ",true,3,"#f7f7f7",125},
{"iron","Iron ",true,3,"#f7f7f7",125,true},
{"copper","Copper ",true,2,"#ff5e00",75},
{"tin","Tin ",true,2,"#c9c9c9",88},
{"gold","Gold ",true,2,"#ffe600",50},
{"silver","Silver ",true,3,"#d1d1d1",62},
{"lead","Lead ",true,3,"#9092ab",62},
{"steal","Steal ",false,3,"#575757",300},
{"bronze","Bronze ",false,3,"#a35900",200},
{"tin","Tin ",true,2,"#c9c9c9",88,true},
{"gold","Gold ",true,2,"#ffe600",50,true},
{"silver","Silver ",true,3,"#d1d1d1",62,true},
{"lead","Lead ",true,3,"#9092ab",62,true},
{"steal","Steal ",false,3,"#575757",300,false},
{"bronze","Bronze ",false,3,"#a35900",200,true},
}
--make metals ALL
for i, value in ipairs(metals_ore_array) do
--ore
--ore
if metals_ore_array[i][3] then
minetest.register_node("owl_tech:"..metals_ore_array[i][1].."_ore", {
description = S(metals_ore_array[i][2].." ore"),
@ -145,6 +145,22 @@ for i, value in ipairs(metals_ore_array) do
stack_max = 64,
groups = { craftitem=1 },
})
if metals_ore_array[i][7] then
--Simple burn ore in ingot
minetest.register_craft({
type = "cooking",
output = "owl_tech:"..metals_ore_array[i][1].."_ingot",
recipe = "owl_tech:"..metals_ore_array[i][1].."_ore",
cooktime = 10,
})
--Simple burn dust in ingot
minetest.register_craft({
type = "cooking",
output = "owl_tech:"..metals_ore_array[i][1].."_ingot",
recipe = "owl_tech:"..metals_ore_array[i][1].."_dust",
cooktime = 10,
})
end
--dust
minetest.register_craftitem("owl_tech:"..metals_ore_array[i][1].."_dust", {
description = S(metals_ore_array[i][2].. " dust"),
@ -420,7 +436,8 @@ for i, value in ipairs(metals_ore_array) do
_doc_items_longdesc = S(metals_ore_array[i][2].. " stick"),
inventory_image = "owl_tech_stick.png^[colorize:"..metals_ore_array[i][5]..":128",
stack_max = 64,
groups = { craftitem=1 },
groups = { craftitem=1 },
})
--carfte stick
minetest.register_craft({
type = "shapeless",
@ -430,7 +447,6 @@ for i, value in ipairs(metals_ore_array) do
{"owl_tech:work_file","owl_tech:work_file"},
}
})
})
--Block
minetest.register_node("owl_tech:"..metals_ore_array[i][1].."block", {
description = S("Block of "..metals_ore_array[i][2]),
@ -455,6 +471,66 @@ for i, value in ipairs(metals_ore_array) do
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
})
--metal briks
minetest.register_node("owl_tech:"..value[1].."_briks", {
description = S(value[2].." briks"),
_doc_items_longdesc = S("Part of multiblocks -safe for decor"),
tiles = {"owl_tech_base_briks.png^[colorize:"..value[5]..":128"},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2 },
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5
})
--frames
minetest.register_node("owl_tech:"..value[1].."_frames", {
description = S(value[2].." frames"),
_doc_items_longdesc = S("Part of multiblocks -safe for decor"),
tiles = {"owl_tech_base_frame.png^[colorize:"..value[5]..":128"},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2 },
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5
})
--grids
minetest.register_node("owl_tech:"..value[1].."_grid", {
description = S(value[2].." grid"),
_doc_items_longdesc = S("Part of multiblocks -safe for decor"),
tiles = {"owl_tech_base_grid.png^[colorize:"..value[5]..":128"},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2 },
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5
})
--tiles
minetest.register_node("owl_tech:"..value[1].."_tiles", {
description = S(value[2].." tiles"),
_doc_items_longdesc = S("Part of multiblocks -safe for decor"),
tiles = {"owl_tech_base_tiles.png^[colorize:"..value[5]..":128"},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2 },
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5
})
--big tiles
minetest.register_node("owl_tech:"..value[1].."_big_tiles", {
description = S(value[2].." big tiles"),
_doc_items_longdesc = S("Part of multiblocks -safe for decor"), --_big_tiles
tiles = {"owl_tech_base_big_tiles.png^[colorize:"..value[5]..":128"},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2 },
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5
})
--Crafte ingot from nugets
minetest.register_craft({
type = "shaped",
@ -606,4 +682,13 @@ for i, value in ipairs(gems_orew_array) do
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
})
end
end
-----------------------------------------------------------------------------------
--Some custom recips
--Crafte bronze dust from copper and tin
minetest.register_craft({
type = "shapeless",
output = "owl_tech:bronze_dust 3",
recipe = {"owl_tech:copper_dust","owl_tech:copper_dust","owl_tech:copper_dust","owl_tech:tin_dust"}
})

View File

@ -117,3 +117,104 @@ minetest.register_node("owl_tech:bronze_boiler", {
timer:start(0.2)
end
})
--Crafte bronze boiler
minetest.register_craft({
type = "shaped",
output = "owl_tech:bronze_boiler",
recipe = {
{"owl_tech:bronze_plate","owl_tech:bronze_plate","owl_tech:bronze_plate"},
{"owl_tech:bronze_plate","mcl_furnaces:furnace","owl_tech:bronze_plate"},
{"owl_tech:bronze_plate","mcl_core:brick_block","owl_tech:bronze_plate"}
}
})
--Steal boiler
minetest.register_node("owl_tech:steal_boiler", {
description = S("Steal boiler"),
_doc_items_longdesc = S("Single node to get generate steam"),
tiles = {
"(owl_tech_base_meshanism_side.png^[colorize:#575757:128)^owl_tech_steam_output.png",
"owl_tech_base_meshanism_side.png^[colorize:#575757:128",
"owl_tech_base_meshanism_side.png^[colorize:#575757:128",
"owl_tech_base_meshanism_side.png^[colorize:#575757:128",
"owl_tech_base_meshanism_side.png^[colorize:#575757:128",
"(owl_tech_base_meshanism_side.png^[colorize:#575757:128)^owl_tech_boiler_face.png",
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2, owl_tech_generator=1 ,fluid_in=1,fuel=1,dst=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,12000,1,0) --water
owl_tech.set_pull_fluid_whitlist(meta,1,"mcl_water") --whitlist for make input ONLY Water
owl_tech.add_new_pull(meta,12000,0,1) --steam
owl_tech.set_pull_fluid_whitlist(meta,2,"owl_tech_steam")--whitlist for make and output ONLY Steam
set_formspect_base_boiler(meta)
owl_tech.prepear_for_make_steam(meta,384,0.75,1.25,0.5) --prepea al meta info for work like boiler
owl_tech.update_fluid_pipe_around(pos)
local timer =minetest.get_node_timer(pos)
local inv = meta:get_inventory()
inv:set_size("fluid_in", 1)
inv:set_size("fuel", 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 fluid_its = inv:get_stack('fluid_in', 1)
local fuel_its = inv:get_stack('fuel', 1)
local dst_its = inv:get_stack('dst', 1)
if not fluid_its:is_empty() then --Load fluid from buckets
owl_tech.add_fluid_in_pull_from_itemslot(meta,fluid_its,inv,dst_its,'fluid_in','dst')
end
if owl_tech.get_fuel_time(meta)>0 then --burn process
owl_tech.fuel_burning(meta)
end
if owl_tech.get_curent_heat(meta)>0 and owl_tech.get_fuel_time(meta)==0 then --coling boiler if not burn
owl_tech.cooling_boiler(meta)
end
if owl_tech.get_curent_heat(meta)>100
and owl_tech.get_pull_volume(meta,2)+owl_tech.get_water_in_steam(meta)*5<=owl_tech.get_pull_max_volume(meta,2)
and owl_tech.get_pull_volume(meta,1)-owl_tech.get_water_in_steam(meta)>=0 then --make steam
owl_tech.gen_steam_in_node_pull(meta,1,2,owl_tech.get_water_in_steam(meta))
if owl_tech.get_pull_fluid_name(meta,2)~="owl_tech_steam" then
owl_tech.set_pull_fluid_name(meta,2,"owl_tech_steam")
end
end
if not fuel_its:is_empty() and owl_tech.get_fuel_time(meta)==0 then --Load fluid from buckets
local out_fuel= minetest.get_craft_result({method = "fuel", width = 1, items = {fuel_its}})
if out_fuel.time>0 then
owl_tech.load_fuel_in_boiler(meta,inv,'fuel',out_fuel,fuel_its)
end
end
if minetest.get_item_group((minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})).name,"fluid_pipe") then --sand in pipe
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_up,"owl_tech_steam",owl_tech.get_fluid_sand_in_tick(meta_up))
local can_do2 ,inde_pull_2 , remove_amount =owl_tech.test_remove_fluid_in_any_pulls(meta,"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_up,"owl_tech_steam",remove_amount,inde_pull)
local pull_curent_volume = owl_tech.get_pull_volume(meta,2)
local difer = pull_curent_volume-remove_amount
owl_tech.set_pull_volume(meta,2,difer)
end
end
owl_tech.delit_name_fluid_if_0(meta)
set_formspect_base_boiler(meta)
timer:start(0.2)
end
})
--Crafte bronze boiler
minetest.register_craft({
type = "shaped",
output = "owl_tech:steal_boiler",
recipe = {
{"owl_tech:steal_plate","owl_tech:steal_plate","owl_tech:steal_plate"},
{"owl_tech:steal_plate","mcl_furnaces:furnace","owl_tech:steal_plate"},
{"owl_tech:steal_plate","mcl_core:brick_block","owl_tech:steal_plate"}
}
})