From 6b79a5c72843c3dc201ad6fc62d28ef7898ea4c5 Mon Sep 17 00:00:00 2001 From: cale Date: Sat, 9 Jul 2016 10:56:06 +0200 Subject: [PATCH] added fence --- mods/default/functions.lua | 28 +++++++++++++++++++ mods/default/nodes.lua | 18 ++++++++++++ mods/default/textures/default_straw_side.png | Bin 533 -> 506 bytes mods/pipe/init.lua | 6 ++-- mods/pipe/textures/pipe_bottom.png | Bin 0 -> 226 bytes mods/pipe/textures/pipe_side.png | Bin 234 -> 198 bytes mods/pipe/textures/pipe_top.png | Bin 288 -> 254 bytes 7 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 mods/pipe/textures/pipe_bottom.png diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 55e3b6e..4188a2f 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -14,6 +14,34 @@ function default.drop_items(pos, oldnode, oldmetadata, digger) end end +function default.register_fence(name,def) + def.description = def.description or minetest.registered_nodes[def.material].description .. " Fence" + def.tiles = def.tiles or minetest.registered_nodes[def.material].tiles + def.groups = def.groups or minetest.registered_nodes[def.material].groups + def.sounds = def.sounds or minetest.registered_nodes[def.material].sounds + def.drawtype = "nodebox" + def.node_box = { + type = "connected", + fixed = {{-3/16, -0.5, -3/16, 3/16, 0.5, 3/16}}, + connect_front = {{-2/16,-0.5,-1/2,2/16,0.5,-2/16}}, + connect_left = {{-1/2,-0.5,-2/16,-2/16,0.5,2/16}}, + connect_back = {{-2/16,-0.5,2/16,2/16,0.5,1/2}}, + connect_right = {{2/16,-0.5,-2/16,1/2,0.5,2/16}}, + } + def.paramtype = "light" + def.connects_to = {name, "group:cracky", "group:choppy"} + + minetest.register_node(name, def) + + minetest.register_craft({ + output = name .. " 12", + recipe = { + {def.material, def.material, def.material}, + {def.material, def.material, def.material} + } + }) +end + default.sounds = {} function default.sounds.wood(t) diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 9d492ba..769a617 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -846,3 +846,21 @@ minetest.register_node("default:rail", { walkable = false, groups = {choppy = 1, attached_node = 1}, }) + +-- fences + +default.register_fence("default:fence_wood", { + material = "default:wood", +}) + +default.register_fence("default:fence_cobble", { + material = "default:cobble", +}) + +default.register_fence("default:fence_jungle_wood", { + material = "default:jungle_wood", +}) + +default.register_fence("default:fence_quartz", { + material = "default:quartz", +}) diff --git a/mods/default/textures/default_straw_side.png b/mods/default/textures/default_straw_side.png index e9eabb6d357ce211a44470ed381d99e31d4bb487..2ab13c65469c0ca4e992c08bf03c18bcb7115336 100644 GIT binary patch delta 416 zcmV;R0bl-=1o{JzKnVv42oWxnq+Q>UNhp7GNkl6~{c z-8_0M4RkJe$QJ03(xFqqkTGM{K1gYykCD+0RFL7qRh&<-flm>c$ZL_v!co-o0adnWlrw)ZVimdBE8_s4w-!H@fA~5-Y&xizq0Re}UE;AToye#T7htbBD zlx0xK9pwJ{19$B5EMmp3iKb~DMxi2L@nBVzymAm8m|^m7a0JLO?lTU#CnpR50000< KMNUMnLSTaN*qff*)XuDLsZc2C`FDLpw7k_ou{#vWpUSZ4{>*MO$;Cc z|JC6LB18hgfPh0vn;F))0)QZkhRktj6L9KMi)D9^{p*jsvGcRY33f>|&8sJ25-K7k l9*xSfPmaO^JFdh=fSr>=Qu4`xq8mUV$r9Iy66gHf+|;}h2Ir#G#FEq$h4Rdj31eiw(0PwX3e6Nh5! delta 141 zcmV;80CNAv0qOyeKnVgB2@eO+y7vr`Nho<_Nkl>XIC v>TRO4GgAEwmpZU>MD-o$z4JRJBKo%n(dHTH{%6d<00000NkvXXu0mjf!jn4D diff --git a/mods/pipe/textures/pipe_top.png b/mods/pipe/textures/pipe_top.png index 7f0f37613c943594f01af5d78e34a6fe93d0dde9..448c3b632fb2a5bb5eea68ce5bfe629a9ffe4489 100644 GIT binary patch delta 162 zcmV;T0A2r}0{#JzKnVv42opNINb4YxNhp7KNkl^yv9}tm1N#f+Hjf zu=$i6-w*9Xi0or>eLr+_0X2L+S`dvoVAKJl4j6R+*+uc!pM-kHq?rc*Lj?`4s1FVl QwEzGB07*qoM6N<$f)b=bEdT%j delta 196 zcmV;#06YKw0iXhqKnVgB2_hs@_uP?@Nhp7sNkl32a3=apqe*K!^_3PI|GXz+u zVTh=x=x8Dwb-)O803~^Uc$5Q_2=2aGy^st%yENFMr4GD?f&(L^{j)4(uq y+vixtSr1Fn-T_~}d|_bN&Wly