From 8932edd126a283bb7d4bd8f04de5774af3867063 Mon Sep 17 00:00:00 2001 From: h-v-smacker Date: Mon, 2 Apr 2018 00:17:55 +0300 Subject: straight-only tube --- extranodes/depends.txt | 1 + extranodes/init.lua | 5 +++ extranodes/straight_tube.lua | 46 +++++++++++++++++++++ .../textures/pipeworks_straight_tube_input.png | Bin 0 -> 349 bytes .../textures/pipeworks_straight_tube_output.png | Bin 0 -> 349 bytes .../textures/pipeworks_straight_tube_side.png | Bin 0 -> 1703 bytes 6 files changed, 52 insertions(+) create mode 100644 extranodes/straight_tube.lua create mode 100644 extranodes/textures/pipeworks_straight_tube_input.png create mode 100644 extranodes/textures/pipeworks_straight_tube_output.png create mode 100644 extranodes/textures/pipeworks_straight_tube_side.png (limited to 'extranodes') diff --git a/extranodes/depends.txt b/extranodes/depends.txt index 15b9ef5..3274ff4 100644 --- a/extranodes/depends.txt +++ b/extranodes/depends.txt @@ -1,4 +1,5 @@ default +technic? technic_worldgen concrete unifieddyes? diff --git a/extranodes/init.lua b/extranodes/init.lua index ccecbaa..9a54687 100644 --- a/extranodes/init.lua +++ b/extranodes/init.lua @@ -3,6 +3,10 @@ -- Boilerplate to support localized strings if intllib mod is installed. local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end +-- some extras to the extras +local path = string.gsub(technic.modpath, "technic/technic", "technic/extranodes") +dofile(path.."/straight_tube.lua") + if minetest.get_modpath("moreblocks") then -- register stairsplus/circular_saw nodes @@ -257,6 +261,7 @@ minetest.register_node(":technic:trampoline", { sounds = {footstep = {name = "trampoline_boing", gain = 1.0}} }) + minetest.register_craft({ output = "technic:fall_dampener_50", recipe = { diff --git a/extranodes/straight_tube.lua b/extranodes/straight_tube.lua new file mode 100644 index 0000000..d3c19b8 --- /dev/null +++ b/extranodes/straight_tube.lua @@ -0,0 +1,46 @@ +-- straight-only pipe +-- does not connect side-wise, allows items in both directions +-- a counterpart to straight-only pipe, and a cheap alternative +-- to one-way tube for long segments of parallel pipes + +if minetest.get_modpath("pipeworks") then + + minetest.register_node(":pipeworks:straight_tube", { + description = "Straight-only Tube", + tiles = {"pipeworks_straight_tube_side.png", + "pipeworks_straight_tube_side.png", + "pipeworks_straight_tube_output.png", + "pipeworks_straight_tube_input.png", + "pipeworks_straight_tube_side.png", + "pipeworks_straight_tube_side.png"}, + paramtype2 = "facedir", + drawtype = "nodebox", + paramtype = "light", + node_box = {type = "fixed", + fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}}, + groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1}, + sounds = default.node_sound_wood_defaults(), + tube = { + connect_sides = {left = 1, right = 1}, + can_go = function(pos, node, velocity, stack) + return {velocity} + end, + can_insert = function(pos, node, stack, direction) + local dir = pipeworks.facedir_to_right_dir(node.param2) + local opdir = vector.multiply(dir, -1) + return vector.equals(dir, direction) or vector.equals(opdir, direction) + end, + priority = 60 -- Higher than normal tubes, but lower than one-way tubes + }, + after_place_node = pipeworks.after_place, + after_dig_node = pipeworks.after_dig, + }) + + minetest.register_craft({ + output = "pipeworks:straight_tube 3", + recipe = { + { "pipeworks:tube_1", "pipeworks:tube_1", "pipeworks:tube_1" }, + }, + }) + +end \ No newline at end of file diff --git a/extranodes/textures/pipeworks_straight_tube_input.png b/extranodes/textures/pipeworks_straight_tube_input.png new file mode 100644 index 0000000..8490858 Binary files /dev/null and b/extranodes/textures/pipeworks_straight_tube_input.png differ diff --git a/extranodes/textures/pipeworks_straight_tube_output.png b/extranodes/textures/pipeworks_straight_tube_output.png new file mode 100644 index 0000000..8490858 Binary files /dev/null and b/extranodes/textures/pipeworks_straight_tube_output.png differ diff --git a/extranodes/textures/pipeworks_straight_tube_side.png b/extranodes/textures/pipeworks_straight_tube_side.png new file mode 100644 index 0000000..b746911 Binary files /dev/null and b/extranodes/textures/pipeworks_straight_tube_side.png differ -- cgit v1.2.3