From 104103af612b7a4c1af9628d3cb154f3762fcafc Mon Sep 17 00:00:00 2001 From: ConfidentOwl Date: Sun, 12 Feb 2023 12:53:49 +0300 Subject: [PATCH] Add cell logick -input and output fluid --- README.md | 13 +- lists_of_all.lua | 19 +- mashins/electro_machins.lua | 2 +- multiblocks/help_node.lua | 20 +- multiblocks/wood_pyrolysis.lua | 23 +- ore/node_register.lua | 225 ++++++++---------- pipe/fluid_tank.lua | 54 +++-- ...empty_sell.png => owl_tech_empty_cell.png} | Bin ...or_sell.png => owl_tech_lava_for_cell.png} | Bin ...bucket.png => owl_tech_metan_for_cell.png} | Bin 5659 -> 5032 bytes textures/owl_tech_tar_for_cell.png | Bin 0 -> 5047 bytes textures/owl_tech_tar_for_sell.png | Bin 627 -> 0 bytes ...r_sell.png => owl_tech_water_for_cell.png} | Bin 13 files changed, 183 insertions(+), 173 deletions(-) rename textures/{owl_tech_empty_sell.png => owl_tech_empty_cell.png} (100%) rename textures/{owl_tech_lava_for_sell.png => owl_tech_lava_for_cell.png} (100%) rename textures/{owl_tech_tar_bucket.png => owl_tech_metan_for_cell.png} (51%) create mode 100644 textures/owl_tech_tar_for_cell.png delete mode 100644 textures/owl_tech_tar_for_sell.png rename textures/{owl_tech_water_for_sell.png => owl_tech_water_for_cell.png} (100%) diff --git a/README.md b/README.md index fcb310a..3f632e2 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file +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) diff --git a/lists_of_all.lua b/lists_of_all.lua index aa699ee..a10c110 100755 --- a/lists_of_all.lua +++ b/lists_of_all.lua @@ -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 diff --git a/mashins/electro_machins.lua b/mashins/electro_machins.lua index d77d55f..dec48b8 100644 --- a/mashins/electro_machins.lua +++ b/mashins/electro_machins.lua @@ -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", diff --git a/multiblocks/help_node.lua b/multiblocks/help_node.lua index 8d1006a..2502f44 100644 --- a/multiblocks/help_node.lua +++ b/multiblocks/help_node.lua @@ -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 }) diff --git a/multiblocks/wood_pyrolysis.lua b/multiblocks/wood_pyrolysis.lua index 8a9fa1a..2a1ba4a 100644 --- a/multiblocks/wood_pyrolysis.lua +++ b/multiblocks/wood_pyrolysis.lua @@ -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) diff --git a/ore/node_register.lua b/ore/node_register.lua index 3603345..b9b8ee7 100755 --- a/ore/node_register.lua +++ b/ore/node_register.lua @@ -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"}) diff --git a/pipe/fluid_tank.lua b/pipe/fluid_tank.lua index 724fa09..21630cd 100755 --- a/pipe/fluid_tank.lua +++ b/pipe/fluid_tank.lua @@ -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) diff --git a/textures/owl_tech_empty_sell.png b/textures/owl_tech_empty_cell.png similarity index 100% rename from textures/owl_tech_empty_sell.png rename to textures/owl_tech_empty_cell.png diff --git a/textures/owl_tech_lava_for_sell.png b/textures/owl_tech_lava_for_cell.png similarity index 100% rename from textures/owl_tech_lava_for_sell.png rename to textures/owl_tech_lava_for_cell.png diff --git a/textures/owl_tech_tar_bucket.png b/textures/owl_tech_metan_for_cell.png similarity index 51% rename from textures/owl_tech_tar_bucket.png rename to textures/owl_tech_metan_for_cell.png index 84e6c1d36c72ea06fa21eb3d982233a24d964151..67600861b10a2537f90c8d3499c0a23fc924f02f 100644 GIT binary patch delta 1732 zcmV;#20QtiET|`tBYy*;dQ@0+Qek%>aB^>EX>4U6ba`-PAZ2)IW&i+q+U-_Zk|ZY# z{pS=u0+Lw7aabdK10UayCDUEiHQ}kAnZHgVky0ohLXXY#fBqikFFb5180Vvg6oSR$ zl1rSSsNGLqHCean^IQn{i)&jUv{z&NR*-Z4}U;fPeXZZNbcb46VT~M zW<(679iVi8gm(iSfV_ugL(=$h2&He?u94_|&8#FY>>K3y+eKurc^HMc3yDQ7!aD$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N$l^v7M10jFKQYsF15OK&*o$R6_f=jJJ5h{dQp;ZTyOTVB=Lz3d+D7Y3J z{8+3yxH#+T;3^1$A0VzSPKqv4;{TFDix>}%`|2$=}p_Tyk09nNc&FnJ11Ci={4Bx|o$sjd+SUrfNFn3ptNf&Rd+d zYMr(3$zK>L=qt-yr#XTY7O?~gA{5k7K@~RQwCbc-$k2Y$$3N`)C2}d`s(_JW0X1ll zT|f9A{O;B&PELP#Ns%Pb`{Fnsqd?y-&}ul&_p#%&PJrMuaHV(rwI(q0NqVEB#g2f1 zZQ$a%qbYm9!d9)R2$m)q8w=P)qR}8%7na?zVzaO-p)m1OGbi(3 z&ObBo-=z#T^0};Z?_W#0vyR5%tgNp0Va5i**Qqqq;)A9&&s2Y~PD4adWs7m8#zVVJ zK9`kl62%R^+CL_yW@!f3uqPu3TOw=&vkPLvru${k?O1G|Ul5BgDFC8>9!X7ECeV3D z8U|KC#Wp*LU2p394U}K0uE|*9y)}=ta$Q&KV(@&M3dB zx<$&RGN)&kiig0@#V92_szt5u@eF1(lpvYTC_NWF`#my0`@Rl_xftm$034-uIa-yu_*o?)vf>l002ovPDHLkV1g|0P9OjP diff --git a/textures/owl_tech_tar_for_cell.png b/textures/owl_tech_tar_for_cell.png new file mode 100644 index 0000000000000000000000000000000000000000..640120967891a6fbdbd7c92a7b5c6ff30870bc9b GIT binary patch literal 5047 zcmeHLYg7~07EVDyK`o_-NKwWBJ}7xi639amfe;|jKuUt3;+4r{0x9G{GDtv-PzCjt z`T$xL&|-a};)7BtC<+SFDimLc*ISAx3M#&(YEif+0TtKnT6ekD?LU(>$;>|A{?6Xt z*=Hv+tHt5L<87R62n51-VMt&k__i}0W30fZ>*GO$K(MSxm&V|cNGhb&X%xyN48qg2 z7=#&=3If4!>h>n4=XUAHI&zmp$HyYTyqZd=|;^xXTzHE7K-597rR#%!BLNnbZR=<%VOx$_D( zif>oUNGUp(`EKOvn@&|9#cr}2XWRMG@%N>1 zxz9cArWg-Qd?ee_5agW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Rf6Ud5-leuW~no0ZJs|1ZvO}Q+UEaF3~hUN3KDYa?a2xOlKhs8cb5q zVL6H6jnGIe#79P=(isYxf(_H)jXsN{f(MU%tixWK0E#fnrn=+Z%yN zD2pjmC=eOSWGc*5a+DLK(WwxyoJtiEk5RPhc=LcsaE`xN$R*OqLxGzu;v@uD00%Dd zGo?Dk@CGVXsxS$TnAC)Qm_9IzMPssGYryO`I^5OsAPgOv}On$pB#y zQ=I|=vmNBZ;p;F2*XX1gO%j)A3IH;Bz8)5V?IcHVBoM(dKuV?2IaC@4rb%Hc#~bFr z%ulJnG6JuWD-~(~3vJpwknhlvhbZ-6{xq{`Xh%t~a-;fP7FVG7qubbhpW~R3DH@=3~;%}S*P`{t#o%DS#*L%6%Nr86) zzpt+Ma=nuR?*x8dUH><^Y~I{XVQTO%C>7i+y%esl05@7zvasMl!dBC}SyO7d`5LPY znWrZZY(F*~9}o(Qoq*9A7m5Vd-4^4l>Gpk7HOGM|Ss3UqWt~CeoJLoSe(WX~NL@mG z(YPyT?1uVLt~Uoej2TFrOcu8)`jl!+xFvXa;&jY7SXbNJa57F+A6#wAGY-^4WUte; zr%s%D(DQu8`SCyL`rS_6?>IhrOO3G+str>>f27d|4wRp8U9~L}Jea%M;o7Xi%btMA O2|_`5;QoNPFaHB{!j}dB literal 0 HcmV?d00001 diff --git a/textures/owl_tech_tar_for_sell.png b/textures/owl_tech_tar_for_sell.png deleted file mode 100644 index f8aad019becb74a5879c5ffdf50a174881818569..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 627 zcmV-(0*w8MP)EX>4Tx04R}tkv&MmKpe$iQ^is$4t5Z6$WWc^q9TGztwIqhgj%6h2a`*`ph-iL z;^HW{799LotU9+0Yt2!bCVt}afBE>hzEl0u6Z503ls?%w0>9UwHTOtX3tfTr7K zCY2O(`Bky+6#~KtVHS{?Wz0!Z8ouM}9s$1I#d((hxj#q0TCf-p5Q!7aFm2)u;^|G> z;Ji;9Wo204LF6o1@j|C{&#yY z{Kuz;375nKALjqxetcnIVq##3SH^7!P6H&xq!_+_|G~h`#lv82#7DXdK7RhhATBJ* zz{bMH@aXv`(hazB`y<2e-@h52y?)0az)NNz_IWe@ud>1)h@*fC007|MAI)uat@Ho@ N002ovPDHLkV1nks6?gyu diff --git a/textures/owl_tech_water_for_sell.png b/textures/owl_tech_water_for_cell.png similarity index 100% rename from textures/owl_tech_water_for_sell.png rename to textures/owl_tech_water_for_cell.png