Copper bars and some fixes

This commit is contained in:
JoseDouglas26 2024-05-21 03:33:20 -03:00
parent be2e673d79
commit 0869217515
13 changed files with 58 additions and 10 deletions

View File

@ -216,8 +216,8 @@ minetest.register_craft({
minetest.register_craft({ minetest.register_craft({
output = "mcl_copper:trapdoor 2", output = "mcl_copper:trapdoor 2",
recipe = { recipe = {
{"mcl_copper:copper_ingot", "mcl_copper:copper_ingot", "mcl_copper:copper_ingot"}, {"mcl_copper:copper_ingot", "mcl_copper:copper_ingot"},
{"mcl_copper:copper_ingot", "mcl_copper:copper_ingot", "mcl_copper:copper_ingot"} {"mcl_copper:copper_ingot", "mcl_copper:copper_ingot"}
} }
}) })
@ -230,3 +230,11 @@ minetest.register_craft({
output = "mcl_copper:pressure_plate_copper_off", output = "mcl_copper:pressure_plate_copper_off",
recipe = {{"mcl_copper:copper_ingot", "mcl_copper:copper_ingot"}} recipe = {{"mcl_copper:copper_ingot", "mcl_copper:copper_ingot"}}
}) })
minetest.register_craft({
output = "xpanes:copper_flat 16",
recipe = {
{"mcl_copper:copper_ingot", "mcl_copper:copper_ingot", "mcl_copper:copper_ingot"},
{"mcl_copper:copper_ingot", "mcl_copper:copper_ingot", "mcl_copper:copper_ingot"}
}
})

View File

@ -193,3 +193,10 @@ mcl_copper.pp_descs = {
S("Weathered Copper Pressure Plate"), S("Waxed Weathered 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") S("Oxidized Copper Pressure Plate"), S("Waxed Oxidized Copper Pressure Plate")
} }
mcl_copper.bars_descs = {
S("Copper Bars"), S("Waxed Copper Bars"),
S("Exposed Copper Bars"), S("Waxed Exposed Copper Bars"),
S("Weathered Copper Bars"), S("Waxed Weathered Copper Bars"),
S("Oxidized Copper Bars"), S("Waxed Oxidized Copper Bars")
}

View File

@ -96,6 +96,9 @@ local function register_oxidation_and_scraping(mod_name, subname, decay_chain)
_mcl_on_strip = strip_door_top, _mcl_on_strip = strip_door_top,
}) })
end end
elseif mod_name:find("xpanes") then
minetest.override_item(item.."_flat", {_mcl_oxidized_variant = oxidized_item.."_flat"})
minetest.override_item(oxidized_item.."_flat", {_mcl_stripped_variant = item.."_flat"})
end end
end end
end end
@ -112,7 +115,7 @@ local function register_waxing_and_scraping(mod_name, subname, decay_chain)
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. -- 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
waxed_item = waxed_item.."_off" waxed_item = waxed_item.."_off"
unwaxed_item = unwaxed_item.."_off" unwaxed_item = unwaxed_item.."_off"
end end
@ -153,6 +156,9 @@ local function register_waxing_and_scraping(mod_name, subname, decay_chain)
_mcl_on_wax = wax_door_top, _mcl_on_wax = wax_door_top,
}) })
end end
elseif mod_name:find("xpanes") then
minetest.override_item(waxed_item.."_flat", {_mcl_stripped_variant = unwaxed_item.."_flat"})
minetest.override_item(unwaxed_item.."_flat", {_mcl_waxed_variant = waxed_item.."_flat"})
end end
end end
end end
@ -163,7 +169,7 @@ local decay_chain = {
"_weathered", "_weathered",
"_oxidized" "_oxidized"
} }
-- Defining variants for doors and trapdoors. -- Defining variants for doors, trapdoors, button, pressure plates and bars.
register_oxidation_and_scraping("mcl_copper", "trapdoor", decay_chain) 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)
@ -172,11 +178,17 @@ register_oxidation_and_scraping("mesecons_button", "button_copper", decay_chain)
register_oxidation_and_scraping("mcl_copper", "pressure_plate_copper", decay_chain) register_oxidation_and_scraping("mcl_copper", "pressure_plate_copper", decay_chain)
register_oxidation_and_scraping("xpanes", "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) register_waxing_and_scraping("mesecons_button", "button_waxed_copper", decay_chain)
register_waxing_and_scraping("mcl_copper", "pressure_plate_copper", decay_chain)
register_waxing_and_scraping("xpanes", "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"

View File

@ -245,7 +245,7 @@ local function register_copper_variants(name, definitions)
"mesecons_button_push" "mesecons_button_push"
) )
end end
-- Registering pressure plates.
if definitions._mesecons_pp then if definitions._mesecons_pp then
mesecon.register_pressure_plate( mesecon.register_pressure_plate(
"mcl_copper:pressure_plate_"..names[i]:gsub("block", "copper"), "mcl_copper:pressure_plate_"..names[i]:gsub("block", "copper"),
@ -260,6 +260,23 @@ local function register_copper_variants(name, definitions)
{player = true, mob = true} {player = true, mob = true}
) )
end end
-- Registering copper bars.
if definitions._xpanes then
local top_img = set_tiles(tiles, i):gsub("mcl_", "xpanes_top_")
local side_img = set_tiles(tiles, i):gsub("mcl_", "xpanes_pane_")
xpanes.register_pane(names[i]:gsub("block", "copper"), {
description = mcl_copper.bars_descs[i],
textures = {side_img, side_img, top_img},
inventory_image = side_img,
wield_image = side_img,
groups = set_groups(names[i], {pickaxey = 1}),
sounds = mcl_sounds.node_sound_metal_defaults(),
recipe = nil,
_mcl_blast_resistance = 6,
_mcl_hardness = 3
})
end
end end
end end
-- Using the function above to register the copper blocks. -- Using the function above to register the copper blocks.
@ -267,9 +284,11 @@ register_copper_variants("block", {
groups = {pickaxey = 2, building_block = 1}, groups = {pickaxey = 2, building_block = 1},
-- 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.
-- Same for buttons, pressure plates and panes.
_mcl_doors = true, _mcl_doors = true,
_mesecons_buttons = true, _mesecons_buttons = true,
_mesecons_pp = true _mesecons_pp = true,
_xpanes = 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", {

View File

@ -159,10 +159,12 @@ function xpanes.register_pane(name, def)
_mcl_silk_touch_drop = def._mcl_silk_touch_drop and {"xpanes:" .. name .. "_flat"}, _mcl_silk_touch_drop = def._mcl_silk_touch_drop and {"xpanes:" .. name .. "_flat"},
}) })
minetest.register_craft({ if def.recipe then
output = "xpanes:" .. name .. "_flat 16", minetest.register_craft({
recipe = def.recipe output = "xpanes:" .. name .. "_flat 16",
}) recipe = def.recipe
})
end
if mod_doc and def._doc_items_create_entry ~= false then if mod_doc and def._doc_items_create_entry ~= false then
doc.add_entry_alias("nodes", "xpanes:" .. name .. "_flat", "nodes", "xpanes:" .. name) doc.add_entry_alias("nodes", "xpanes:" .. name .. "_flat", "nodes", "xpanes:" .. name)

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B