Skip to content

Commit

Permalink
Add a new type of cable clip
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
VanessaE authored and sofar committed Sep 8, 2018
1 parent 29f7463 commit 92dd0f4
Show file tree
Hide file tree
Showing 4 changed files with 353 additions and 2 deletions.
2 changes: 2 additions & 0 deletions extranodes/depends.txt
Expand Up @@ -4,3 +4,5 @@ concrete
unifieddyes?
intllib?
moreblocks?
steel?
streetsmod?
107 changes: 105 additions & 2 deletions extranodes/init.lua
Expand Up @@ -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"},
Expand All @@ -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",
Expand Down Expand Up @@ -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"
Expand All @@ -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",
Expand All @@ -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({
Expand All @@ -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

0 comments on commit 92dd0f4

Please sign in to comment.