Add a lot of plants

This commit is contained in:
ConfidentOwl 2023-02-01 22:39:37 +03:00
parent 6eaeb8c1a1
commit 06b5466e40
45 changed files with 449 additions and 185 deletions

34
api/farming.lua Normal file
View File

@ -0,0 +1,34 @@
--Is wood in pos
function owl_tech.is_wood_in_pos(pos)
if minetest.get_item_group((minetest.get_node(pos)).name,"tree")>0 then
return true
end
return false
end
---------------------------------------------
--Is leaves in pos
function owl_tech.is_leaf_in_pos(pos)
if minetest.get_item_group((minetest.get_node(pos)).name,"leaves")>0 then
return true
end
return false
end
-------------------------------------------------
--is sapling in pos
function owl_tech.is_sapling(pos)
if minetest.get_item_group((minetest.get_node(pos)).name,"sapling")>0 then
return true
end
return false
end
----------------------------------------------
--can plant sapling in pos
function owl_tech.can_plant_sapling(pos)
if (minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})).name== "mcl_farming:soil_wet"then
return true
end
return false
end
-----------------------------------------------

View File

@ -37,3 +37,4 @@ dofile(minetest.get_modpath("owl_tech") .. "/api/fluid_llogik.lua") --main fail
dofile(minetest.get_modpath("owl_tech") .. "/api/item_logick.lua") --main fail about all item work
dofile(minetest.get_modpath("owl_tech") .. "/api/pipe_logick.lua") --main fail about all pipe work
dofile(minetest.get_modpath("owl_tech") .. "/api/miners.lua") --main fail about all miners work
dofile(minetest.get_modpath("owl_tech") .. "/api/farming.lua") --main fail about all farming

7
config.txt Normal file
View File

@ -0,0 +1,7 @@
-- Confige for mod
--Advaced steam tech ( quary, miners ,etc....)
owl_tech_advanced_steam_machins = true
--X-ray for look ore (can cause lag)
owl_tech_x_ray_look =true

View File

