forked from minetest-mods/technic
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.
This commit is contained in:
committed by
sofar
parent
29f746369f
commit
92dd0f4af8
@ -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
|
||||
|
Reference in New Issue
Block a user