Add cell logick -input and output fluid

This commit is contained in:
ConfidentOwl 2023-02-12 12:53:49 +03:00
parent 02579c4a5b
commit 104103af61
13 changed files with 183 additions and 173 deletions

View File

@ -39,13 +39,18 @@ There is a mechanic of transferring liquids (such as water, lava, steam, etc.) t
There is a mechanics of item pipes. Item transfer only works with regular chests and mechanisms from the mod itself(WIP)
***
Warning - mod in deep development (install it in your game worlds only at your own peril and risk)
## Mashins
Add base steam mashine and electrick mashins ( like generators , furnance , alliy smelters and etc)The higher the level of the machine, the more new recipes are available and the machine works faster - but the consumption of energy and attracted resources also rises, which is necessary for the creation.
***
## Automation
All electrical machines can be automated with the help of pipes, cables.
All electrical machines can be automated with the help of pipes, cables.
***
## Multiblocks
Multiblocks - not just large machines, you can strictly build on inturctions - large and large machines in which you can change the input and output nodes
***
Warning - mod in deep development (install it in your game worlds only at your own peril and risk)

View File

@ -1,6 +1,6 @@
--Global lists
GLOBAL_FLUID_LIST ={
"mcl_core:lava_source","mcl_core:water_source","mclx_core:river_water_source","owl_tech:tar_source"
"mcl_core:lava_source","mcl_core:water_source","mclx_core:river_water_source","owl_tech:tar_source","owl_tech:metan_source"
}
INPUT_SLOT_NAME= {
"fluid_in","fuel",'input_in',"sapling",'input_in'
@ -8,11 +8,18 @@ INPUT_SLOT_NAME= {
OUTPUT_SLOT_NAME={
'dst_add','dst',"wood","leaves"
}
FLUID_NAME_TO_SELL={
lava_source="owl_tech:lava_sell",
water_source="owl_tech:water_sell",
river_water_source="owl_tech:water_sell",
tar_source="owl_tech:tar_sell",
FLUID_NAME_TO_CELL={
lava_source="owl_tech:lava_cell",
water_source="owl_tech:water_cell",
river_water_source="owl_tech:water_cell",
tar_source="owl_tech:tar_cell",
metan_source="owl_tech:metan_cell",
}
FLUID_CELL_TO_NAME={
lava_cell="mcl_core:lava_source",
water_cell="mcl_core:water_source",
tar_cell ="owl_tech:tar_source",
metan_cell="owl_tech:metan_source"
}
local ore_duration = 2

View File

@ -334,8 +334,8 @@ for i = 1, #table_all_machines, 1 do
description = S( table_all_machines[i][2].." sieve"),
_doc_items_longdesc = S("Siev tire "..i),
tiles = {
"(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_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_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128",
"owl_tech_base_meshanism_side.png^[colorize:"..table_all_machines[i][5]..":128",

View File

@ -20,7 +20,7 @@ for i, value in ipairs(energy_hatch_table) do
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2, owl_tech_machine=1,energy_hatch_1_input=1},
groups = {pickaxey=2, owl_tech_machine=1,energy_hatch_1_input=1,owl_tech_electro_mashine=1},
sounds = mcl_sounds.node_sound_metal_defaults(),
paramtype2 = "facedir",
_mcl_blast_resistance = 6,
@ -103,7 +103,7 @@ for i, value in ipairs(energy_hatch_table) do
},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=2, owl_tech_machine=1,energy_hatch_1_output=1},
groups = {pickaxey=2, owl_tech_machine=1,energy_hatch_1_output=1,owl_tech_electro_mashine=1},
sounds = mcl_sounds.node_sound_metal_defaults(),
paramtype2 = "facedir",
_mcl_blast_resistance = 6,
@ -322,7 +322,7 @@ for i, value in ipairs(energy_hatch_table) do
owl_tech.update_fluid_pipe_around(pos)
owl_tech.set_fluid_sand_in_tick(meta,(energy_hatch_table[i][3]*2))
local timer =minetest.get_node_timer(pos)
meta:set_string("infotext",owl_tech.get_pull_volume(meta,1))
meta:set_string("infotext",owl_tech.get_pull_volume(meta,1).."--"..owl_tech.get_pull_fluid_name(meta,1))
timer:start(0.2)
end,
on_timer = function(pos, elapsed)
@ -379,7 +379,7 @@ for i, value in ipairs(energy_hatch_table) do
end
owl_tech.delit_name_fluid_if_0(meta)
meta:set_string("infotext",owl_tech.get_pull_volume(meta,1).."--"..owl_tech.get_pull_max_volume(meta,1))
meta:set_string("infotext",owl_tech.get_pull_volume(meta,1).."--"..owl_tech.get_pull_fluid_name(meta,1))
timer:start(0.2)
end
})
@ -420,7 +420,7 @@ for i, value in ipairs(energy_hatch_table) do
owl_tech.update_fluid_pipe_around(pos)
owl_tech.set_fluid_sand_in_tick(meta,(energy_hatch_table[i][3]*2))
local timer =minetest.get_node_timer(pos)
meta:set_string("infotext",owl_tech.get_pull_volume(meta,1))
meta:set_string("infotext",owl_tech.get_pull_volume(meta,1).."--"..owl_tech.get_pull_fluid_name(meta,1))
timer:start(0.2)
end,
on_timer = function(pos, elapsed)
@ -437,7 +437,7 @@ for i, value in ipairs(energy_hatch_table) do
owl_tech.add_fluid_in_node_pull(meta_up,fluid_name_to_send,remove_amount,inde_pull)
local pull_curent_volume = owl_tech.get_pull_volume(meta,1)
local difer = pull_curent_volume-remove_amount
owl_tech.set_pull_volume(meta,2,difer)
owl_tech.set_pull_volume(meta,1,difer)
end
end
end
@ -451,7 +451,7 @@ for i, value in ipairs(energy_hatch_table) do
owl_tech.add_fluid_in_node_pull(meta_up,fluid_name_to_send,remove_amount,inde_pull)
local pull_curent_volume = owl_tech.get_pull_volume(meta,1)
local difer = pull_curent_volume-remove_amount
owl_tech.set_pull_volume(meta,2,difer)
owl_tech.set_pull_volume(meta,1,difer)
end
end
end
@ -465,7 +465,7 @@ for i, value in ipairs(energy_hatch_table) do
owl_tech.add_fluid_in_node_pull(meta_up,fluid_name_to_send,remove_amount,inde_pull)
local pull_curent_volume = owl_tech.get_pull_volume(meta,1)
local difer = pull_curent_volume-remove_amount
owl_tech.set_pull_volume(meta,2,difer)
owl_tech.set_pull_volume(meta,1,difer)
end
end
end
@ -479,13 +479,13 @@ for i, value in ipairs(energy_hatch_table) do
owl_tech.add_fluid_in_node_pull(meta_up,fluid_name_to_send,remove_amount,inde_pull)
local pull_curent_volume = owl_tech.get_pull_volume(meta,1)
local difer = pull_curent_volume-remove_amount
owl_tech.set_pull_volume(meta,2,difer)
owl_tech.set_pull_volume(meta,1,difer)
end
end
end
owl_tech.delit_name_fluid_if_0(meta)
meta:set_string("infotext",owl_tech.get_pull_volume(meta,1).."--"..owl_tech.get_pull_max_volume(meta,1))
meta:set_string("infotext",owl_tech.get_pull_volume(meta,1).."--"..owl_tech.get_pull_fluid_name(meta,1))
timer:start(0.2)
end
})

