From 4379b1904ddaccb1763ccba03ec0acac377d0128 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 31 Jan 2015 00:06:27 +0100 Subject: [PATCH] add decorative tubes: one steel block embedded the other passing through an airtight pane --- decorative_tubes.lua | 79 ++++++++++++++++++ init.lua | 1 + .../pipeworks_pane_embedded_tube_ends.png | Bin 0 -> 1195 bytes .../pipeworks_pane_embedded_tube_sides.png | Bin 0 -> 963 bytes 4 files changed, 80 insertions(+) create mode 100644 decorative_tubes.lua create mode 100644 textures/pipeworks_pane_embedded_tube_ends.png create mode 100644 textures/pipeworks_pane_embedded_tube_sides.png diff --git a/decorative_tubes.lua b/decorative_tubes.lua new file mode 100644 index 0000000..90e92d9 --- /dev/null +++ b/decorative_tubes.lua @@ -0,0 +1,79 @@ +local straight = function(pos, node, velocity, stack) return {velocity} end + +minetest.register_node("pipeworks:steel_block_embedded_tube", { + description = "Airtight steelblock embedded tube", + tiles = { + "default_steel_block.png", "default_steel_block.png", + "default_steel_block.png", "default_steel_block.png", + "default_steel_block.png^pipeworks_tube_connection_metallic.png", + "default_steel_block.png^pipeworks_tube_connection_metallic.png", + }, + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1}, + legacy_facedir_simple = true, + sounds = default.node_sound_stone_defaults(), + tube = { + connect_sides = {front = 1, back = 1,}, + priority = 50, + can_go = straight, + can_insert = function(pos, node, stack, direction) + local dir = minetest.facedir_to_dir(node.param2) + return vector.equals(dir, direction) or vector.equals(vector.multiply(dir, -1), direction) + end, + }, +}) + +minetest.register_craft( { + output = "pipeworks:steel_block_embedded_tube 1", + recipe = { + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, + { "default:steel_ingot", "pipeworks:tube_1", "default:steel_ingot" }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } + }, +}) + +local pane_box = { + type = "fixed", + fixed = { + { -9/64, -9/64, -8/16, 9/64, 9/64, 8/16 }, -- tube + { -8/16, -8/16, -1/16, 8/16, 8/16, 1/16 } -- pane + } +} +minetest.register_node("pipeworks:steel_pane_embedded_tube", { + drawtype = "nodebox", + description = "Airtight panel embedded tube ", + tiles = { + "pipeworks_pane_embedded_tube_sides.png^[transformR90", + "pipeworks_pane_embedded_tube_sides.png^[transformR90", + "pipeworks_pane_embedded_tube_sides.png", + "pipeworks_pane_embedded_tube_sides.png", + "pipeworks_pane_embedded_tube_ends.png", "pipeworks_pane_embedded_tube_ends.png", + }, + node_box = pane_box, + selection_box = pane_box, + collision_box = pane_box, + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1}, + legacy_facedir_simple = true, + sounds = default.node_sound_stone_defaults(), + tube = { + connect_sides = {front = 1, back = 1,}, + priority = 50, + can_go = straight, + can_insert = function(pos, node, stack, direction) + local dir = minetest.facedir_to_dir(node.param2) + return vector.equals(dir, direction) or vector.equals(vector.multiply(dir, -1), direction) + end, + }, +}) + +minetest.register_craft( { + output = "pipeworks:steel_pane_embedded_tube 1", + recipe = { + { "", "pipeworks:tube_1t", "" }, + { "default:steel_ingot", "pipeworks:tube_1", "default:steel_ingot" }, + { "", "pipeworks:tube_1", "" } + }, +}) diff --git a/init.lua b/init.lua index ef8c00a..5ed4074 100644 --- a/init.lua +++ b/init.lua @@ -120,6 +120,7 @@ dofile(pipeworks.modpath.."/routing_tubes.lua") dofile(pipeworks.modpath.."/sorting_tubes.lua") dofile(pipeworks.modpath.."/vacuum_tubes.lua") dofile(pipeworks.modpath.."/signal_tubes.lua") +dofile(pipeworks.modpath.."/decorative_tubes.lua") dofile(pipeworks.modpath.."/filter-injector.lua") dofile(pipeworks.modpath.."/trashcan.lua") dofile(pipeworks.modpath.."/wielder.lua") diff --git a/textures/pipeworks_pane_embedded_tube_ends.png b/textures/pipeworks_pane_embedded_tube_ends.png new file mode 100644 index 0000000000000000000000000000000000000000..93cc2d0b5f2fb0cda7f5242939a6aeab7d0b4dda GIT binary patch literal 1195 zcmV;c1XTNpP)Gyi@}m^?tO(>pfpuv%%nh&4RV=t?)x5azoqY)QgmSy#fNQ8F%n~-;fF3 z^$7GF$Zcm#y$T=7`_Q;Y`#N^L{3>L`4!%&(rvVxbSMXt4vf>tgExkRw&wap8Bj*Y} zhdT^8aM$z20PlMe)-@EH!pmW=M#L72Pra80Uvhx^J!sh0aT1C#-_6AP$B%`7hDXb_ zk^`WY%OfXJ_sc#z{58OTZJX{mX?i5IGLni3ykuhFI|ujY1N`>|ywE#G>#a)b``q=` zo}Z^40Q{0`_&v6tqX6=e?V>b>B5g60&CJ$-ctJLkev71&y>s zjrx9EJ#b`z^}djx*ZMv#yPoyo&G!XBxF$u-+H+MBkqoV7o8q znZCE?fc?Ipu}RBkeLqgTX9Fzv1wGaG-)0JI_XSNy`u@vA!O49=PxSqd&9;;CJZHWC z;J%>o@~Uam_iyhDYJtZs{JZ;tzSZ~s<$XcpOMQ=5_l20J;ph5Z@bfVPI%V$ zC-;S#dOQF%J{;8V^?koBSndm{m=c(RWQ4!c_b2y-9{Pa-8~k41a~z)U3vp<~X^y~C z@OS#&mvpq<7g+FCBNRsXy}r+0Tki|2;!03E{7&BkC-;T8oVby5;2Hi(-wRIe3-!{( zQ%7yyU+a6>-WPh+&y|pe)5PN~?@8aw@GI=6`$Amcf&ZiZg{B8&ie>-+002ov JPDHLkV1i{cUV8ul literal 0 HcmV?d00001 diff --git a/textures/pipeworks_pane_embedded_tube_sides.png b/textures/pipeworks_pane_embedded_tube_sides.png new file mode 100644 index 0000000000000000000000000000000000000000..c5f177e733725db85d2d017319fdceb2d214e573 GIT binary patch literal 963 zcmV;!13dhRP)Ile6_p1U>I!B;U2|5HwD+st60d)o# z(uM=FI{%dj2<9BZ7J!brfVSuZ;_e%k0B^+7sssZ9+9H6Q zf5OmKC9rx1nvgILqSPjU>@bV5W&sRJVAUyjZ5{ce{uMeGo#Lhiob74k)<_!&99cOP zxiHCh<)4C~KDf17S3*Z{_W|_)2KU7|Bh!h*K}8_>UR)a|-(8#zDq1|$!MUP@K*wdz zddOKT)k+3s?8GWVjYz6y;d0$GWR9N}8HFLWk9B%bf(XDfwMCRDB3v!(`Fv*$iXoBss)s8Miu^FZi%0RVa^L*fg_>~O4^AkAa66Z;N zUDtYPlRAQnH5(z9)$|u)?gO7)ZlnT7OG;aMH0WF z?OB$WVig75EC6+WSUUvN?}&R2V5qr)zYmPNKwR}ti&Y%Zs_$cq0P^j2cqeF7 lg5jND?{CHVNi(fP;4hW&wsM-;=|}(o002ovPDHLkV1i)cxbOe~ literal 0 HcmV?d00001