diff --git a/basic_machines/blackhole.lua b/basic_machines/blackhole.lua index 48f000d..0064d11 100644 --- a/basic_machines/blackhole.lua +++ b/basic_machines/blackhole.lua @@ -8,11 +8,32 @@ GPL v3 See LICENSE.txt for more information - All items disappear. + All items and liquids disappear. ]]-- local S = techage.S +local Pipe = techage.LiquidPipe +local liquid = techage.liquid + +local function take_liquid(pos, indir, name, amount) + return 0, name +end + +local function put_liquid(pos, indir, name, amount) + return 0 +end + +local function peek_liquid(pos, indir) + return nil +end + +local networks_def = { + pipe2 = { + sides = {R=1}, -- Pipe connection sides + ntype = "tank", + }, +} minetest.register_node("techage:blackhole", { description = S("TechAge Black Hole"), @@ -20,7 +41,7 @@ minetest.register_node("techage:blackhole", { -- up, down, right, left, back, front "techage_filling_ta2.png^techage_frame_ta2.png", "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png", + "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png^techage_appl_hole_pipe.png", "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png^techage_appl_inp.png", "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png", "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png", @@ -30,21 +51,35 @@ minetest.register_node("techage:blackhole", { local meta = minetest.get_meta(pos) local node = minetest.get_node(pos) meta:set_int("push_dir", techage.side_to_indir("L", node.param2)) - meta:set_string("infotext", S("TechAge Black Hole (let items disappear)")) + meta:set_string("infotext", S("TechAge Black Hole (let items and liquids disappear)")) + Pipe:after_place_node(pos) end, - + after_dig_node = function(pos, oldnode) + Pipe:after_dig_node(pos) + end, + tubelib2_on_update2 = function(pos, outdir, tlib2, node) + liquid.update_network(pos, outdir) + end, + on_rotate = screwdriver.disallow, paramtype2 = "facedir", groups = {choppy=2, cracky=2, crumbly=2}, is_ground_content = false, sounds = default.node_sound_wood_defaults(), + liquid = { + capa = 999999, + peek = peek_liquid, + put = put_liquid, + take = take_liquid, + }, + networks = networks_def, }) minetest.register_craft({ output = "techage:blackhole", recipe = { {"group:wood", "", "group:wood"}, - {"techage:tubeS", "default:coal_lump", ""}, + {"techage:tubeS", "default:coal_lump", "techage:ta3_pipeS"}, {"group:wood", "techage:iron_ingot", "group:wood"}, }, }) @@ -59,5 +94,6 @@ techage.register_node({"techage:blackhole"}, { return true end end, -}) +}) +Pipe:add_secondary_node_names({"techage:blackhole"}) diff --git a/locale/techage.de.tr b/locale/techage.de.tr index 2258d67..7c73ba5 100644 --- a/locale/techage.de.tr +++ b/locale/techage.de.tr @@ -355,7 +355,7 @@ TA4 Wind Turbine=TA4 Windkraftanlage TA4 Wind Turbine Nacelle=TA4 Windkraftanlagengondel TA4 Wind Turbine Signal Lamp=TA4 Windkraftanlagenlampe TechAge Black Hole=TechAge Schwarzes Loch -TechAge Black Hole (let items disappear)=TechAge Schwarzes Loch (Gegenstände verschwinden) +TechAge Black Hole (let items and liquids disappear)=TechAge Schwarzes Loch (Gegenstände und Flüssigkeiten verschwinden) TechAge Door Block=TechAge Türblock TechAge Gate Block=TechAge Torblock TechAge Gravel=TechAge Kies diff --git a/locale/template.txt b/locale/template.txt index 44d7739..a7d9563 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -353,7 +353,7 @@ TA4 Wind Turbine= TA4 Wind Turbine Nacelle= TA4 Wind Turbine Signal Lamp= TechAge Black Hole= -TechAge Black Hole (let items disappear)= +TechAge Black Hole (let items and liquids disappear)= TechAge Door Block= TechAge Gate Block= TechAge Gravel=