SmallJoker
2018-07-19 fb93388f06fe87ee75aaaf04cf6edcf01a26d981
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},
33         tiles={"technic_concrete_block.png"},
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     stairsplus:register_all("technic", "brass_block", "technic:brass_block", {
1 61         description=S("Brass Block"),
62         groups={cracky=1, not_in_creative_inventory=1},
63         tiles={"technic_brass_block.png"},
64     })
994d40 65
cfd788 66     function register_technic_stairs_alias(modname, origname, newmod, newname)
1 67         minetest.register_alias(modname .. ":slab_" .. origname, newmod..":slab_" .. newname)
68         minetest.register_alias(modname .. ":slab_" .. origname .. "_inverted", newmod..":slab_" .. newname .. "_inverted")
69         minetest.register_alias(modname .. ":slab_" .. origname .. "_wall", newmod..":slab_" .. newname .. "_wall")
70         minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter", newmod..":slab_" .. newname .. "_quarter")
71         minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter_inverted", newmod..":slab_" .. newname .. "_quarter_inverted")
72         minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter_wall", newmod..":slab_" .. newname .. "_quarter_wall")
73         minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter", newmod..":slab_" .. newname .. "_three_quarter")
74         minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter_inverted", newmod..":slab_" .. newname .. "_three_quarter_inverted")
75         minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter_wall", newmod..":slab_" .. newname .. "_three_quarter_wall")
76         minetest.register_alias(modname .. ":stair_" .. origname, newmod..":stair_" .. newname)
77         minetest.register_alias(modname .. ":stair_" .. origname .. "_inverted", newmod..":stair_" .. newname .. "_inverted")
78         minetest.register_alias(modname .. ":stair_" .. origname .. "_wall", newmod..":stair_" .. newname .. "_wall")
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 .. "_half", newmod..":stair_" .. newname .. "_half")
82         minetest.register_alias(modname .. ":stair_" .. origname .. "_half_inverted", newmod..":stair_" .. newname .. "_half_inverted")
83         minetest.register_alias(modname .. ":stair_" .. origname .. "_right_half", newmod..":stair_" .. newname .. "_right_half")
84         minetest.register_alias(modname .. ":stair_" .. origname .. "_right_half_inverted", newmod..":stair_" .. newname .. "_right_half_inverted")
85         minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half", newmod..":stair_" .. newname .. "_wall_half")
86         minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half_inverted", newmod..":stair_" .. newname .. "_wall_half_inverted")
87         minetest.register_alias(modname .. ":stair_" .. origname .. "_inner", newmod..":stair_" .. newname .. "_inner")
88         minetest.register_alias(modname .. ":stair_" .. origname .. "_inner_inverted", newmod..":stair_" .. newname .. "_inner_inverted")
89         minetest.register_alias(modname .. ":stair_" .. origname .. "_outer", newmod..":stair_" .. newname .. "_outer")
90         minetest.register_alias(modname .. ":stair_" .. origname .. "_outer_inverted", newmod..":stair_" .. newname .. "_outer_inverted")
91         minetest.register_alias(modname .. ":panel_" .. origname .. "_bottom", newmod..":panel_" .. newname .. "_bottom")
92         minetest.register_alias(modname .. ":panel_" .. origname .. "_top", newmod..":panel_" .. newname .. "_top")
93         minetest.register_alias(modname .. ":panel_" .. origname .. "_vertical", newmod..":panel_" .. newname .. "_vertical")
94         minetest.register_alias(modname .. ":micro_" .. origname .. "_bottom", newmod..":micro_" .. newname .. "_bottom")
95         minetest.register_alias(modname .. ":micro_" .. origname .. "_top", newmod..":micro_" .. newname .. "_top")
96     end 
97
98     register_technic_stairs_alias("stairsplus", "concrete", "technic", "concrete")
99     register_technic_stairs_alias("stairsplus", "marble", "technic", "marble")
100     register_technic_stairs_alias("stairsplus", "granite", "technic", "granite")
101     register_technic_stairs_alias("stairsplus", "marble_bricks", "technic", "marble_bricks")
102
103 end
938255 104
018d66 105 local iclip_def = {
VE 106     description = "Insulator/cable clip",
107     drawtype = "mesh",
108     mesh = "technic_insulator_clip.obj",
109     tiles = {"technic_insulator_clip.png"},
110     is_ground_content = false,
111     groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1 },
112     sounds = default.node_sound_stone_defaults(),
113 }
8b222b 114
018d66 115 local iclipfence_def = {
VE 116     description = "Insulator/cable clip",
117     tiles = {"technic_insulator_clip.png"},
118     is_ground_content = false,
119     paramtype = "light",
120     drawtype = "nodebox",
121     node_box = {
122         type = "connected",
123         fixed = {
124             { -0.25,   0.75,   -0.25,   0.25,   1.25,   0.25   }, -- the clip on top
125             { -0.125, 0.6875, -0.125, 0.125, 0.75,   0.125 },
126             { -0.1875,  0.625,  -0.1875,  0.1875,  0.6875, 0.1875  },
127             { -0.125, 0.5625, -0.125, 0.125, 0.625,  0.125 },
128             { -0.1875,  0.5,    -0.1875,  0.1875,  0.5625, 0.1875  },
129             { -0.125, 0.4375, -0.125, 0.125, 0.5,    0.125 },
130             { -0.1875,  0.375,  -0.1875,  0.1875,  0.4375, 0.1875  },
131             { -0.125, -0.5,    -0.125,  0.125,  0.375,  0.125  }, -- the post, slightly short
8b222b 132         },
018d66 133         -- connect_top =
VE 134         -- connect_bottom =
135         connect_front = {{-1/16,3/16,-1/2,1/16,5/16,-1/8},
136             {-1/16,-5/16,-1/2,1/16,-3/16,-1/8}},
137         connect_left = {{-1/2,3/16,-1/16,-1/8,5/16,1/16},
138             {-1/2,-5/16,-1/16,-1/8,-3/16,1/16}},
139         connect_back = {{-1/16,3/16,1/8,1/16,5/16,1/2},
140             {-1/16,-5/16,1/8,1/16,-3/16,1/2}},
141         connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16},
142             {1/8,-5/16,-1/16,1/2,-3/16,1/16}},
143     },
144     connects_to = {"group:fence", "group:wood", "group:tree"},
145     groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1 },
146     sounds = default.node_sound_stone_defaults(),
147 }
8b222b 148
2a7dbe 149 if minetest.get_modpath("unifieddyes") then
018d66 150     iclip_def.paramtype2 = "colorwallmounted"
VE 151     iclip_def.palette = "unifieddyes_palette_colorwallmounted.png"
600fc6 152     iclip_def.after_place_node = function(pos, placer, itemstack, pointed_thing)
VE 153         unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
154         unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
155     end
018d66 156     iclip_def.after_dig_node = unifieddyes.after_dig_node
VE 157     iclip_def.groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
3ba535 158
018d66 159     iclipfence_def.paramtype2 = "color"
VE 160     iclipfence_def.palette = "unifieddyes_palette_extended.png"
161     iclipfence_def.on_construct = unifieddyes.on_construct
600fc6 162     iclipfence_def.after_place_node = unifieddyes.recolor_on_place
018d66 163     iclipfence_def.after_dig_node = unifieddyes.after_dig_node
VE 164     iclipfence_def.groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
165     iclipfence_def.place_param2 = 171 -- medium amber, low saturation, closest color to default:wood
0ad801 166 end
018d66 167
2a7dbe 168 minetest.register_node(":technic:insulator_clip", iclip_def)
VE 169 minetest.register_node(":technic:insulator_clip_fencepost", iclipfence_def)
170
018d66 171 minetest.register_craft({
VE 172     output = "technic:insulator_clip",
173     recipe = {
174         { "", "dye:white", ""},
175         { "", "technic:raw_latex", ""},
176         { "technic:raw_latex", "default:stone", "technic:raw_latex"},
177     }
178 })
179
180 minetest.register_craft({
181     output = "technic:insulator_clip_fencepost 2",
182     recipe = {
183         { "", "dye:white", ""},
184         { "", "technic:raw_latex", ""},
185         { "technic:raw_latex", "default:fence_wood", "technic:raw_latex"},
186     }
187 })