View File

@ -9,11 +9,12 @@ local path = minetest.get_modpath(name)
need 1 input item hatch ,1 output item hatch , 1 input energy hatch , 1 output fluid hatch
]]
local function set_formspect_wood_pyrolis(meta)
local redines = owl_tech.get_item_redines(meta)
local burn= meta:get_int("fuel_burn")
local b_corect = "eror"
if meta:get_int("b_corect")==1 then
b_corect="ok"
end
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]"..
@ -21,18 +22,9 @@ local function set_formspect_wood_pyrolis(meta)
"list[current_player;main;0,7.74;9,1;]"..
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Wood pyrolis"))).."]"..
"list[context;input_in;2.5,2.5;1,1;]"..
mcl_formspec.get_itemslot_bg(2.5,2.5,1,1)..
"list[context;input_in_add;4,2.5;1,1;]"..
mcl_formspec.get_itemslot_bg(4,2.5,1,1)..
"list[context;dst;5.5,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.5,1.5,1,1)..
"label[0,2;"..minetest.formspec_escape(minetest.colorize("#313131", (redines.." / 100"))).."]"..
"label[0,3;"..minetest.formspec_escape(minetest.colorize("#313131", (burn))).."]"..
"listring[context;dst]"..
"label[0,3;"..minetest.formspec_escape(minetest.colorize("#313131", (b_corect.."--correctly built"))).."]"..
"listring[current_player;main]"..
"listring[context;input_in]"..
"listring[context;input_in_add]"..
"listring[current_player;main]"..
"listring[current_player;main]"
meta:set_string("formspec", formspec)
@ -647,7 +639,11 @@ minetest.register_node("owl_tech:wood_pyrolis", {
on_timer = function(pos, elapsed)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
meta:set_int("b_corect",0)
if bronze_blast_furnanse_build_correct(pos) then
meta:set_int("b_corect",1)
end
if meta:get_int("b_corect")==1 then
local input_stack = owl_tech:get_item_in_input_hatch_pos(
owl_tech:get_hatch_ofset_X(meta,1,"item_hatch_input"),
owl_tech:get_hatch_ofset_Y(meta,1,"item_hatch_input"),
@ -732,7 +728,6 @@ minetest.register_node("owl_tech:wood_pyrolis", {
end
owl_tech.reset_item_redines(meta)
end
minetest.chat_send_all(owl_tech.get_item_redines(meta))
end
set_formspect_wood_pyrolis(meta)
timer:start(0.2)

View File

@ -4,27 +4,6 @@ local path = minetest.get_modpath(name)
local use_select_box = minetest.settings:get_bool("mcl_buckets_use_select_box", false)
---- This crutch was suggested by the developers of Mineclone 2 - they made the functions of their shovels and hoes local
local mod_doc = minetest.get_modpath("doc")
local mod_mcl_core = minetest.get_modpath("mcl_core")
--local mod_mclx_core = minetest.get_modpath("mclx_core")
-- Localize some functions for faster access
local vector = vector
local math = math
local string = string
local raycast = minetest.raycast
local get_node = minetest.get_node
local set_node = minetest.set_node
local add_node = minetest.add_node
local add_item = minetest.add_item
local registered_nodes = minetest.registered_nodes
local get_item_group = minetest.get_item_group
local is_creative_enabled = minetest.is_creative_enabled
local is_protected = minetest.is_protected
local record_protection_violation = minetest.record_protection_violation
local function create_soil(pos, inv)
if pos == nil then
return false
@ -946,104 +925,106 @@ for i, value in ipairs(gems_orew_array) do
_mcl_hardness = 5,
})
end
--1)name 2)Name 3)flowing animation 4)source animation 5)sell tezture 6)is gas?
--1)name 2)Name 3)flowing animation 4)source animation 5)cell tezture 6)is fluid?
local fluid_array ={
{"tar","Tar","owl_tech_tar_flowing_animated.png","owl_tech_tar_source_animated.png","owl_tech_tar_for_sell.png",false}--#8d4a00
{"tar","Tar","owl_tech_tar_flowing_animated.png","owl_tech_tar_source_animated.png","owl_tech_tar_for_cell.png",1},--#8d4a00
{"metan","Metan","owl_tech_tar_flowing_animated.png","owl_tech_tar_source_animated.png","owl_tech_metan_for_cell.png",0}--ccc8b0
}
for i, value in ipairs(fluid_array) do
minetest.register_node("owl_tech:"..fluid_array[i][1].."_flowing", {
description = S(fluid_array[i][2].." Water"),
_doc_items_create_entry = false,
wield_image = fluid_array[i][3].."^[verticalframe:64:0",
drawtype = "flowingliquid",
tiles = {fluid_array[i][3].."^[verticalframe:64:0"},
special_tiles = {
{
image="("..fluid_array[i][3]..")",
backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
if fluid_array[i][6]==1 then
minetest.register_node("owl_tech:"..fluid_array[i][1].."_flowing", {
description = S(fluid_array[i][2].." Water"),
_doc_items_create_entry = false,
wield_image = fluid_array[i][3].."^[verticalframe:64:0",
drawtype = "flowingliquid",
tiles = {fluid_array[i][3].."^[verticalframe:64:0"},
special_tiles = {
{
image="("..fluid_array[i][3]..")",
backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
},
{
image="("..fluid_array[i][3]..")",
backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
},
},
{
image="("..fluid_array[i][3]..")",
backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
sounds = mcl_sounds.node_sound_water_defaults(),
is_ground_content = false,
use_texture_alpha = USE_TEXTURE_ALPHA,
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 4,
liquidtype = "flowing",
liquid_alternative_flowing = "owl_tech:"..fluid_array[i][1].."_flowing",
liquid_alternative_source = "owl_tech:"..fluid_array[i][1].."_source",
liquid_viscosity = WATER_VISC,
liquid_range = 7,
waving = 3,
post_effect_color = {a=20, r=0x03, g=0x3C, b=0x5C},
groups = { water=3, liquid=3, puts_out_fire=1, melt_around=1, dig_by_piston=1, not_in_creative_inventory=1,},--not_in_creative_inventory=1,
_mcl_blast_resistance = 100,
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
_mcl_hardness = -1,
})
minetest.register_node("owl_tech:"..fluid_array[i][1].."_source", {
description = S("Water Source"),
_doc_items_entry_name = S("Water"),
_doc_items_longdesc =
S("Сompounds from cyclic, highly volatile and non-volatile compounds, which are presented in a spectrum: from methyl esters to combustion of alcohols, acids, phenols and light compounds.").."\n\n",
_doc_items_hidden = false,
drawtype = "liquid",
waving = 3,
tiles = {
{name=fluid_array[i][4], animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0}}
},
},
sounds = mcl_sounds.node_sound_water_defaults(),
is_ground_content = false,
use_texture_alpha = USE_TEXTURE_ALPHA,
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 4,
liquidtype = "flowing",
liquid_alternative_flowing = "owl_tech:"..fluid_array[i][1].."_flowing",
liquid_alternative_source = "owl_tech:"..fluid_array[i][1].."_source",
liquid_viscosity = WATER_VISC,
liquid_range = 7,
waving = 3,
post_effect_color = {a=20, r=0x03, g=0x3C, b=0x5C},
groups = { water=3, liquid=3, puts_out_fire=1, melt_around=1, dig_by_piston=1, not_in_creative_inventory=1,},--not_in_creative_inventory=1,
_mcl_blast_resistance = 100,
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
_mcl_hardness = -1,
})
minetest.register_node("owl_tech:"..fluid_array[i][1].."_source", {
description = S("Water Source"),
_doc_items_entry_name = S("Water"),
_doc_items_longdesc =
S("Сompounds from cyclic, highly volatile and non-volatile compounds, which are presented in a spectrum: from methyl esters to combustion of alcohols, acids, phenols and light compounds.").."\n\n",
_doc_items_hidden = false,
drawtype = "liquid",
waving = 3,
tiles = {
{name=fluid_array[i][4], animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0}}
},
special_tiles = {
-- New-style water source material (mostly unused)
{
name=fluid_array[i][4],
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0},
backface_culling = false,
}
},
sounds = mcl_sounds.node_sound_water_defaults(),
is_ground_content = false,
use_texture_alpha = USE_TEXTURE_ALPHA,
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 4,
liquidtype = "source",
liquid_alternative_flowing = "owl_tech:"..fluid_array[i][1].."_flowing",
liquid_alternative_source = "owl_tech:"..fluid_array[i][1].."_source",
liquid_viscosity = WATER_VISC,
liquid_range = 7,
post_effect_color = {a=90, r=0x03, g=0x3C, b=0x5C},
stack_max = 64,
groups = { water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1, dig_by_piston=1},
_mcl_blast_resistance = 100,
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
_mcl_hardness = -1,
})
special_tiles = {
-- New-style water source material (mostly unused)
{
name=fluid_array[i][4],
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0},
backface_culling = false,
}
},
sounds = mcl_sounds.node_sound_water_defaults(),
is_ground_content = false,
use_texture_alpha = USE_TEXTURE_ALPHA,
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 4,
liquidtype = "source",
liquid_alternative_flowing = "owl_tech:"..fluid_array[i][1].."_flowing",
liquid_alternative_source = "owl_tech:"..fluid_array[i][1].."_source",
liquid_viscosity = WATER_VISC,
liquid_range = 7,
post_effect_color = {a=90, r=0x03, g=0x3C, b=0x5C},
stack_max = 64,
groups = { water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1, dig_by_piston=1},
_mcl_blast_resistance = 100,
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
_mcl_hardness = -1,
})
end
--capsuls
minetest.register_craftitem("owl_tech:"..fluid_array[i][1].."sell", {
minetest.register_craftitem("owl_tech:"..fluid_array[i][1].."_cell", {
description = S("Get 1000 of "..fluid_array[i][1]),
_doc_items_longdesc = S("Contein "..fluid_array[i][1]),
inventory_image = "owl_tech_empty_sell.png^"..fluid_array[i][5],
inventory_image = "owl_tech_empty_cell.png^"..fluid_array[i][5],
stack_max = 64,
groups = { craftitem=1 },
groups = { craftitem=1,load_cell=1,can_place_fluid=fluid_array[i][6] },
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type == "node" then
if minetest.get_item_group(itemstack:get_name(),"can_place_fluid")>0 and pointed_thing.type == "node" then
minetest.place_node(pointed_thing.above,{name="owl_tech:"..fluid_array[i][1].."_source"})
itemstack:set_count(itemstack:get_count()-1)
return itemstack
@ -1051,30 +1032,30 @@ for i, value in ipairs(fluid_array) do
end
})
end
--empty sell
minetest.register_craftitem("owl_tech:empty_sell", {
description = S("Sell tire 1"),
_doc_items_longdesc = S("Simple sell for fluids"),
inventory_image = "owl_tech_empty_sell.png",
--empty cell
minetest.register_craftitem("owl_tech:empty_cell", {
description = S("cell tire 1"),
_doc_items_longdesc = S("Simple cell for fluids"),
inventory_image = "owl_tech_empty_cell.png",
stack_max = 64,
groups = { craftitem=1 },
})
minetest.register_craft({
type = "shaped",
output = "owl_tech:empty_sell 4",
output = "owl_tech:empty_cell 4",
recipe = {
{"","owl_tech:iron_plate",""},
{"owl_tech:tin_plate","","owl_tech:tin_plate"},
{"","owl_tech:iron_plate",""},
},
})
-- water and lava sell
minetest.register_craftitem("owl_tech:water_sell", {
-- water and lava cell
minetest.register_craftitem("owl_tech:water_cell", {
description = S("Get 1000 of water"),
_doc_items_longdesc = S("Contein water"),
inventory_image = "owl_tech_empty_sell.png^owl_tech_water_for_sell.png",
inventory_image = "owl_tech_empty_cell.png^owl_tech_water_for_cell.png",
stack_max = 64,
groups = { craftitem=1 },
groups = { craftitem=1,load_cell=1 },
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type == "node" then
minetest.place_node(pointed_thing.above,{name="owl_tech:water_source"})
@ -1083,12 +1064,12 @@ minetest.register_craftitem("owl_tech:water_sell", {
end
end
})
minetest.register_craftitem("owl_tech:lava_sell", {
minetest.register_craftitem("owl_tech:lava_cell", {
description = S("Get 1000 of lava"),
_doc_items_longdesc = S("Contein lava"),
inventory_image = "owl_tech_empty_sell.png^owl_tech_lava_for_sell.png",
inventory_image = "owl_tech_empty_cell.png^owl_tech_lava_for_cell.png",
stack_max = 64,
groups = { craftitem=1 },
groups = { craftitem=1,load_cell=1 },
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type == "node" then
minetest.place_node(pointed_thing.above,{name="owl_tech:lava_source"})

View File

@ -18,8 +18,8 @@ local function set_formspect_tank(meta)
mcl_formspec.get_itemslot_bg(3.5,1.5,1,1)..
"list[context;input_in_add;2.5,3.5;1,1;]"..
mcl_formspec.get_itemslot_bg(2.5,3.5,1,1)..
"list[context;dst_add;2.5,3.5;1,1;]"..
mcl_formspec.get_itemslot_bg(2.5,3.5,1,1)..
"list[context;dst_add;3.5,3.5;1,1;]"..
mcl_formspec.get_itemslot_bg(3.5,3.5,1,1)..
"listring[context;dst]"..
"listring[current_player;main]"..
"listring[current_player;main]"..
@ -68,10 +68,10 @@ minetest.register_node("owl_tech:bronze_tank", {
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local sell_input_1 = inv:get_stack("input_in", 1)
local sell_output_1 = inv:get_stack("dst", 1)
local sell_input_2 = inv:get_stack("input_in_add", 1)
local sell_output_2 = inv:get_stack("dst_add", 1)
local cell_input_1 = inv:get_stack("input_in", 1)
local cell_output_1 = inv:get_stack("dst", 1)
local cell_input_2 = inv:get_stack("input_in_add", 1)
local cell_output_2 = inv:get_stack("dst_add", 1)
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 fluid_name_to_send = owl_tech.get_pull_fluid_name(meta_up,1)
@ -94,18 +94,40 @@ minetest.register_node("owl_tech:bronze_tank", {
owl_tech.set_pull_volume(meta,2,difer)
end
end
if not sell_input_1:is_empty() and sell_input_1:get_name() =="owl_tech:empty_sell" and owl_tech.get_pull_volume(meta,1)>=1000 then
local fluid_name = string.sub(owl_tech.get_pull_fluid_name(meta,1) , 10)
if FLUID_NAME_TO_SELL[fluid_name]~=nil and FLUID_NAME_TO_SELL[fluid_name]~="" and
(sell_output_1:is_empty() or (sell_output_1:get_name()==FLUID_NAME_TO_SELL[fluid_name] and sell_output_1:get_free_space()>0 )) then
if not sell_output_1:is_empty() then-- Add main output
sell_output_1:set_count(sell_output_1:get_count()+FLUID_NAME_TO_SELL[fluid_name] )
inv:set_stack('dst', 1, sell_output_1)
if minetest.get_item_group(cell_input_2:get_name(),"load_cell")>0 and ((owl_tech.get_pull_max_volume(meta,1)-owl_tech.get_pull_volume(meta,1))>=1000 )then
local fluid_name = string.sub(cell_input_2:get_name() , 10)
if FLUID_CELL_TO_NAME[fluid_name]~=nil and FLUID_CELL_TO_NAME[fluid_name]~="" and
(cell_output_2:is_empty() or (cell_output_2:get_name()=="owl_tech:empty_cell" and cell_output_2:get_free_space()>0 )) then
if not cell_output_2:is_empty() then-- Add main output
cell_output_2:set_count(cell_output_2:get_count()+1)
inv:set_stack('dst_add', 1, cell_output_2)
else
local item ={name=FLUID_NAME_TO_SELL[fluid_name], count=1, wear=0, metadata=""}
sell_output_1:add_item(item)
inv:set_stack('dst', 1, sell_output_1)
local item ={name="owl_tech:empty_cell", count=1, wear=0, metadata=""}
cell_output_2:add_item(item)
inv:set_stack('dst_add', 1, cell_output_2)
end
owl_tech.set_pull_volume(meta,1,owl_tech.get_pull_volume(meta,1)+1000)
owl_tech.set_pull_fluid_name(meta,1,FLUID_CELL_TO_NAME[fluid_name])
cell_input_2:set_count(cell_input_2:get_count()-1)
inv:set_stack('input_in_add', 1, cell_input_2)
end
end
if not cell_input_1:is_empty() and cell_input_1:get_name() =="owl_tech:empty_cell" and owl_tech.get_pull_volume(meta,1)>=1000 then
local fluid_name = string.sub(owl_tech.get_pull_fluid_name(meta,1) , 10)
if FLUID_NAME_TO_CELL[fluid_name]~=nil and FLUID_NAME_TO_CELL[fluid_name]~="" and
(cell_output_1:is_empty() or (cell_output_1:get_name()==FLUID_NAME_TO_CELL[fluid_name] and cell_output_1:get_free_space()>0 )) then
if not cell_output_1:is_empty() then-- Add main output
cell_output_1:set_count(cell_output_1:get_count()+1)
inv:set_stack('dst', 1, cell_output_1)
else
local item ={name=FLUID_NAME_TO_CELL[fluid_name], count=1, wear=0, metadata=""}
cell_output_1:add_item(item)
inv:set_stack('dst', 1, cell_output_1)
end
owl_tech.set_pull_volume(meta,1,owl_tech.get_pull_volume(meta,1)-1000)
cell_input_1:set_count(cell_input_1:get_count()-1)
inv:set_stack('input_in', 1, cell_input_1)
end
end
owl_tech.delit_name_fluid_if_0(meta)

View File

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB