summaryrefslogtreecommitdiff
path: root/extranodes
diff options
context:
space:
mode:
authorh-v-smacker <hans-von-smacker+github@gmail.com>2018-04-02 00:17:55 +0300
committerh-v-smacker <hans-von-smacker+github@gmail.com>2018-04-02 00:17:55 +0300
commit8932edd126a283bb7d4bd8f04de5774af3867063 (patch)
treefc51b714e251e41942f4d8ad0a7bb525c51b131e /extranodes
parentef7f363cca2005e6920094757181e0b4c63e1120 (diff)
straight-only tube
Diffstat (limited to 'extranodes')
-rw-r--r--extranodes/depends.txt1
-rw-r--r--extranodes/init.lua5
-rw-r--r--extranodes/straight_tube.lua46
-rw-r--r--extranodes/textures/pipeworks_straight_tube_input.pngbin0 -> 349 bytes
-rw-r--r--extranodes/textures/pipeworks_straight_tube_output.pngbin0 -> 349 bytes
-rw-r--r--extranodes/textures/pipeworks_straight_tube_side.pngbin0 -> 1703 bytes
6 files changed, 52 insertions, 0 deletions
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
--- /dev/null
+++ b/extranodes/textures/pipeworks_straight_tube_input.png
Binary files 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
--- /dev/null
+++ b/extranodes/textures/pipeworks_straight_tube_output.png
Binary files 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
--- /dev/null
+++ b/extranodes/textures/pipeworks_straight_tube_side.png
Binary files differ