@ -10,7 +10,7 @@ local function spawn_crop_from_seed(pos,itemstack,crop_name)
end
end
local sel_heights = {
local sel_heights = { --take from mc2
-5/16,
-2/16,
0,
@ -59,10 +59,14 @@ end
--1)name 2)Name 3)texture base name 4)stages 5)seed texture 6)drop name 7)drop amount 8)cof of grow to up 9) Special node under dirt
local list_all_crops ={
{"ruber_wheat","Ruber Wheat","owl_tech_ruber_wheat_",8,"owl_tech.seed_ruber_wheat.png","owl_tech:ruber_dust",2,200,"none"},--copgrow
{"coaltus","Coaltus","owl_tech_coaltus_",8,"owl_tech.seed_coaltus.png","owl_tech:coal_dust",1,200,"owl_tech:coal_block"},
{"copgrow","Copgrow","owl_tech_copgrow_",8,"owl_tech.seed_copgrow.png","owl_tech:copper_dust",1,200,"owl_tech:copper_block"},
{"ironmaiden","Iron Maiden","owl_tech_iron_maiden_",8,"owl_tech.seed_iron_maiden.png","owl_tech:iron_dust",1,200,"owl_tech:iron_block"},
{"ruber_wheat","Ruber Wheat","owl_tech_ruber_wheat_",8,"owl_tech.seed_ruber_wheat.png","owl_tech:ruber_dust",2,200,"none"},--ruber
{"coaltus","Coaltus","owl_tech_coaltus_",8,"owl_tech.seed_coaltus.png","owl_tech:coal_dust",1,200,"owl_tech:coal_block"},--coal
{"copgrow","Copgrow","owl_tech_copgrow_",8,"owl_tech.seed_copgrow.png","owl_tech:copper_dust",1,200,"owl_tech:copper_block"},--copper
{"iron_maiden","Iron Maiden","owl_tech_iron_maiden_",8,"owl_tech.seed_iron_maiden.png","owl_tech:iron_dust",1,200,"owl_tech:iron_block"},--gold
{"diamond_king","Diamond king","owl_tech_diamond_king_",8,"owl_tech.seed_king_diamond.png","owl_tech:diamond_dust",1,200,"owl_tech:diamond_block"},--diamond
{"tin_plague","Tin Plague","owl_tech_tin_plague_",8,"owl_tech.seed_tin_plague.png","owl_tech:tin_dust",1,200,"owl_tech:tin_block"},--tin
{"silverr_char","Silver char","owl_tech_silver_char_",8,"owl_tech.seed_silver_char.png","owl_tech:silver_dust",1,200,"owl_tech:silver_block"},--silver
{"steel_ball","Steel ball","owl_tech_steel_ball_",8,"owl_tech.seed_steel_ball.png","owl_tech:steel_dust",1,200,"owl_tech:steel_block"}
}
for i = 1, #list_all_crops, 1 do
@ -147,7 +151,7 @@ for i = 1, #list_all_crops, 1 do
})
end
minetest.register_node("owl_tech:plant_"..list_all_crops[i][1].."8", {
minetest.register_node("owl_tech:plant_"..list_all_crops[i][1], {
description = S("Mature "..list_all_crops[i][2]),
_doc_items_longdesc = S("Mature plants are ready to be harvested for wheat and seeds."),
sunlight_propagates = true,

View File

@ -4,12 +4,14 @@ local path = minetest.get_modpath(name)
local i3_name = minetest.get_modpath('i3')
dofile(path .."/config.txt")-- all config load
dofile(path .. "/api/init.lua") --all base func
dofile(path .. "/tools/init.lua") --Tools
dofile(path .. "/ore/init.lua") --ore loads
dofile(path .. "/debug_tools/init.lua") --debug_tools don.t use in surv game
--dofile(path .. "/xray/init.lua") --xray don.t use in surv game
if owl_tech_x_ray_look then
dofile(path .. "/xray/init.lua") --xray don.t use in surv game
end
dofile(path .. "/steam/init.lua") --main fail about all steam gen
dofile(path .. "/pipe/init.lua") --main fail about all pipes
dofile(path .. "/custom_recips/init.lua") --main fail about all custom recips

View File

@ -72,12 +72,19 @@ FORGE_HAMMER_RECIPS={
}
--List of all crops
LIST_ALL_CROPS={
"mcl_farming:wheat","mcl_farming:pumpkintige_unconnct","mcl_farming:beetroot","mcl_farming:melotige_unconnct","mcl_farming:carrot","mcl_farming:potato_item"
"owl_tech:steel_ball","owl_tech:silverr_char","owl_tech:tin_plague","owl_tech:diamond_king","owl_tech:iron_maiden"
,"owl_tech:copgrow","owl_tech:coaltus","owl_tech:ruber_wheat","mcl_farming:wheat","mcl_farming:pumpkintige_unconnct","mcl_farming:beetroot","mcl_farming:melotige_unconnct","mcl_farming:carrot","mcl_farming:potato_item"
}
--List all crops breed 1)time ,2)name new crop
CROPS_BREED={
wheatwheat={100,"owl_tech:plant_ruber_wheat1"},
beetrootbeetroot={100,"owl_tech:plant_copgrow1"},
carrotcarrot={100,"owl_tech:plant_coaltus"},
potato_itempotato_item={100,"owl_tech:plant_ironmaiden"},
wheatwheat={100,"owl_tech:plant_ruber_wheat1"},--ruber
beetrootbeetroot={100,"owl_tech:plant_copgrow1"},--copper
carrotcarrot={100,"owl_tech:plant_coaltus1"},--coal
potato_itempotato_item={100,"owl_tech:plant_ironmaiden1"},--iron
plant_ironmaidenplant_coaltus={100,"owl_tech:steel_ball1"},--steel
plant_coaltusplant_ironmaiden={100,"owl_tech:steel_ball1"},
plant_coaltusplant_coaltus={100,"owl_tech:diamond_king1"},--diamond
plant_ironmaidenplant_copgrow={100,"owl_tech:tin_plague1"},--tin
plant_copgrowplant_ironmaiden={100,"owl_tech:tin_plague1"},
tin_plaguetin_plague={100,"owl_tech:silverr_char1"}
}

View File

@ -2,11 +2,11 @@ local S = minetest.get_translator(minetest.get_current_modname())
local name = minetest.get_current_modname()
local path = minetest.get_modpath(name)
--USE for get tire machine 1)Name 2)name 3)voltage 4)max_charge 5)color_code 6)metal name for crafte 7)has_macerator 8)help item list 9)has_alloy_smeter 10)has_siev 11)has_furnance 12)forge hammer
--USE for get tire machine 1)Name 2)name 3)voltage 4)max_charge 5)color_code 6)metal name for crafte 7)has_macerator 8)help item list 9)has_alloy_smeter 10)has_siev 11)has_furnance 12)forge hammer 13)has vertical miner 14)delay verticalminer 15)has quarry 16 )distance quarry
-- 10)forge hammer for i, value in ipairs(metals_ore_array) do
local table_all_machines={
{"Base","base",32,1600,"#575757","steel",true,{"owl_tech:diamond","owl_tech:copper_heat_element","owl_tech:steel_mesh","mesecons_pistons:piston_normal_off"},true,true,true,true}
{"Base","base",32,1600,"#575757","steel",true,{"owl_tech:diamond","owl_tech:copper_heat_element","owl_tech:steel_mesh","mesecons_pistons:piston_normal_off"},true,true,true,true,true,18,true,16}
}
for i = 1, #table_all_machines, 1 do
@ -681,4 +681,188 @@ for i = 1, #table_all_machines, 1 do
}
})
end
if table_all_machines[i][13] then
local function set_formspect_steam_vertical_miner(meta)
local max_charge = owl_tech:get_charge_max(meta)
local curent_charge = owl_tech:get_charge(meta)
local redines = owl_tech.get_item_redines(meta)
local 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.25,0;"..minetest.formspec_escape(minetest.colorize("#313131", S(table_all_machines[i][1].."Vertical miner"))).."]"..
"list[context;dst;5.5,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.5,1.5,1,1)..
"label[0,1.5;"..minetest.formspec_escape(minetest.colorize("#313131", (max_charge.."--"..curent_charge.."--"..table_all_machines[i][3]))).."]"..
"label[0,2;"..minetest.formspec_escape(minetest.colorize("#313131", (redines.." / 100"))).."]".. "listring[context;dst]"..
"listring[current_player;main]"..
"listring[current_player;main]"..
"listring[current_player;main]"
meta:set_string("formspec", formspec)
end
minetest.register_node("owl_tech:"..table_all_machines[i][2].."_vertical_miner", {
description = S(table_all_machines[i][1].." vertical miner"),
_doc_items_longdesc = S("Dig the hole"),
tiles = {
"(owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128)^owl_tech_steam_input.png",
"owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128",
"(owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128)^owl_tech_vertical_miner_face.png",
"(owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128)^owl_tech_vertical_miner_face.png",
"(owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128)^owl_tech_vertical_miner_face.png",
"(owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128)^owl_tech_vertical_miner_face.png",
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2, owl_tech_machine=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_electro(pos,table_all_machines[i][3],table_all_machines[i][4])
owl_tech.set_mashine_tire(meta,i+1)
meta:set_int("work_delay",0)
set_formspect_steam_vertical_miner(meta)
owl_tech.prepear_for_verticak_steam_miner(pos)
local timer =minetest.get_node_timer(pos)
local inv = meta:get_inventory()
inv:set_size("dst", 1)
timer:start(2)
end,
on_timer = function(pos, elapsed)
local meta = minetest.get_meta(pos)
local timer = minetest.get_node_timer(pos)
if meta:get_int("get_bedrock")==0 and
owl_tech:get_charge(meta)>=owl_tech:get_voltage(meta) and meta:get_int("work_delay")==0 then
local inv = meta:get_inventory()
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
owl_tech:set_charge(meta,steam_new)
owl_tech.vertical_steam_mine(pos,meta,owl_tech.can_vertical_steam_miner_mine_this(pos,meta))
meta:set_int("work_delay",table_all_machines[i][14])
end
if meta:get_int("work_delay")>0 then
meta:set_int("work_delay",meta:get_int("work_delay")-1)
end
if minetest.get_item_group((minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})).name,"owl_tech_electro_wire")>0
and owl_tech:get_charge_max(meta)-owl_tech:get_charge(meta)>=owl_tech:get_voltage(meta) then --get from wire electro
local meta_up = minetest.get_meta({x=pos.x,y=pos.y+1,z=pos.z})
if owl_tech:get_charge(meta_up)>0 and owl_tech:get_voltage(meta)==owl_tech:get_voltage(meta_up) then
owl_tech.send_electro_from_wire_in_pos(meta_up,pos)
end
end
meta:set_string("infotext",owl_tech:get_charge(meta))
set_formspect_steam_vertical_miner(meta)
timer:start(0.2)
end,
on_destruct = function(pos)
owl_tech.remove_all_pipe_vertical(pos)
end
})
--Crafte "owl_tech:steam_vertical_miner",
minetest.register_craft({
type = "shaped",
output ="owl_tech:"..table_all_machines[i][2].."_vertical_miner",
recipe = {
{"owl_tech:"..table_all_machines[i][6].."_plate","owl_tech:circuit_tire_"..i,"owl_tech:"..table_all_machines[i][6].."_plate"},
{"owl_tech:"..table_all_machines[i][6].."_plate","owl_tech:"..table_all_machines[i][6].."_frames","owl_tech:"..table_all_machines[i][6].."_plate"},
{"owl_tech:iron_item_pipe_input","owl_tech:bronze_fluid_pipe","owl_tech:iron_item_pipe_input"}
}
})
end
if table_all_machines[i][15]then
local function set_formspect_steam_quarry(meta)
local max_charge = owl_tech:get_charge_max(meta)
local curent_charge = owl_tech:get_charge(meta)
local delay = meta:get_int("work_delay")
local 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.25,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Steam vertical miner"))).."]"..
"list[context;dst;5.5,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.5,1.5,1,1)..
"label[0,1.5;"..minetest.formspec_escape(minetest.colorize("#313131", (max_charge.."--"..curent_charge.."--"..table_all_machines[i][3]))).."]"..
"label[0,2.5;"..minetest.formspec_escape(minetest.colorize("#313131", (delay.."--delay"))).."]"..
"listring[context;dst]"..
"listring[current_player;main]"..
"listring[current_player;main]"..
"listring[current_player;main]"
meta:set_string("formspec", formspec)
end
minetest.register_node("owl_tech:"..table_all_machines[i][2].."_quarry", {
description = S(table_all_machines[i][1].." quarry"),
_doc_items_longdesc = S("Dig the Hole"),
tiles = {
"(owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128)^owl_tech_steam_input.png",
"owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128",
"(owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128)^owl_tech_quary.png",
"(owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128)^owl_tech_quary.png",
"(owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128)^owl_tech_quary.png",
"(owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128)^owl_tech_quary.png",
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2, owl_tech_machine=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_electro(pos,table_all_machines[i][3],table_all_machines[i][4])
owl_tech.set_mashine_tire(meta,i+1) --all steam mishine has 1 tire
meta:set_int("work_delay",0)
set_formspect_steam_quarry(meta)
owl_tech.prepear_for_verticak_steam_miner(pos)
local timer =minetest.get_node_timer(pos)
local inv = meta:get_inventory()
inv:set_size("dst", 1)
timer:start(2)
end,
on_timer = function(pos, elapsed)
local meta = minetest.get_meta(pos)
local timer = minetest.get_node_timer(pos)
if meta:get_int("min_x")==0 and meta:get_int("min_z")==0 then
owl_tech.scan_for_point(pos,meta,table_all_machines[i][16])
end
if meta:get_int("get_bedrock")==0 and meta:get_int("work_delay")==0 and
owl_tech:get_charge(meta)>=owl_tech:get_voltage(meta) then
local inv = meta:get_inventory()
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
owl_tech:set_charge(meta,steam_new)
local can_mine = owl_tech.can_quary_mine_this(pos,meta)
owl_tech.diging_quary(pos,meta,can_mine)
meta:set_int("work_delay",table_all_machines[i][14])
end
if meta:get_int("work_delay")>0 then
meta:set_int("work_delay",meta:get_int("work_delay")-1)
end
if minetest.get_item_group((minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})).name,"owl_tech_electro_wire")>0
and owl_tech:get_charge_max(meta)-owl_tech:get_charge(meta)>=owl_tech:get_voltage(meta) then --get from wire electro
local meta_up = minetest.get_meta({x=pos.x,y=pos.y+1,z=pos.z})
if owl_tech:get_charge(meta_up)>0 and owl_tech:get_voltage(meta)==owl_tech:get_voltage(meta_up) then
owl_tech.send_electro_from_wire_in_pos(meta_up,pos)
end
end
meta:set_string("infotext",owl_tech:get_charge(meta))
set_formspect_steam_quarry(meta)
timer:start(0.2)
end
})
--Crafte controller
minetest.register_craft({
type = "shaped",
output = "owl_tech:"..table_all_machines[i][2].."_quarry",
recipe = {
{"owl_tech:"..table_all_machines[i][6].."_plate","owl_tech:circuit_tire_"..i,"owl_tech:"..table_all_machines[i][6].."_plate"},
{"owl_tech:"..table_all_machines[i][6].."_plate","owl_tech:"..table_all_machines[i][6].."_frames","owl_tech:"..table_all_machines[i][6].."_plate"},
{table_all_machines[i][8][1],"owl_tech:circuit_tire_"..i,table_all_machines[i][8][1],}
}
})
end
end

