forked from VoxeLibre/VoxeLibre
Copper pressure plates
This commit is contained in:
parent
614ccce1f6
commit
af3bee7017
|
@ -208,11 +208,13 @@ function mesecon.register_pressure_plate(basename, description, textures_off, te
|
|||
_doc_items_create_entry = false,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = basename .. "_off",
|
||||
recipe = recipe,
|
||||
})
|
||||
|
||||
if recipe then
|
||||
minetest.register_craft({
|
||||
output = basename .. "_off",
|
||||
recipe = recipe,
|
||||
})
|
||||
end
|
||||
|
||||
if minetest.get_modpath("doc") then
|
||||
doc.add_entry_alias("nodes", basename .. "_off", "nodes", basename .. "_on")
|
||||
end
|
||||
|
|
|
@ -225,3 +225,8 @@ minetest.register_craft({
|
|||
output = "mesecons_button:button_copper_off",
|
||||
recipe = {{"mcl_copper:copper_ingot"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_copper:pressure_plate_copper_off",
|
||||
recipe = {{"mcl_copper:copper_ingot", "mcl_copper:copper_ingot"}}
|
||||
})
|
||||
|
|
|
@ -186,3 +186,10 @@ mcl_copper.button_descs = {
|
|||
S("Weathered Copper Button"), S("Waxed Weathered Copper Button"),
|
||||
S("Oxidized Copper Button"), S("Waxed Oxidized Copper Button")
|
||||
}
|
||||
|
||||
mcl_copper.pp_descs = {
|
||||
S("Copper Pressure Plate"), S("Waxed Copper Pressure Plate"),
|
||||
S("Exposed Copper Pressure Plate"), S("Waxed Exposed Copper Pressure Plate"),
|
||||
S("Weathered Copper Pressure Plate"), S("Waxed Weathered Copper Pressure Plate"),
|
||||
S("Oxidized Copper Pressure Plate"), S("Waxed Oxidized Copper Pressure Plate")
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ local function register_oxidation_and_scraping(mod_name, subname, decay_chain)
|
|||
item = mod_name..":"..subname..decay_chain[i]
|
||||
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
|
||||
if subname:find("button") or subname:find("pressure_plate") then
|
||||
item = item.."_off"
|
||||
oxidized_item = oxidized_item.."_off"
|
||||
end
|
||||
|
@ -170,6 +170,8 @@ register_oxidation_and_scraping("mcl_copper", "door", decay_chain)
|
|||
|
||||
register_oxidation_and_scraping("mesecons_button", "button_copper", decay_chain)
|
||||
|
||||
register_oxidation_and_scraping("mcl_copper", "pressure_plate_copper", decay_chain)
|
||||
|
||||
register_waxing_and_scraping("mcl_copper", "waxed_trapdoor", decay_chain)
|
||||
|
||||
register_waxing_and_scraping("mcl_copper", "waxed_door", decay_chain)
|
||||
|
|
|
@ -245,6 +245,21 @@ local function register_copper_variants(name, definitions)
|
|||
"mesecons_button_push"
|
||||
)
|
||||
end
|
||||
|
||||
if definitions._mesecons_pp then
|
||||
mesecon.register_pressure_plate(
|
||||
"mcl_copper:pressure_plate_"..names[i]:gsub("block", "copper"),
|
||||
mcl_copper.pp_descs[i],
|
||||
{set_tiles(tiles, i)},
|
||||
{set_tiles(tiles, i)},
|
||||
set_tiles(tiles, i),
|
||||
nil,
|
||||
nil,
|
||||
mcl_sounds.node_sound_metal_defaults(),
|
||||
set_groups(names[i], {pickaxey = 1}),
|
||||
{player = true, mob = true}
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Using the function above to register the copper blocks.
|
||||
|
@ -254,6 +269,7 @@ register_copper_variants("block", {
|
|||
-- maintained here to avoid individual registration of 16 blocks.
|
||||
_mcl_doors = true,
|
||||
_mesecons_buttons = true,
|
||||
_mesecons_pp = true
|
||||
})
|
||||
-- Using the function above to register the cut copper blocks.
|
||||
register_copper_variants("cut", {
|
||||
|
|
Loading…
Reference in New Issue