summaryrefslogtreecommitdiff
path: root/extranodes/init.lua
diff options
context:
space:
mode:
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-08-23 19:59:53 -0400
committersofar <sofar+github@foo-projects.org>2018-09-07 17:13:18 -0700
commit92dd0f4af891043f8554f730964f63db8b5e3dc8 (patch)
tree849d6363970825a8a2a3129a7e13e2ce2a80bfbd /extranodes/init.lua
parent29f746369f756651c60031a7c86194d79d47a4ce (diff)
Add a new type of cable clip
Uses Zeg9's steel mod's "steel:strut_mount" or streetsmod's "streets:steel_support" as the base/blocky part, with an overlay copied from the steel mod to make it look like the clip is fixed to the strut with a steel band. Textures will adjust to match whichever mod is installed, preferring the steel mod. Can be crafted from any of these standard/shaped recipes: - - - - f d - f - or - s - - m - - i - f = fencepost-shaped clip m = steel mod strut with mount s = steel mod strut without mount, or streets mod steel support i = default steel ingot d = dye (optional, see below) If the user has Unified Dyes (commit 2a816534 or later), the clip can be dyed (well, the white part anyway :-) ), either by adding a portion of dye as above, or by crafting an existing clip + dye. Uses "colorwallmounted" mode for 32-color support.
Diffstat (limited to 'extranodes/init.lua')
-rw-r--r--extranodes/init.lua107
1 files changed, 105 insertions, 2 deletions
diff --git a/extranodes/init.lua b/extranodes/init.lua
index f6ab93a..1f65c29 100644
--- a/extranodes/init.lua
+++ b/extranodes/init.lua
@@ -103,7 +103,7 @@ if minetest.get_modpath("moreblocks") then
end
local iclip_def = {
- description = "Insulator/cable clip",
+ description = S("Insulator/cable clip"),
drawtype = "mesh",
mesh = "technic_insulator_clip.obj",
tiles = {"technic_insulator_clip.png"},
@@ -113,7 +113,7 @@ local iclip_def = {
}
local iclipfence_def = {
- description = "Insulator/cable clip",
+ description = S("Insulator/cable clip"),
tiles = {"technic_insulator_clip.png"},
is_ground_content = false,
paramtype = "light",
@@ -146,6 +146,36 @@ local iclipfence_def = {
sounds = default.node_sound_stone_defaults(),
}
+local sclip_tex = {
+ "technic_insulator_clip.png",
+ { name = "strut.png^steel_strut_overlay.png", color = "white" },
+ { name = "strut.png", color = "white" }
+}
+
+local streetsmod = minetest.get_modpath("streets") or minetest.get_modpath ("steelsupport")
+-- cheapie's fork breaks it into several individual mods, with differernt names for the same content.
+
+if streetsmod then
+ sclip_tex = {
+ "technic_insulator_clip.png",
+ { name = "streets_support.png^technic_steel_strut_overlay.png", color = "white" },
+ { name = "streets_support.png", color = "white" }
+ }
+end
+
+local sclip_def = {
+ description = S("Steel strut with insulator/cable clip"),
+ drawtype = "mesh",
+ mesh = "technic_steel_strut_with_insulator_clip.obj",
+ tiles = sclip_tex,
+ paramtype = "light",
+ paramtype2 = "wallmounted",
+ is_ground_content = false,
+ sounds = default.node_sound_stone_defaults(),
+ groups = { choppy=1, cracky=1 },
+ backface_culling = false
+}
+
if minetest.get_modpath("unifieddyes") then
iclip_def.paramtype2 = "colorwallmounted"
iclip_def.palette = "unifieddyes_palette_colorwallmounted.png"
@@ -158,10 +188,18 @@ if minetest.get_modpath("unifieddyes") then
iclipfence_def.palette = "unifieddyes_palette_extended.png"
iclipfence_def.on_construct = unifieddyes.on_construct
iclipfence_def.groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
+
+ sclip_def.paramtype2 = "colorwallmounted"
+ sclip_def.palette = "unifieddyes_palette_colorwallmounted.png"
+ sclip_def.after_place_node = function(pos, placer, itemstack, pointed_thing)
+ unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
+ end
+ sclip_def.groups = {choppy=1, cracky=1, ud_param2_colorable = 1}
end
minetest.register_node(":technic:insulator_clip", iclip_def)
minetest.register_node(":technic:insulator_clip_fencepost", iclipfence_def)
+minetest.register_node(":technic:steel_strut_with_insulator_clip", sclip_def)
minetest.register_craft({
output = "technic:insulator_clip",
@@ -181,6 +219,37 @@ minetest.register_craft({
}
})
+local steelmod = minetest.get_modpath("steel")
+
+if steelmod then
+ minetest.register_craft({
+ output = "technic:steel_strut_with_insulator_clip",
+ recipe = {
+ {"technic:insulator_clip_fencepost"},
+ {"steel:strut_mount"}
+ }
+ })
+
+ minetest.register_craft({
+ output = "technic:steel_strut_with_insulator_clip",
+ recipe = {
+ {"technic:insulator_clip_fencepost", "" },
+ {"steel:strut", "default:steel_ingot" },
+ }
+ })
+
+end
+
+if streetsmod then
+ minetest.register_craft({
+ output = "technic:steel_strut_with_insulator_clip",
+ recipe = {
+ {"technic:insulator_clip_fencepost", "" },
+ {"streets:steel_support", "default:steel_ingot" },
+ }
+ })
+end
+
if minetest.get_modpath("unifieddyes") then
unifieddyes.register_color_craft({
@@ -205,4 +274,38 @@ if minetest.get_modpath("unifieddyes") then
}
})
+ unifieddyes.register_color_craft({
+ output = "technic:steel_strut_with_insulator_clip",
+ palette = "wallmounted",
+ type = "shapeless",
+ neutral_node = "",
+ recipe = {
+ "technic:steel_strut_with_insulator_clip",
+ "MAIN_DYE"
+ }
+ })
+
+ if steelmod then
+ unifieddyes.register_color_craft({
+ output = "technic:steel_strut_with_insulator_clip",
+ palette = "wallmounted",
+ neutral_node = "",
+ recipe = {
+ { "technic:insulator_clip_fencepost", "MAIN_DYE" },
+ { "steel:strut_mount", "" },
+ }
+ })
+ end
+
+ if streetsmod then
+ unifieddyes.register_color_craft({
+ output = "technic:steel_strut_with_insulator_clip",
+ palette = "wallmounted",
+ neutral_node = "technic:steel_strut_with_insulator_clip",
+ recipe = {
+ { "technic:insulator_clip_fencepost", "MAIN_DYE" },
+ { "streets:steel_support", "default:steel_ingot" },
+ }
+ })
+ end
end