forked from VoxeLibre/VoxeLibre
Copper buttons and some small changes
This commit is contained in:
parent
ba5c0a7f74
commit
25219c7102
|
@ -207,10 +207,12 @@ function mesecon.register_button(basename, description, texture, recipeitem, sou
|
||||||
_mcl_hardness = 0.5,
|
_mcl_hardness = 0.5,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
if recipeitem then
|
||||||
output = "mesecons_button:button_"..basename.."_off",
|
minetest.register_craft({
|
||||||
recipe = {{ recipeitem }},
|
output = "mesecons_button:button_"..basename.."_off",
|
||||||
})
|
recipe = {{ recipeitem }},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
if minetest.get_modpath("mesecons_mvps") then
|
if minetest.get_modpath("mesecons_mvps") then
|
||||||
mesecon.register_mvps_unsticky("mesecons_button:button_"..basename.."_off")
|
mesecon.register_mvps_unsticky("mesecons_button:button_"..basename.."_off")
|
||||||
|
|
|
@ -220,3 +220,8 @@ minetest.register_craft({
|
||||||
{"mcl_copper:copper_ingot", "mcl_copper:copper_ingot", "mcl_copper:copper_ingot"}
|
{"mcl_copper:copper_ingot", "mcl_copper:copper_ingot", "mcl_copper:copper_ingot"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "mesecons_button:button_copper_off",
|
||||||
|
recipe = {{"mcl_copper:copper_ingot"}}
|
||||||
|
})
|
||||||
|
|
|
@ -179,3 +179,10 @@ mcl_copper.doors_descs = {
|
||||||
{S("Oxidized Copper Door"), S("Oxidized Copper Trapdoor")},
|
{S("Oxidized Copper Door"), S("Oxidized Copper Trapdoor")},
|
||||||
{S("Waxed Oxidized Copper Door"), S("Waxed Oxidized Copper Trapdoor")}
|
{S("Waxed Oxidized Copper Door"), S("Waxed Oxidized Copper Trapdoor")}
|
||||||
}
|
}
|
||||||
|
-- Description for copper buttons, selected by its position on the table.
|
||||||
|
mcl_copper.button_descs = {
|
||||||
|
S("Copper Button"), S("Waxed Copper Button"),
|
||||||
|
S("Exposed Copper Button"), S("Waxed Exposed Copper Button"),
|
||||||
|
S("Weathered Copper Button"), S("Waxed Weathered Copper Button"),
|
||||||
|
S("Oxidized Copper Button"), S("Waxed Oxidized Copper Button")
|
||||||
|
}
|
||||||
|
|
|
@ -12,6 +12,11 @@ local function register_oxidation_and_scraping(mod_name, subname, decay_chain)
|
||||||
for i = 1, #decay_chain - 1 do
|
for i = 1, #decay_chain - 1 do
|
||||||
item = mod_name..":"..subname..decay_chain[i]
|
item = mod_name..":"..subname..decay_chain[i]
|
||||||
oxidized_item = mod_name..":"..subname..decay_chain[i + 1]
|
oxidized_item = mod_name..":"..subname..decay_chain[i + 1]
|
||||||
|
-- Copper buttons have a special treatment due to the format of your name.
|
||||||
|
if subname:find("button") then
|
||||||
|
item = item.."_off"
|
||||||
|
oxidized_item = oxidized_item.."_off"
|
||||||
|
end
|
||||||
|
|
||||||
minetest.override_item(item, {_mcl_oxidized_variant = oxidized_item})
|
minetest.override_item(item, {_mcl_oxidized_variant = oxidized_item})
|
||||||
minetest.override_item(oxidized_item, {_mcl_stripped_variant = item})
|
minetest.override_item(oxidized_item, {_mcl_stripped_variant = item})
|
||||||
|
@ -64,6 +69,11 @@ local function register_waxing_and_scraping(mod_name, subname, decay_chain)
|
||||||
for i = 1, #decay_chain do
|
for i = 1, #decay_chain do
|
||||||
waxed_item = mod_name..":"..subname..decay_chain[i]
|
waxed_item = mod_name..":"..subname..decay_chain[i]
|
||||||
unwaxed_item = mod_name..":"..subname:gsub("waxed_", "")..decay_chain[i]
|
unwaxed_item = mod_name..":"..subname:gsub("waxed_", "")..decay_chain[i]
|
||||||
|
-- Copper buttons have a special treatment due to the format of your name.
|
||||||
|
if subname:find("button") then
|
||||||
|
waxed_item = waxed_item.."_off"
|
||||||
|
unwaxed_item = unwaxed_item.."_off"
|
||||||
|
end
|
||||||
|
|
||||||
minetest.override_item(waxed_item, {_mcl_stripped_variant = unwaxed_item})
|
minetest.override_item(waxed_item, {_mcl_stripped_variant = unwaxed_item})
|
||||||
minetest.override_item(unwaxed_item, {_mcl_waxed_variant = waxed_item})
|
minetest.override_item(unwaxed_item, {_mcl_waxed_variant = waxed_item})
|
||||||
|
@ -116,9 +126,13 @@ register_oxidation_and_scraping("mcl_copper", "trapdoor", decay_chain)
|
||||||
|
|
||||||
register_oxidation_and_scraping("mcl_copper", "door", decay_chain)
|
register_oxidation_and_scraping("mcl_copper", "door", decay_chain)
|
||||||
|
|
||||||
|
register_oxidation_and_scraping("mesecons_button", "button_copper", decay_chain)
|
||||||
|
|
||||||
register_waxing_and_scraping("mcl_copper", "waxed_trapdoor", decay_chain)
|
register_waxing_and_scraping("mcl_copper", "waxed_trapdoor", decay_chain)
|
||||||
|
|
||||||
register_waxing_and_scraping("mcl_copper", "waxed_door", decay_chain)
|
register_waxing_and_scraping("mcl_copper", "waxed_door", decay_chain)
|
||||||
|
|
||||||
|
register_waxing_and_scraping("mesecons_button", "button_waxed_copper", decay_chain)
|
||||||
-- Redefining values and using decay chains for stairs and slabs.
|
-- Redefining values and using decay chains for stairs and slabs.
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
decay_chain[i] = decay_chain[i].."_cut"
|
decay_chain[i] = decay_chain[i].."_cut"
|
||||||
|
|
|
@ -230,6 +230,21 @@ local function register_copper_variants(name, definitions)
|
||||||
_mcl_hardness = 3
|
_mcl_hardness = 3
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
-- Registering buttons.
|
||||||
|
if definitions._mesecons_buttons then
|
||||||
|
mesecon.register_button(
|
||||||
|
names[i]:gsub("block", "copper"),
|
||||||
|
mcl_copper.button_descs[i],
|
||||||
|
set_tiles(tiles, i),
|
||||||
|
nil,
|
||||||
|
mcl_sounds.node_sound_metal_defaults(),
|
||||||
|
set_groups(names[i], {handy = 1, pickaxey = 1}),
|
||||||
|
math.ceil(i / 2) * 0.5,
|
||||||
|
true,
|
||||||
|
nil,
|
||||||
|
"mesecons_button_push"
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Using the function above to register the copper blocks.
|
-- Using the function above to register the copper blocks.
|
||||||
|
@ -238,6 +253,7 @@ register_copper_variants("block", {
|
||||||
-- Copper blocks are no longer the manufacturing material for doors but this definition will be
|
-- Copper blocks are no longer the manufacturing material for doors but this definition will be
|
||||||
-- maintained here to avoid individual registration of 16 blocks.
|
-- maintained here to avoid individual registration of 16 blocks.
|
||||||
_mcl_doors = true,
|
_mcl_doors = true,
|
||||||
|
_mesecons_buttons = true,
|
||||||
})
|
})
|
||||||
-- Using the function above to register the cut copper blocks.
|
-- Using the function above to register the cut copper blocks.
|
||||||
register_copper_variants("cut", {
|
register_copper_variants("cut", {
|
||||||
|
|
Loading…
Reference in New Issue