Vanessa Dannenberg
2019-07-21 d1bf386b80aea6d70b6a015198a77fd40ced04fe
commit | author | age
0ca19d 1 -- Minetest 0.4.6 mod: extranodes
R 2 -- namespace: technic
39c41a 3 -- Boilerplate to support localized strings if intllib mod is installed.
41a10a 4 local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
0ca19d 5
cfd788 6 if minetest.get_modpath("moreblocks") then
1d81e6 7
cfd788 8     -- register stairsplus/circular_saw nodes
1 9     -- we skip blast resistant concrete and uranium intentionally
10     -- chrome seems to be too hard of a metal to be actually sawable
0ca19d 11
cfd788 12     stairsplus:register_all("technic", "marble", "technic:marble", {
1 13         description=S("Marble"),
14         groups={cracky=3, not_in_creative_inventory=1},
15         tiles={"technic_marble.png"},
16     })
0ca19d 17
cfd788 18     stairsplus:register_all("technic", "marble_bricks", "technic:marble_bricks", {
1 19         description=S("Marble Bricks"),
20         groups={cracky=3, not_in_creative_inventory=1},
21         tiles={"technic_marble_bricks.png"},
22     })
0ca19d 23
cfd788 24     stairsplus:register_all("technic", "granite", "technic:granite", {
1 25         description=S("Granite"),
26         groups={cracky=1, not_in_creative_inventory=1},
27         tiles={"technic_granite.png"},
28     })
994d40 29
cfd788 30     stairsplus:register_all("technic", "concrete", "technic:concrete", {
1 31         description=S("Concrete"),
32         groups={cracky=3, not_in_creative_inventory=1},
44cb8d 33         tiles={"basic_materials_concrete_block.png"},
cfd788 34     })
1d81e6 35
cfd788 36     stairsplus:register_all("technic", "zinc_block", "technic:zinc_block", {
1 37         description=S("Zinc Block"),
38         groups={cracky=1, not_in_creative_inventory=1},
39         tiles={"technic_zinc_block.png"},
40     })
1d81e6 41
cfd788 42     stairsplus:register_all("technic", "cast_iron_block", "technic:cast_iron_block", {
1 43         description=S("Cast Iron Block"),
44         groups={cracky=1, not_in_creative_inventory=1},
45         tiles={"technic_cast_iron_block.png"},
46     })
1d81e6 47
cfd788 48     stairsplus:register_all("technic", "carbon_steel_block", "technic:carbon_steel_block", {
1 49         description=S("Carbon Steel Block"),
50         groups={cracky=1, not_in_creative_inventory=1},
51         tiles={"technic_carbon_steel_block.png"},
52     })
1d81e6 53
cfd788 54     stairsplus:register_all("technic", "stainless_steel_block", "technic:stainless_steel_block", {
1 55         description=S("Stainless Steel Block"),
56         groups={cracky=1, not_in_creative_inventory=1},
57         tiles={"technic_stainless_steel_block.png"},
58     })
1d81e6 59
cfd788 60     function register_technic_stairs_alias(modname, origname, newmod, newname)
1 61         minetest.register_alias(modname .. ":slab_" .. origname, newmod..":slab_" .. newname)
62         minetest.register_alias(modname .. ":slab_" .. origname .. "_inverted", newmod..":slab_" .. newname .. "_inverted")
63         minetest.register_alias(modname .. ":slab_" .. origname .. "_wall", newmod..":slab_" .. newname .. "_wall")
64         minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter", newmod..":slab_" .. newname .. "_quarter")
65         minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter_inverted", newmod..":slab_" .. newname .. "_quarter_inverted")
66         minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter_wall", newmod..":slab_" .. newname .. "_quarter_wall")
67         minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter", newmod..":slab_" .. newname .. "_three_quarter")
68         minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter_inverted", newmod..":slab_" .. newname .. "_three_quarter_inverted")
69         minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter_wall", newmod..":slab_" .. newname .. "_three_quarter_wall")
70         minetest.register_alias(modname .. ":stair_" .. origname, newmod..":stair_" .. newname)
71         minetest.register_alias(modname .. ":stair_" .. origname .. "_inverted", newmod..":stair_" .. newname .. "_inverted")
72         minetest.register_alias(modname .. ":stair_" .. origname .. "_wall", newmod..":stair_" .. newname .. "_wall")
73         minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half", newmod..":stair_" .. newname .. "_wall_half")
74         minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half_inverted", newmod..":stair_" .. newname .. "_wall_half_inverted")
75         minetest.register_alias(modname .. ":stair_" .. origname .. "_half", newmod..":stair_" .. newname .. "_half")
76         minetest.register_alias(modname .. ":stair_" .. origname .. "_half_inverted", newmod..":stair_" .. newname .. "_half_inverted")
77         minetest.register_alias(modname .. ":stair_" .. origname .. "_right_half", newmod..":stair_" .. newname .. "_right_half")
78         minetest.register_alias(modname .. ":stair_" .. origname .. "_right_half_inverted", newmod..":stair_" .. newname .. "_right_half_inverted")
79         minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half", newmod..":stair_" .. newname .. "_wall_half")
80         minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half_inverted", newmod..":stair_" .. newname .. "_wall_half_inverted")
81         minetest.register_alias(modname .. ":stair_" .. origname .. "_inner", newmod..":stair_" .. newname .. "_inner")
82         minetest.register_alias(modname .. ":stair_" .. origname .. "_inner_inverted", newmod..":stair_" .. newname .. "_inner_inverted")
83         minetest.register_alias(modname .. ":stair_" .. origname .. "_outer", newmod..":stair_" .. newname .. "_outer")
84         minetest.register_alias(modname .. ":stair_" .. origname .. "_outer_inverted", newmod..":stair_" .. newname .. "_outer_inverted")
85         minetest.register_alias(modname .. ":panel_" .. origname .. "_bottom", newmod..":panel_" .. newname .. "_bottom")
86         minetest.register_alias(modname .. ":panel_" .. origname .. "_top", newmod..":panel_" .. newname .. "_top")
87         minetest.register_alias(modname .. ":panel_" .. origname .. "_vertical", newmod..":panel_" .. newname .. "_vertical")
88         minetest.register_alias(modname .. ":micro_" .. origname .. "_bottom", newmod..":micro_" .. newname .. "_bottom")
89         minetest.register_alias(modname .. ":micro_" .. origname .. "_top", newmod..":micro_" .. newname .. "_top")
4f78a6 90     end
cfd788 91
1 92     register_technic_stairs_alias("stairsplus", "concrete", "technic", "concrete")
93     register_technic_stairs_alias("stairsplus", "marble", "technic", "marble")
94     register_technic_stairs_alias("stairsplus", "granite", "technic", "granite")
95     register_technic_stairs_alias("stairsplus", "marble_bricks", "technic", "marble_bricks")
96
97 end
938255 98
018d66 99 local iclip_def = {
92dd0f 100     description = S("Insulator/cable clip"),
018d66 101     drawtype = "mesh",
VE 102     mesh = "technic_insulator_clip.obj",
103     tiles = {"technic_insulator_clip.png"},
104     is_ground_content = false,
105     groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1 },
106     sounds = default.node_sound_stone_defaults(),
107 }
8b222b 108
018d66 109 local iclipfence_def = {
92dd0f 110     description = S("Insulator/cable clip"),
018d66 111     tiles = {"technic_insulator_clip.png"},
VE 112     is_ground_content = false,
113     paramtype = "light",
114     drawtype = "nodebox",
115     node_box = {
116         type = "connected",
117         fixed = {
118             { -0.25,   0.75,   -0.25,   0.25,   1.25,   0.25   }, -- the clip on top
119             { -0.125, 0.6875, -0.125, 0.125, 0.75,   0.125 },
120             { -0.1875,  0.625,  -0.1875,  0.1875,  0.6875, 0.1875  },
121             { -0.125, 0.5625, -0.125, 0.125, 0.625,  0.125 },
122             { -0.1875,  0.5,    -0.1875,  0.1875,  0.5625, 0.1875  },
123             { -0.125, 0.4375, -0.125, 0.125, 0.5,    0.125 },
124             { -0.1875,  0.375,  -0.1875,  0.1875,  0.4375, 0.1875  },
125             { -0.125, -0.5,    -0.125,  0.125,  0.375,  0.125  }, -- the post, slightly short
8b222b 126         },
018d66 127         -- connect_top =
VE 128         -- connect_bottom =
129         connect_front = {{-1/16,3/16,-1/2,1/16,5/16,-1/8},
130             {-1/16,-5/16,-1/2,1/16,-3/16,-1/8}},
131         connect_left = {{-1/2,3/16,-1/16,-1/8,5/16,1/16},
132             {-1/2,-5/16,-1/16,-1/8,-3/16,1/16}},
133         connect_back = {{-1/16,3/16,1/8,1/16,5/16,1/2},
134             {-1/16,-5/16,1/8,1/16,-3/16,1/2}},
135         connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16},
136             {1/8,-5/16,-1/16,1/2,-3/16,1/16}},
137     },
138     connects_to = {"group:fence", "group:wood", "group:tree"},
139     groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1 },
140     sounds = default.node_sound_stone_defaults(),
141 }
8b222b 142
92dd0f 143 local sclip_tex = {
VD 144     "technic_insulator_clip.png",
145     { name = "strut.png^steel_strut_overlay.png", color = "white" },
146     { name = "strut.png", color = "white" }
147 }
148
149 local streetsmod = minetest.get_modpath("streets") or minetest.get_modpath ("steelsupport")
150 -- cheapie's fork breaks it into several individual mods, with differernt names for the same content.
151
152 if streetsmod then
153     sclip_tex = {
154         "technic_insulator_clip.png",
155         { name = "streets_support.png^technic_steel_strut_overlay.png", color = "white" },
156         { name = "streets_support.png", color = "white" }
157     }
158 end
159
160 local sclip_def = {
161     description = S("Steel strut with insulator/cable clip"),
162     drawtype = "mesh",
163     mesh = "technic_steel_strut_with_insulator_clip.obj",
164     tiles = sclip_tex,
165     paramtype = "light",
166     paramtype2 = "wallmounted",
167     is_ground_content = false,
168     sounds = default.node_sound_stone_defaults(),
169     groups = { choppy=1, cracky=1 },
170     backface_culling = false
171 }
172
2a7dbe 173 if minetest.get_modpath("unifieddyes") then
018d66 174     iclip_def.paramtype2 = "colorwallmounted"
VE 175     iclip_def.palette = "unifieddyes_palette_colorwallmounted.png"
600fc6 176     iclip_def.after_place_node = function(pos, placer, itemstack, pointed_thing)
VE 177         unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
178     end
018d66 179     iclip_def.groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
d1bf38 180     iclip_def.on_dig = unifieddyes.on_dig
3ba535 181
018d66 182     iclipfence_def.paramtype2 = "color"
VE 183     iclipfence_def.palette = "unifieddyes_palette_extended.png"
184     iclipfence_def.on_construct = unifieddyes.on_construct
185     iclipfence_def.groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
d1bf38 186     iclipfence_def.on_dig = unifieddyes.on_dig
92dd0f 187
VD 188     sclip_def.paramtype2 = "colorwallmounted"
189     sclip_def.palette = "unifieddyes_palette_colorwallmounted.png"
190     sclip_def.after_place_node = function(pos, placer, itemstack, pointed_thing)
191         unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
192     end
d1bf38 193     sclip_def.on_dig = unifieddyes.on_dig
92dd0f 194     sclip_def.groups = {choppy=1, cracky=1, ud_param2_colorable = 1}
0ad801 195 end
018d66 196
2a7dbe 197 minetest.register_node(":technic:insulator_clip", iclip_def)
VE 198 minetest.register_node(":technic:insulator_clip_fencepost", iclipfence_def)
199
018d66 200 minetest.register_craft({
VE 201     output = "technic:insulator_clip",
202     recipe = {
203         { "", "dye:white", ""},
204         { "", "technic:raw_latex", ""},
205         { "technic:raw_latex", "default:stone", "technic:raw_latex"},
206     }
207 })
208
209 minetest.register_craft({
210     output = "technic:insulator_clip_fencepost 2",
211     recipe = {
212         { "", "dye:white", ""},
213         { "", "technic:raw_latex", ""},
214         { "technic:raw_latex", "default:fence_wood", "technic:raw_latex"},
215     }
216 })
92dd0f 217
VD 218 local steelmod = minetest.get_modpath("steel")
219
f5bf0d 220 if streetsmod or steelmod then
G 221     minetest.register_node(":technic:steel_strut_with_insulator_clip", sclip_def)
92dd0f 222
f5bf0d 223     if steelmod then
G 224         minetest.register_craft({
225             output = "technic:steel_strut_with_insulator_clip",
226             recipe = {
227                 {"technic:insulator_clip_fencepost"},
228                 {"steel:strut_mount"}
229             }
230         })
92dd0f 231
f5bf0d 232         minetest.register_craft({
G 233             output = "technic:steel_strut_with_insulator_clip",
234             recipe = {
235                 {"technic:insulator_clip_fencepost", ""                    },
236                 {"steel:strut",                      "default:steel_ingot" },
237             }
238         })
92dd0f 239
f5bf0d 240     elseif streetsmod then
G 241         minetest.register_craft({
242             output = "technic:steel_strut_with_insulator_clip",
243             recipe = {
244                 {"technic:insulator_clip_fencepost", ""                   },
245                 {"streets:steel_support",           "default:steel_ingot" },
246             }
247         })
248     end
92dd0f 249 end
29f746 250
VD 251 if minetest.get_modpath("unifieddyes") then
252
253     unifieddyes.register_color_craft({
254         output = "technic:insulator_clip_fencepost",
255         palette = "extended",
256         type = "shapeless",
257         neutral_node = "technic:insulator_clip_fencepost",
258         recipe = {
259             "NEUTRAL_NODE",
260             "MAIN_DYE"
261         }
262     })
263
264     unifieddyes.register_color_craft({
265         output = "technic:insulator_clip",
266         palette = "wallmounted",
267         type = "shapeless",
268         neutral_node = "technic:insulator_clip",
269         recipe = {
270             "NEUTRAL_NODE",
271             "MAIN_DYE"
272         }
273     })
274
92dd0f 275     unifieddyes.register_color_craft({
VD 276         output = "technic:steel_strut_with_insulator_clip",
277         palette = "wallmounted",
278         type = "shapeless",
279         neutral_node = "",
280         recipe = {
281             "technic:steel_strut_with_insulator_clip",
282             "MAIN_DYE"
283         }
284     })
285
286     if steelmod then
287         unifieddyes.register_color_craft({
288             output = "technic:steel_strut_with_insulator_clip",
289             palette = "wallmounted",
290             neutral_node = "",
291             recipe = {
292                 { "technic:insulator_clip_fencepost", "MAIN_DYE" },
293                 { "steel:strut_mount",                ""         },
294             }
295         })
296     end
297
298     if streetsmod then
299         unifieddyes.register_color_craft({
300             output = "technic:steel_strut_with_insulator_clip",
301             palette = "wallmounted",
302             neutral_node = "technic:steel_strut_with_insulator_clip",
303             recipe = {
304                 { "technic:insulator_clip_fencepost", "MAIN_DYE"            },
305                 { "streets:steel_support",            "default:steel_ingot" },
306             }
307         })
308     end
29f746 309 end