diff --git a/basis/tube_wall_entry.lua b/basis/tube_wall_entry.lua new file mode 100644 index 0000000..d850e83 --- /dev/null +++ b/basis/tube_wall_entry.lua @@ -0,0 +1,57 @@ +--[[ + + TechAge + ======= + + Copyright (C) 2019-2020 Joachim Stolberg + + GPL v3 + See LICENSE.txt for more information + + Tube wall entry + +]]-- + +local S = techage.S + +local Tube = techage.Tube + +minetest.register_node("techage:tube_wall_entry", { + description = S("Tube Wall Entry"), + tiles = { + -- up, down, right, left, back, front + "basic_materials_concrete_block.png", + "basic_materials_concrete_block.png", + "basic_materials_concrete_block.png", + "basic_materials_concrete_block.png", + "basic_materials_concrete_block.png^techage_tube_hole.png", + "basic_materials_concrete_block.png^techage_tube_hole.png", + }, + + after_place_node = function(pos, placer, itemstack, pointed_thing) + if not Tube:after_place_tube(pos, placer, pointed_thing) then + minetest.remove_node(pos) + return true + end + return false + end, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + Tube:after_dig_tube(pos, oldnode, oldmetadata) + end, + + paramtype2 = "facedir", -- important! + on_rotate = screwdriver.disallow, -- important! + groups = {crumbly = 2, cracky = 2, snappy = 2}, + is_ground_content = false, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_craft({ + output = "techage:tube_wall_entry", + recipe = { + {"", "techage:tubeS", ""}, + {"", "basic_materials:concrete_block", ""}, + {"", "",""}, + }, +}) diff --git a/basis/tubes.lua b/basis/tubes.lua index 6e4ac00..d3848ff 100644 --- a/basis/tubes.lua +++ b/basis/tubes.lua @@ -3,7 +3,7 @@ TechAge ======= - Copyright (C) 2019 Joachim Stolberg + Copyright (C) 2019-2020 Joachim Stolberg GPL v3 See LICENSE.txt for more information @@ -28,11 +28,17 @@ local Tube = tubelib2.Tube:new({ dirs_to_check = {1,2,3,4,5,6}, max_tube_length = 200, show_infotext = false, - primary_node_names = {"techage:tubeS", "techage:tubeA", "techage:ta4_tubeS", "techage:ta4_tubeA"}, + primary_node_names = { + "techage:tubeS", "techage:tubeA", + "techage:ta4_tubeS", "techage:ta4_tubeA", + "techage:tube_wall_entry", + }, after_place_tube = function(pos, param2, tube_type, num_tubes, tbl) local name = minetest.get_node(pos).name if name == "techage:tubeS" or name == "techage:tubeA" then minetest.swap_node(pos, {name = "techage:tube"..tube_type, param2 = param2}) + elseif name == "techage:tube_wall_entry" then + minetest.swap_node(pos, {name = "techage:tube_wall_entry", param2 = param2}) else minetest.swap_node(pos, {name = "techage:ta4_tube"..tube_type, param2 = param2}) end diff --git a/doc/items.lua b/doc/items.lua index 6c3531c..afb5881 100644 --- a/doc/items.lua +++ b/doc/items.lua @@ -105,6 +105,9 @@ techage.Items = { ta3_doorblock = "techage:doorblock20", ta3_programmer = "techage:programmer", ta3_doorcontroller = "techage:ta3_doorcontroller", + ta3_drill_pipe_wrench = "techage:ta3_drill_pipe_wrench", + ta3_pipe = "techage:ta3_pipeS", + ta3_pipe_wall_entry = "techage:ta3_pipe_wall_entry", ---------------------------- techage_ta4 = "techage_ta4.png", ta4_windturbine = "techage:ta4_wind_turbine", diff --git a/doc/manual_DE.lua b/doc/manual_DE.lua index a147aa2..f116355 100644 --- a/doc/manual_DE.lua +++ b/doc/manual_DE.lua @@ -72,6 +72,8 @@ techage.manual_DE.aTitel = { "3,TA3 Tank / TA3 Tank", "3,TA3 Pumpe / TA3 Pump", "3,TA Einfülltrichter / TA Liquid Filler", + "3,TA4 Röhre / Pipe", + "3,TA3 Rohr/Wanddurchbruch / TA3 Pipe Wall Entry Blöcke", "2,Öl-Förderung", "3,TA3 Ölexplorer / Oil Explorer", "3,TA3 Ölbohrkiste / Oil Drill Box", @@ -681,6 +683,15 @@ techage.manual_DE.aText = { "\n".. "\n".. "\n", + "Die gelben Röhren dienen zur Weiterleitung von Gas und Flüssigkeiten. \n".. + "Die maximale Leitungslänge beträgt 100 m.\n".. + "\n".. + "\n".. + "\n", + "Die Blöcke dienen als Wanddurchbrüche für Röhren\\, so dass keine Löcher offen bleiben.\n".. + "\n".. + "\n".. + "\n", "Um deine Generatoren und Öfen mit Öl betreiben zu können\\, muss du zuerst nach Öl suchen und einen Bohrturm errichten und danach das Öl fördern.\n".. "Dazu dienen dir TA3 Ölexplorer\\, TA3 Ölbohrkiste und TA3 Ölpumpe.\n".. "\n".. @@ -982,6 +993,8 @@ techage.manual_DE.aText = { "\n".. "\n", "Mit diesem Werkzeug lassen sich die Bohrgestängezange Blöcke wieder entfernen\\, wenn dort bspw. ein Tunnel durch soll.\n".. + "\n".. + "\n".. "\n", "Regenerative Energiequellen wie Wind\\, Sonne und Biokraft helfen dir\\, das Ölzeitalter zu verlassen. Mit modernen Technologien und intelligenten Maschinen machst du dich auf in die Zukunft.\n".. "\n".. @@ -1106,7 +1119,7 @@ techage.manual_DE.aText = { "\n", "Je ein Rohrzulaufblock muss auf beiden Seiten des Speicherblockes eingebaut werden. Die Blöcke müssen sich exakt gegenüber stehen.\n".. "\n".. - "Die Rohrzulaufblöcke können alternativ auch als Wanddurchbrüche verwendet werden\\, um also mit einer Röhre durch eine Wand zu fahren.\n".. + "Die Rohrzulaufblöcke können *nicht* als normale Wanddurchbrüche verwendet werden\\, dazu die TA3 Rohr/Wanddurchbruch / TA3 Pipe Wall Entry Blöcke verwenden.\n".. "\n".. "\n".. "\n", @@ -1468,6 +1481,8 @@ techage.manual_DE.aItemName = { "ta3_tank", "ta3_pump", "ta3_filler", + "ta3_pipe", + "ta3_pipe_wall_entry", "techage_ta3", "ta3_oilexplorer", "ta3_drillbox", @@ -1507,7 +1522,7 @@ techage.manual_DE.aItemName = { "ta3_end_wrench", "ta3_programmer", "ta3_trowel", - "", + "ta3_drill_pipe_wrench", "techage_ta4", "", "ta4_windturbine", @@ -1649,6 +1664,8 @@ techage.manual_DE.aPlanTable = { "", "", "", + "", + "", "ta3_loading", "", "ta3_distiller", diff --git a/energy_storage/inlet.lua b/energy_storage/inlet.lua index 4eaeb7e..9185723 100644 --- a/energy_storage/inlet.lua +++ b/energy_storage/inlet.lua @@ -3,7 +3,7 @@ TechAge ======= - Copyright (C) 2019 Joachim Stolberg + Copyright (C) 2019-2020 Joachim Stolberg GPL v3 See LICENSE.txt for more information @@ -29,26 +29,6 @@ local function after_dig_node(pos, oldnode, oldmetadata, digger) Pipe:after_dig_node(pos) end -local function tubelib2_on_update2(pos, outdir, tlib2, node) - techage.liquid.update_network(pos, outdir) - local conn = M(pos):get_int("pipe2_conn") - if conn == 20 or conn == 40 then - -- replace node by tube - minetest.remove_node(pos) - Pipe:after_dig_node(pos) - node.name = "techage:ta4_wall_pipe" - minetest.set_node(pos, node) - Pipe:after_place_tube(pos) - end -end - -local networks_def = { - pipe2 = { - sides = {F=1, B=1}, - ntype = "tank", - }, -} - minetest.register_node("techage:ta4_pipe_inlet", { description = S("TA4 Pipe Inlet"), tiles = { @@ -63,8 +43,6 @@ minetest.register_node("techage:ta4_pipe_inlet", { after_place_node = after_place_node, after_dig_node = after_dig_node, - tubelib2_on_update2 = tubelib2_on_update2, - networks = networks_def, paramtype2 = "facedir", -- important! on_rotate = screwdriver.disallow, -- important! @@ -73,41 +51,6 @@ minetest.register_node("techage:ta4_pipe_inlet", { sounds = default.node_sound_metal_defaults(), }) -minetest.register_node("techage:ta4_wall_pipe", { - description = S("TA4 Wall Pipe"), - tiles = { - -- up, down, right, left, back, front - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png^techage_tes_inlet.png", - "basic_materials_concrete_block.png^techage_tes_inlet.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Pipe:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if oldmetadata and oldmetadata.fields and oldmetadata.fields.tl2_param2 then - oldnode.param2 = oldmetadata.fields.tl2_param2 - Pipe:after_dig_tube(pos, oldnode) - end - end, - - paramtype2 = "facedir", -- important! - on_rotate = screwdriver.disallow, -- important! - groups = {crumbly = 2, cracky = 2, snappy = 2, not_in_creative_inventory = 1}, - is_ground_content = false, - drop = "techage:ta4_pipe_inlet", - sounds = default.node_sound_metal_defaults(), -}) - Pipe:add_secondary_node_names({"techage:ta4_pipe_inlet"}) local Numbers = { diff --git a/init.lua b/init.lua index 0422b19..7754c06 100644 --- a/init.lua +++ b/init.lua @@ -28,6 +28,7 @@ else dofile(MP.."/basis/node_states.lua") -- state model dofile(MP.."/basis/tubes.lua") -- tubes for item transport dofile(MP.."/basis/tubes_ta4.lua") -- TA4 tubes for item transport + dofile(MP.."/basis/tube_wall_entry.lua") dofile(MP.."/basis/command.lua") -- command API dofile(MP.."/basis/firebox_lib.lua") -- common firebox functions dofile(MP.."/basis/boiler_lib.lua") -- common boiler functions @@ -92,6 +93,7 @@ else -- Liquids I dofile(MP.."/liquids/liquid_pipe.lua") dofile(MP.."/liquids/node_api.lua") + dofile(MP.."/liquids/pipe_wall_entry.lua") -- Basic Machines dofile(MP.."/basic_machines/consumer.lua") -- consumer base model diff --git a/liquids/liquid_pipe.lua b/liquids/liquid_pipe.lua index d897b0e..4da00ee 100644 --- a/liquids/liquid_pipe.lua +++ b/liquids/liquid_pipe.lua @@ -27,12 +27,15 @@ local Pipe = tubelib2.Tube:new({ show_infotext = false, force_to_use_tubes = true, tube_type = "pipe2", - primary_node_names = {"techage:ta3_pipeS", "techage:ta3_pipeA", "techage:ta4_wall_pipe"}, + primary_node_names = { + "techage:ta3_pipeS", "techage:ta3_pipeA", + "techage:ta3_pipe_wall_entry", + }, secondary_node_names = {}, after_place_tube = function(pos, param2, tube_type, num_tubes) local name = minetest.get_node(pos).name - if name == "techage:ta4_wall_pipe" then - minetest.swap_node(pos, {name = "techage:ta4_wall_pipe", param2 = param2}) + if name == "techage:ta3_pipe_wall_entry" then + minetest.swap_node(pos, {name = "techage:ta3_pipe_wall_entry", param2 = param2}) else minetest.swap_node(pos, {name = "techage:ta3_pipe"..tube_type, param2 = param2}) end diff --git a/liquids/pipe_wall_entry.lua b/liquids/pipe_wall_entry.lua new file mode 100644 index 0000000..48b923a --- /dev/null +++ b/liquids/pipe_wall_entry.lua @@ -0,0 +1,57 @@ +--[[ + + TechAge + ======= + + Copyright (C) 2019-2020 Joachim Stolberg + + GPL v3 + See LICENSE.txt for more information + + TA3/TA4 Liquid Pipe Wall Entry + +]]-- + +local S = techage.S + +local Pipe = techage.LiquidPipe + +minetest.register_node("techage:ta3_pipe_wall_entry", { + description = S("TA3 Pipe Wall Entry"), + tiles = { + -- up, down, right, left, back, front + "basic_materials_concrete_block.png", + "basic_materials_concrete_block.png", + "basic_materials_concrete_block.png", + "basic_materials_concrete_block.png", + "basic_materials_concrete_block.png^techage_appl_hole_pipe.png", + "basic_materials_concrete_block.png^techage_appl_hole_pipe.png", + }, + + after_place_node = function(pos, placer, itemstack, pointed_thing) + if not Pipe:after_place_tube(pos, placer, pointed_thing) then + minetest.remove_node(pos) + return true + end + return false + end, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + Pipe:after_dig_tube(pos, oldnode, oldmetadata) + end, + + paramtype2 = "facedir", -- important! + on_rotate = screwdriver.disallow, -- important! + groups = {crumbly = 2, cracky = 2, snappy = 2}, + is_ground_content = false, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_craft({ + output = "techage:ta3_pipe_wall_entry", + recipe = { + {"", "techage:ta3_pipeS", ""}, + {"", "basic_materials:concrete_block", ""}, + {"", "",""}, + }, +}) diff --git a/locale/techage.de.tr b/locale/techage.de.tr index a5d4d8c..6339fbd 100644 --- a/locale/techage.de.tr +++ b/locale/techage.de.tr @@ -266,6 +266,7 @@ TA3 Oil Explorer=TA3 Ölexplorer TA3 Oil Reboiler=TA3 Aufkocher TA3 Oil Reboiler: blocked=TA3 Aufkocher: blockiert TA3 Oil Storage=TA3 Öl Speicher +TA3 Pipe Wall Entry=TA3 Rohr/Wanddurchbruch TA3 Player Detector=TA3 Spieler Detektor TA3 Power Station Firebox=TA3 Kraftwerks-Feuerbox TA3 Power Station Oil Burner=TA3 Kraftwerks-Ölbrenner @@ -333,7 +334,6 @@ TA4 Streetlamp Solar Cell=TA4 Straßenlampen-Solarzelle TA4 Tank=TA4 Tank TA4 Turbine=TA4 Turbine TA4 WLAN Chip=TA4 WLAN Chip -TA4 Wall Pipe=TA4 Wandröhre TA4 Water Pump=Wasserpumpe TA4 Wind Turbine=TA4 Windkraftanlage TA4 Wind Turbine Nacelle=TA4 Windkraftanlagengondel @@ -363,6 +363,7 @@ To add fuel punch@nthis block@nwith a fuel container=Um Brennstoff nachzufüllen To add liquids punch@nthe tank@nwith a liquid container=Um Flüssigkeit nachzufüllen,@nschlage mit einem Flüssigkeitsbehälter@nauf den Block To add water punch@nthe boiler@nwith a water bucket=Um Wasser nachzufüllen,@nschlage mit einem Wassereimer@nauf den Block To many blocks in the power grid!=Zu viele Blöcke im Stromnetz! +Tube Wall Entry=Tube Wanddurchbruch Turned on:=Eingeschaltet: Type=Typ Unlock=Entsperren @@ -412,6 +413,7 @@ no fuel or no power=kein Strom oder Brennstoff no oil=Kein Öl no power=kein Strom no usable water=Kein brauchbares Wasser +not connected=nicht verbunden off=aus on=an power=Energie @@ -424,4 +426,5 @@ stopped=gestoppt storage empty?=Speicher leer? water temperature=Wassertemperatur wrong storage diameter=Falscher Wärmespeicher-Durchmesser -##### not used anymore ##### \ No newline at end of file +##### not used anymore ##### +TA4 Wall Pipe=TA4 Wandröhre \ No newline at end of file diff --git a/locale/template.txt b/locale/template.txt index 359cb45..c9e663e 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -264,6 +264,7 @@ TA3 Oil Explorer= TA3 Oil Reboiler= TA3 Oil Reboiler: blocked= TA3 Oil Storage= +TA3 Pipe Wall Entry= TA3 Player Detector= TA3 Power Station Firebox= TA3 Power Station Oil Burner= @@ -331,7 +332,6 @@ TA4 Streetlamp Solar Cell= TA4 Tank= TA4 Turbine= TA4 WLAN Chip= -TA4 Wall Pipe= TA4 Water Pump= TA4 Wind Turbine= TA4 Wind Turbine Nacelle= @@ -361,6 +361,7 @@ To add fuel punch@nthis block@nwith a fuel container= To add liquids punch@nthe tank@nwith a liquid container= To add water punch@nthe boiler@nwith a water bucket= To many blocks in the power grid!= +Tube Wall Entry= Turned on:= Type= Unlock= @@ -410,6 +411,7 @@ no fuel or no power= no oil= no power= no usable water= +not connected= off= on= power= diff --git a/manuals/manual_ta3_DE.md b/manuals/manual_ta3_DE.md index 3e0f595..7895b57 100644 --- a/manuals/manual_ta3_DE.md +++ b/manuals/manual_ta3_DE.md @@ -285,6 +285,19 @@ Dabei ist zu beachten, dass Fässer nur komplett gefüllt oder entleert werden k [ta3_filler|image] +### TA4 Röhre / Pipe + +Die gelben Röhren dienen zur Weiterleitung von Gas und Flüssigkeiten. +Die maximale Leitungslänge beträgt 100 m. + +[ta3_pipe|image] + +### TA3 Rohr/Wanddurchbruch / TA3 Pipe Wall Entry Blöcke + +Die Blöcke dienen als Wanddurchbrüche für Röhren, so dass keine Löcher offen bleiben. + +[ta3_pipe_wall_entry|image] + ## Öl-Förderung @@ -708,3 +721,5 @@ Die Kelle dient zum Verputzen von Stromkabel. Siehe dazu "TA Stromkabel". ### TA3 Bohrgestängezange / TA3 Drill Pipe Wrench Mit diesem Werkzeug lassen sich die Bohrgestängezange Blöcke wieder entfernen, wenn dort bspw. ein Tunnel durch soll. + +[ta3_drill_pipe_wrench|image] \ No newline at end of file diff --git a/manuals/manual_ta4_DE.md b/manuals/manual_ta4_DE.md index 4746112..06af2e4 100644 --- a/manuals/manual_ta4_DE.md +++ b/manuals/manual_ta4_DE.md @@ -175,7 +175,7 @@ Der Generator kann 60 ku abgeben. Je ein Rohrzulaufblock muss auf beiden Seiten des Speicherblockes eingebaut werden. Die Blöcke müssen sich exakt gegenüber stehen. -Die Rohrzulaufblöcke können alternativ auch als Wanddurchbrüche verwendet werden, um also mit einer Röhre durch eine Wand zu fahren. +Die Rohrzulaufblöcke können **nicht** als normale Wanddurchbrüche verwendet werden, dazu die TA3 Rohr/Wanddurchbruch / TA3 Pipe Wall Entry Blöcke verwenden. [ta4_pipeinlet|image] @@ -187,7 +187,6 @@ Die maximale Leitungslänge beträgt 100 m. [ta4_pipe|image] - ## Wasserstoff Strom kann mittels Elektrolyse in Wasserstoff und Sauerstoff aufgespalten werden. Auf der anderen Seite kann über eine Brennstoffzelle Wasserstoff mit Sauerstoff aus der Luft wieder in Strom umgewandelt werden. diff --git a/manuals/ta4_lua_controller_EN.md b/manuals/ta4_lua_controller_EN.md index c291335..3b6abfe 100644 --- a/manuals/ta4_lua_controller_EN.md +++ b/manuals/ta4_lua_controller_EN.md @@ -356,7 +356,7 @@ In addition to Lua standard function the Lua Controller provides the following f | "state" | one of: "red", "amber", "green", "off" | Signal Tower state | | "state" | one of: "empty", "loaded", "full" | State of a chest or Sensor Chest | | "fuel" | number | fuel value from fuel consuming block | -| "load" | number | Read the load value in percent (0..100) from a tank/storage block | +| "load" | number | Read the load value in percent (0..100) from a tank/storage block, an accu block, of from the Signs Bot Box. | | "delivered" | number | Read the current delivered power value from a generator block. A power consuming block (accu) provides a negative value | | "action" | player-name, action-string | only for Sensor Chests | | "stacks" | Array with up to 4 Stores with the inventory content (see example) | only for Sensor Chests | diff --git a/manuals/toc_DE.md b/manuals/toc_DE.md index d75864b..2320950 100644 --- a/manuals/toc_DE.md +++ b/manuals/toc_DE.md @@ -71,6 +71,8 @@ - [TA3 Tank / TA3 Tank](./manual_ta3_DE.md#ta3-tank--ta3-tank) - [TA3 Pumpe / TA3 Pump](./manual_ta3_DE.md#ta3-pumpe--ta3-pump) - [TA Einfülltrichter / TA Liquid Filler](./manual_ta3_DE.md#ta-einfülltrichter--ta-liquid-filler) + - [TA4 Röhre / Pipe](./manual_ta3_DE.md#ta4-röhre--pipe) + - [TA3 Rohr/Wanddurchbruch / TA3 Pipe Wall Entry Blöcke](./manual_ta3_DE.md#ta3-rohrwanddurchbruch--ta3-pipe-wall-entry-blöcke) - [Öl-Förderung](./manual_ta3_DE.md#Öl-förderung) - [TA3 Ölexplorer / Oil Explorer](./manual_ta3_DE.md#ta3-Ölexplorer--oil-explorer) - [TA3 Ölbohrkiste / Oil Drill Box](./manual_ta3_DE.md#ta3-Ölbohrkiste--oil-drill-box) diff --git a/power/distribution.lua b/power/distribution.lua index 1e5faa8..fc67921 100644 --- a/power/distribution.lua +++ b/power/distribution.lua @@ -100,6 +100,7 @@ local function set_taken(pos, taken, tlib_type) local def = nvm[tlib_type] -- power related network data if (def and def["calive"] or 0) > 0 then def["taken"] = taken + def["cstate"] = RUNNING return taken end return 0