diff --git a/basis/node_states.lua b/basis/node_states.lua index ec085b8..a7689d3 100644 --- a/basis/node_states.lua +++ b/basis/node_states.lua @@ -61,6 +61,7 @@ Node mem data: local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta +local N = techage.get_node_lvm -- -- TechAge machine states @@ -82,6 +83,10 @@ techage.StatesImg = { "techage_inv_button_off.png", } +local function error(pos, msg) + minetest.log("error", "[TA states] "..msg.." at "..S(pos).." "..N(pos).name) +end + -- Return state button image for the node inventory function techage.state_button(state) if state and state < 7 and state > 0 then @@ -197,6 +202,8 @@ local function start_timer_delayed(pos, cycle_time) t:stop() if cycle_time > 0.9 then minetest.after(0.1, t.start, t, cycle_time) + else + error(pos, "invalid cycle_time") end end diff --git a/liquids/liquid.lua b/liquids/liquid.lua index efbb62b..38dffcd 100644 --- a/liquids/liquid.lua +++ b/liquids/liquid.lua @@ -16,6 +16,7 @@ local M = minetest.get_meta local N = function(pos) return minetest.get_node(pos).name end local LQD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).liquid end local Pipe = techage.LiquidPipe +local S = techage.S local net_def = techage.networks.net_def local networks = techage.networks @@ -74,6 +75,8 @@ end local function get_network_table(pos, outdir, ntype) + -- jump to the next node because pumps have to network + -- interfaces and therefore can't have a netID local pos2 = Pipe:get_connected_node_pos(pos, outdir) local mem = tubelib2.get_mem(pos2) if not mem.pipe or not mem.pipe.netID then @@ -115,7 +118,7 @@ function techage.liquid.put(pos, outdir, name, amount) -- wrong items? local peek = liquid.peek(item.pos, item.indir) if peek and peek ~= name then return amount end - techage.mark_position("singleplayer", item.pos, "put", "", 1) ------------------- debug + --techage.mark_position("singleplayer", item.pos, "put", "", 1) ------------------- debug amount = liquid.put(item.pos, item.indir, name, amount) if amount == 0 then break end end @@ -131,7 +134,7 @@ function techage.liquid.take(pos, outdir, name, amount) for _,item in ipairs(get_network_table(pos, outdir, "tank")) do local liquid = LQD(item.pos) if liquid and liquid.take then - techage.mark_position("singleplayer", item.pos, "take", "", 1) ------------------- debug + --techage.mark_position("singleplayer", item.pos, "take", "", 1) ------------------- debug local val, name = liquid.take(item.pos, item.indir, name, amount - taken) if val and name then taken = taken + val @@ -226,8 +229,21 @@ function techage.liquid.update_network(pos, outdir) delete_netID(pos, outdir) end +minetest.register_craftitem("techage:water", { + description = S("Water"), + inventory_image = "techage_water_inv.png", + groups = {not_in_creative_inventory=1}, + +}) -techage.register_liquid("bucket:bucket_water", "bucket:bucket_empty", 1, "default:water_source") -techage.register_liquid("bucket:bucket_river_water", "bucket:bucket_empty", 1, "default:river_water_source") +minetest.register_craftitem("techage:river_water", { + description = S("Water"), + inventory_image = "techage_water_inv.png", + groups = {not_in_creative_inventory=1}, + +}) + +techage.register_liquid("bucket:bucket_water", "bucket:bucket_empty", 1, "techage:water") +techage.register_liquid("bucket:bucket_river_water", "bucket:bucket_empty", 1, "techage:river_water") techage.register_liquid("bucket:bucket_lava", "bucket:bucket_empty", 1, "default:lava_source") diff --git a/liquids/oil_lib.lua b/liquids/oil_lib.lua index b59ba98..726a342 100644 --- a/liquids/oil_lib.lua +++ b/liquids/oil_lib.lua @@ -54,25 +54,32 @@ local function formspec_oil(x, y, mem) if mem.running then fuel_percent = ((mem.burn_cycles or 1) * 100) / (mem.burn_cycles_total or 1) end +-- return "container["..x..","..y.."]".. +-- "background[0,0;2,2.05;techage_form_grey.png]".. +-- "image[0,0;1,1;techage_form_input_arrow.png]".. +-- "image[1,0;1,1;default_furnace_fire_bg.png^[lowpart:".. +-- fuel_percent..":default_furnace_fire_fg.png]".. +-- techage.item_image(1, 1, itemname).. +-- "list[context;fuel;0,1;1,1;]".. +-- "container_end[]" return "container["..x..","..y.."]".. - "background[0,0;2,2.05;techage_form_grey.png]".. - "image[0,0;1,1;techage_form_input_arrow.png]".. - "image[1,0;1,1;default_furnace_fire_bg.png^[lowpart:".. + "background[0,0;3,1.05;techage_form_grey.png]".. + "list[context;fuel;0,0;1,1;]".. + techage.item_image(1, 0, itemname).. + "image[2,0;1,1;default_furnace_fire_bg.png^[lowpart:".. fuel_percent..":default_furnace_fire_fg.png]".. - techage.item_image(1, 1, itemname).. - "list[context;fuel;0,1;1,1;]".. "container_end[]" end function techage.oilburner.formspec(mem) local update = ((mem.countdown or 0) > 0 and mem.countdown) or S("Update") - return "size[8,6]".. + return "size[8,5]".. default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - formspec_oil(2, 0, mem).. - "button[5.5,0.5;2,1;update;"..update.."]".. - "list[current_player;main;0,2.3;8,4;]" + formspec_oil(1, 0, mem).. + "button[5,0;2,1;update;"..update.."]".. + "list[current_player;main;0,1.3;8,4;]" end local function fill_container(pos, inv, mem) diff --git a/liquids/pump.lua b/liquids/pump.lua index a11f26f..215ea57 100644 --- a/liquids/pump.lua +++ b/liquids/pump.lua @@ -77,13 +77,13 @@ end local function node_timer3(pos, elapsed) local mem = tubelib2.get_mem(pos) pumping(pos, mem, State3, CAPA) - return true + return State3:is_active(mem) end local function node_timer4(pos, elapsed) local mem = tubelib2.get_mem(pos) pumping(pos, mem, State4, CAPA * 2) - return true + return State4:is_active(mem) end local function on_rightclick(pos, node, clicker) @@ -196,7 +196,7 @@ minetest.register_node("techage:t3_pump", { after_place_node = after_place_node3, on_rightclick = on_rightclick, tubelib2_on_update2 = tubelib2_on_update2, - --on_timer = node_timer3, + on_timer = node_timer3, after_dig_node = after_dig_node, on_rotate = screwdriver.disallow, networks = nworks, @@ -231,7 +231,7 @@ minetest.register_node("techage:t4_pump", { after_place_node = after_place_node4, on_rightclick = on_rightclick, tubelib2_on_update2 = tubelib2_on_update2, - --on_timer = node_timer4, + on_timer = node_timer4, after_dig_node = after_dig_node, on_rotate = screwdriver.disallow, networks = nworks, diff --git a/textures/techage_appl_color_top.png b/textures/techage_appl_color_top.png index 37aeb2a..765c1db 100644 Binary files a/textures/techage_appl_color_top.png and b/textures/techage_appl_color_top.png differ diff --git a/textures/techage_appl_pump.png b/textures/techage_appl_pump.png index a369e0d..c472130 100644 Binary files a/textures/techage_appl_pump.png and b/textures/techage_appl_pump.png differ diff --git a/textures/techage_appl_pump8.png b/textures/techage_appl_pump8.png index 4310825..9117452 100644 Binary files a/textures/techage_appl_pump8.png and b/textures/techage_appl_pump8.png differ diff --git a/textures/techage_appl_pump_up.png b/textures/techage_appl_pump_up.png index c58f998..f9700b6 100644 Binary files a/textures/techage_appl_pump_up.png and b/textures/techage_appl_pump_up.png differ diff --git a/textures/techage_appl_pump_up8.png b/textures/techage_appl_pump_up8.png index e5ce81a..5841169 100644 Binary files a/textures/techage_appl_pump_up8.png and b/textures/techage_appl_pump_up8.png differ diff --git a/textures/techage_appl_tank.png b/textures/techage_appl_tank.png index 449fed8..1d1a401 100644 Binary files a/textures/techage_appl_tank.png and b/textures/techage_appl_tank.png differ diff --git a/textures/techage_barrel_inv.png b/textures/techage_barrel_inv.png index d05ba2c..cf2a4ab 100644 Binary files a/textures/techage_barrel_inv.png and b/textures/techage_barrel_inv.png differ diff --git a/textures/techage_barrel_oil_inv.png b/textures/techage_barrel_oil_inv.png index 23da888..985ae05 100644 Binary files a/textures/techage_barrel_oil_inv.png and b/textures/techage_barrel_oil_inv.png differ diff --git a/textures/techage_barrel_water_inv.png b/textures/techage_barrel_water_inv.png new file mode 100644 index 0000000..28992f6 Binary files /dev/null and b/textures/techage_barrel_water_inv.png differ diff --git a/textures/techage_filling8_ta3.png b/textures/techage_filling8_ta3.png index 68920c1..d5504d4 100644 Binary files a/textures/techage_filling8_ta3.png and b/textures/techage_filling8_ta3.png differ diff --git a/textures/techage_form_arrow_fg.png b/textures/techage_form_arrow_fg.png index b8ffd16..0d59d86 100644 Binary files a/textures/techage_form_arrow_fg.png and b/textures/techage_form_arrow_fg.png differ diff --git a/textures/techage_form_grey.png b/textures/techage_form_grey.png index cddf960..6f1c9a3 100644 Binary files a/textures/techage_form_grey.png and b/textures/techage_form_grey.png differ diff --git a/textures/techage_form_input_arrow.png b/textures/techage_form_input_arrow.png index 8de6aac..fc46b89 100644 Binary files a/textures/techage_form_input_arrow.png and b/textures/techage_form_input_arrow.png differ diff --git a/textures/techage_form_level_red_fg.png b/textures/techage_form_level_red_fg.png index 2e02102..c6c8ded 100644 Binary files a/textures/techage_form_level_red_fg.png and b/textures/techage_form_level_red_fg.png differ diff --git a/textures/techage_form_output_arrow.png b/textures/techage_form_output_arrow.png index 285e416..5ffaa5b 100644 Binary files a/textures/techage_form_output_arrow.png and b/textures/techage_form_output_arrow.png differ diff --git a/textures/techage_form_tank.png b/textures/techage_form_tank.png index 308c5b1..ce3e807 100644 Binary files a/textures/techage_form_tank.png and b/textures/techage_form_tank.png differ diff --git a/textures/techage_frame8_ta3.png b/textures/techage_frame8_ta3.png index a7091bf..406f303 100644 Binary files a/textures/techage_frame8_ta3.png and b/textures/techage_frame8_ta3.png differ diff --git a/textures/techage_liquid_inv.png b/textures/techage_liquid_inv.png index 141fdc7..e733458 100644 Binary files a/textures/techage_liquid_inv.png and b/textures/techage_liquid_inv.png differ diff --git a/textures/techage_reactor_filler_top.png b/textures/techage_reactor_filler_top.png index a105fbb..7bc7ba9 100644 Binary files a/textures/techage_reactor_filler_top.png and b/textures/techage_reactor_filler_top.png differ diff --git a/textures/techage_reactor_side.png b/textures/techage_reactor_side.png index d91bc0a..5845854 100644 Binary files a/textures/techage_reactor_side.png and b/textures/techage_reactor_side.png differ diff --git a/textures/techage_reactor_stand_back.png b/textures/techage_reactor_stand_back.png index 38669c6..0fbefdc 100644 Binary files a/textures/techage_reactor_stand_back.png and b/textures/techage_reactor_stand_back.png differ diff --git a/textures/techage_reactor_stand_front.png b/textures/techage_reactor_stand_front.png index b377981..aa2c8ea 100644 Binary files a/textures/techage_reactor_stand_front.png and b/textures/techage_reactor_stand_front.png differ diff --git a/textures/techage_reactor_stand_side.png b/textures/techage_reactor_stand_side.png index 91c521f..447a4ba 100644 Binary files a/textures/techage_reactor_stand_side.png and b/textures/techage_reactor_stand_side.png differ diff --git a/textures/techage_water_inv.png b/textures/techage_water_inv.png new file mode 100644 index 0000000..0946393 Binary files /dev/null and b/textures/techage_water_inv.png differ