View File

@ -21,93 +21,109 @@ minetest.register_node("owl_tech:quary_point", {
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
})
local function set_formspect_steam_quarry(meta)
local fluid_1_name = owl_tech.get_pull_fluid_name(meta,1)
local fluid_1_volume = owl_tech.get_pull_volume(meta,1)
local 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.25,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Stean vertical miner"))).."]"..
"list[context;dst;5.5,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.5,1.5,1,1)..
"label[0,1.5;"..minetest.formspec_escape(minetest.colorize("#313131", (fluid_1_name.."--"..fluid_1_volume))).."]"..
"listring[context;dst]"..
"listring[current_player;main]"..
"listring[current_player;main]"..
"listring[current_player;main]"
meta:set_string("formspec", formspec)
end
minetest.register_node("owl_tech:steam_quarry", {
description = S("Steam quarry"),
_doc_items_longdesc = S("Dig the Hole"),
tiles = {
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_steam_input.png",
"owl_tech_base_meshanism_side.png^[colorize:#a35900:128",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_quary.png",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_quary.png",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_quary.png",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_quary.png",
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2, owl_tech_machine=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,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
set_formspect_steam_quarry(meta)
owl_tech.prepear_for_verticak_steam_miner(pos)
local timer =minetest.get_node_timer(pos)
local inv = meta:get_inventory()
inv:set_size("dst", 1)
timer:start(2)
end,
on_timer = function(pos, elapsed)
local meta = minetest.get_meta(pos)
local timer = minetest.get_node_timer(pos)
if meta:get_int("min_x")==0 and meta:get_int("min_z")==0 then
owl_tech.scan_for_point(pos,meta,8)
end
if meta:get_int("get_bedrock")==0 and
owl_tech.get_pull_volume(meta,1)>=15 then
local inv = meta:get_inventory()
owl_tech.set_pull_volume(meta,1,owl_tech.get_pull_volume(meta,1)-15)
local can_mine = owl_tech.can_quary_mine_this(pos,meta)
owl_tech.diging_quary(pos,meta,can_mine)
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_steam_quarry(meta)
timer:start(0.2)
end
})
--Crafte controller
minetest.register_craft({
type = "shaped",
output = "owl_tech:steam_quarry",
output = "owl_tech:quary_point",
recipe = {
{"owl_tech:bronze_plate","owl_tech:bronze_plate","owl_tech:bronze_plate"},
{"mesecons_torch:mesecon_torch_on","owl_tech:bronze_plate","mesecons_torch:mesecon_torch_on"},
{"owl_tech:bronze_plate","owl_tech:bronze_frames","owl_tech:bronze_plate"},
{"owl_tech:steam_vertical_miner","owl_tech:steam_vertical_miner","owl_tech:steam_vertical_miner"}
{"mesecons_torch:mesecon_torch_on","owl_tech:bronze_plate","mesecons_torch:mesecon_torch_on"}
}
})
})
if owl_tech_advanced_steam_machins then
local function set_formspect_steam_quarry(meta)
local fluid_1_name = owl_tech.get_pull_fluid_name(meta,1)
local fluid_1_volume = owl_tech.get_pull_volume(meta,1)
local delay = meta:get_int("work_delay")
local 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.25,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Steam vertical miner"))).."]"..
"list[context;dst;5.5,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.5,1.5,1,1)..
"label[0,1.5;"..minetest.formspec_escape(minetest.colorize("#313131", (fluid_1_name.."--"..fluid_1_volume))).."]"..
"label[0,2.5;"..minetest.formspec_escape(minetest.colorize("#313131", (delay.."--delay"))).."]"..
"listring[context;dst]"..
"listring[current_player;main]"..
"listring[current_player;main]"..
"listring[current_player;main]"
meta:set_string("formspec", formspec)
end
minetest.register_node("owl_tech:steam_quarry", {
description = S("Steam quarry"),
_doc_items_longdesc = S("Dig the Hole"),
tiles = {
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_steam_input.png",
"owl_tech_base_meshanism_side.png^[colorize:#a35900:128",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_quary.png",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_quary.png",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_quary.png",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_quary.png",
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2, owl_tech_machine=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,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
meta:set_int("work_delay",0)
set_formspect_steam_quarry(meta)
owl_tech.prepear_for_verticak_steam_miner(pos)
local timer =minetest.get_node_timer(pos)
local inv = meta:get_inventory()
inv:set_size("dst", 1)
timer:start(2)
end,
on_timer = function(pos, elapsed)
local meta = minetest.get_meta(pos)
local timer = minetest.get_node_timer(pos)
if meta:get_int("min_x")==0 and meta:get_int("min_z")==0 then
owl_tech.scan_for_point(pos,meta,8)
end
if meta:get_int("get_bedrock")==0 and meta:get_int("work_delay")==0 and
owl_tech.get_pull_volume(meta,1)>=15 then
local inv = meta:get_inventory()
owl_tech.set_pull_volume(meta,1,owl_tech.get_pull_volume(meta,1)-15)
local can_mine = owl_tech.can_quary_mine_this(pos,meta)
owl_tech.diging_quary(pos,meta,can_mine)
meta:set_int("work_delay",20)
end
if meta:get_int("work_delay")>0 then
meta:set_int("work_delay",meta:get_int("work_delay")-1)
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_steam_quarry(meta)
timer:start(0.2)
end
})
--Crafte controller
minetest.register_craft({
type = "shaped",
output = "owl_tech:steam_quarry",
recipe = {
{"owl_tech:bronze_plate","owl_tech:bronze_plate","owl_tech:bronze_plate"},
{"owl_tech:bronze_plate","owl_tech:bronze_frames","owl_tech:bronze_plate"},
{"owl_tech:steam_vertical_miner","owl_tech:steam_vertical_miner","owl_tech:steam_vertical_miner"}
}
})
end

View File

@ -1,91 +1,100 @@
local S = minetest.get_translator(minetest.get_current_modname())
local name = minetest.get_current_modname()
local path = minetest.get_modpath(name)
if owl_tech_advanced_steam_machins then
local function set_formspect_steam_vertical_miner(meta)
local fluid_1_name = owl_tech.get_pull_fluid_name(meta,1)
local fluid_1_volume = owl_tech.get_pull_volume(meta,1)
local delay = meta:get_int("work_delay")
local 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.25,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Stean vertical miner"))).."]"..
"list[context;dst;5.5,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.5,1.5,1,1)..
"label[0,1.5;"..minetest.formspec_escape(minetest.colorize("#313131", (fluid_1_name.."--"..fluid_1_volume))).."]"..
"label[0,2.5;"..minetest.formspec_escape(minetest.colorize("#313131", (delay.."--delay"))).."]"..
"listring[context;dst]"..
"listring[current_player;main]"..
"listring[current_player;main]"..
"listring[current_player;main]"
meta:set_string("formspec", formspec)
end
local function set_formspect_steam_vertical_miner(meta)
local fluid_1_name = owl_tech.get_pull_fluid_name(meta,1)
local fluid_1_volume = owl_tech.get_pull_volume(meta,1)
local 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.25,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Stean vertical miner"))).."]"..
"list[context;dst;5.5,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.5,1.5,1,1)..
"label[0,1.5;"..minetest.formspec_escape(minetest.colorize("#313131", (fluid_1_name.."--"..fluid_1_volume))).."]"..
"listring[context;dst]"..
"listring[current_player;main]"..
"listring[current_player;main]"..
"listring[current_player;main]"
meta:set_string("formspec", formspec)
minetest.register_node("owl_tech:steam_vertical_miner", {
description = S("Vertical miner"),
_doc_items_longdesc = S("Dig the hole"),
tiles = {
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_steam_input.png",
"owl_tech_base_meshanism_side.png^[colorize:#a35900:128",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_vertical_miner_face.png",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_vertical_miner_face.png",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_vertical_miner_face.png",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_vertical_miner_face.png",
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2, owl_tech_machine=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,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
meta:set_int("work_delay",0)
set_formspect_steam_vertical_miner(meta)
owl_tech.prepear_for_verticak_steam_miner(pos)
local timer =minetest.get_node_timer(pos)
local inv = meta:get_inventory()
inv:set_size("dst", 1)
timer:start(2)
end,
on_timer = function(pos, elapsed)
local meta = minetest.get_meta(pos)
local timer = minetest.get_node_timer(pos)
if meta:get_int("get_bedrock")==0 and
owl_tech.get_pull_volume(meta,1)>=15 and meta:get_int("work_delay")==0 then
local inv = meta:get_inventory()
owl_tech.set_pull_volume(meta,1,owl_tech.get_pull_volume(meta,1)-15)
owl_tech.vertical_steam_mine(pos,meta,owl_tech.can_vertical_steam_miner_mine_this(pos,meta))
meta:set_int("work_delay",20)
end
if meta:get_int("work_delay")>0 then
meta:set_int("work_delay",meta:get_int("work_delay")-1)
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_steam_vertical_miner(meta)
timer:start(0.2)
end,
on_destruct = function(pos)
owl_tech.remove_all_pipe_vertical(pos)
end
})
--Crafte "owl_tech:steam_vertical_miner",
minetest.register_craft({
type = "shaped",
output ="owl_tech:steam_vertical_miner",
recipe = {
{"owl_tech:bronze_plate","owl_tech:bronze_plate","owl_tech:bronze_plate"},
{"owl_tech:bronze_plate","owl_tech:bronze_frames","owl_tech:bronze_plate"},
{"owl_tech:iron_item_pipe_input","owl_tech:bronze_fluid_pipe","owl_tech:iron_item_pipe_input"}
}
})
end
minetest.register_node("owl_tech:steam_vertical_miner", {
description = S("Vertical miner"),
_doc_items_longdesc = S("Dig the hole"),
tiles = {
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_steam_input.png",
"owl_tech_base_meshanism_side.png^[colorize:#a35900:128",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_vertical_miner_face.png",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_vertical_miner_face.png",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_vertical_miner_face.png",
"(owl_tech_base_meshanism_side.png^[colorize:#a35900:128)^owl_tech_vertical_miner_face.png",
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2, owl_tech_machine=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,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
set_formspect_steam_vertical_miner(meta)
owl_tech.prepear_for_verticak_steam_miner(pos)
local timer =minetest.get_node_timer(pos)
local inv = meta:get_inventory()
inv:set_size("dst", 1)
timer:start(2)
end,
on_timer = function(pos, elapsed)
local meta = minetest.get_meta(pos)
local timer = minetest.get_node_timer(pos)
if meta:get_int("get_bedrock")==0 and
owl_tech.get_pull_volume(meta,1)>=15 then
local inv = meta:get_inventory()
owl_tech.set_pull_volume(meta,1,owl_tech.get_pull_volume(meta,1)-15)
owl_tech.vertical_steam_mine(pos,meta,owl_tech.can_vertical_steam_miner_mine_this(pos,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_steam_vertical_miner(meta)
timer:start(0.2)
end,
on_destruct = function(pos)
owl_tech.remove_all_pipe_vertical(pos)
end
})
--Crafte "owl_tech:steam_vertical_miner",
minetest.register_craft({
type = "shaped",
output ="owl_tech:steam_vertical_miner",
recipe = {
{"owl_tech:bronze_plate","owl_tech:bronze_plate","owl_tech:bronze_plate"},
{"owl_tech:bronze_plate","owl_tech:bronze_frames","owl_tech:bronze_plate"},
{"owl_tech:iron_item_pipe_input","owl_tech:bronze_fluid_pipe","owl_tech:iron_item_pipe_input"}
}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB