diff --git a/mods/ITEMS/mcl_copper/crafting.lua b/mods/ITEMS/mcl_copper/crafting.lua index 802b0e7ee..1d61134c8 100644 --- a/mods/ITEMS/mcl_copper/crafting.lua +++ b/mods/ITEMS/mcl_copper/crafting.lua @@ -216,8 +216,8 @@ minetest.register_craft({ minetest.register_craft({ output = "mcl_copper:trapdoor 2", 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", 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"} + } +}) diff --git a/mods/ITEMS/mcl_copper/descriptions.lua b/mods/ITEMS/mcl_copper/descriptions.lua index 8be225950..08f588c42 100644 --- a/mods/ITEMS/mcl_copper/descriptions.lua +++ b/mods/ITEMS/mcl_copper/descriptions.lua @@ -193,3 +193,10 @@ mcl_copper.pp_descs = { S("Weathered Copper Pressure Plate"), S("Waxed Weathered 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") +} diff --git a/mods/ITEMS/mcl_copper/functions.lua b/mods/ITEMS/mcl_copper/functions.lua index 3cf7fedd4..fbc133b72 100644 --- a/mods/ITEMS/mcl_copper/functions.lua +++ b/mods/ITEMS/mcl_copper/functions.lua @@ -96,6 +96,9 @@ local function register_oxidation_and_scraping(mod_name, subname, decay_chain) _mcl_on_strip = strip_door_top, }) 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 @@ -112,7 +115,7 @@ local function register_waxing_and_scraping(mod_name, subname, decay_chain) waxed_item = mod_name..":"..subname..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 + if subname:find("button") or subname:find("pressure_plate") then waxed_item = waxed_item.."_off" unwaxed_item = unwaxed_item.."_off" end @@ -153,6 +156,9 @@ local function register_waxing_and_scraping(mod_name, subname, decay_chain) _mcl_on_wax = wax_door_top, }) 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 @@ -163,7 +169,7 @@ local decay_chain = { "_weathered", "_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", "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("xpanes", "copper", 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("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. for i = 1, 4 do decay_chain[i] = decay_chain[i].."_cut" diff --git a/mods/ITEMS/mcl_copper/nodes.lua b/mods/ITEMS/mcl_copper/nodes.lua index 0e20a6b57..989caa5c4 100644 --- a/mods/ITEMS/mcl_copper/nodes.lua +++ b/mods/ITEMS/mcl_copper/nodes.lua @@ -245,7 +245,7 @@ local function register_copper_variants(name, definitions) "mesecons_button_push" ) end - + -- Registering pressure plates. if definitions._mesecons_pp then mesecon.register_pressure_plate( "mcl_copper:pressure_plate_"..names[i]:gsub("block", "copper"), @@ -260,6 +260,23 @@ local function register_copper_variants(name, definitions) {player = true, mob = true} ) 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 -- Using the function above to register the copper blocks. @@ -267,9 +284,11 @@ register_copper_variants("block", { groups = {pickaxey = 2, building_block = 1}, -- Copper blocks are no longer the manufacturing material for doors but this definition will be -- maintained here to avoid individual registration of 16 blocks. + -- Same for buttons, pressure plates and panes. _mcl_doors = true, _mesecons_buttons = true, - _mesecons_pp = true + _mesecons_pp = true, + _xpanes = true }) -- Using the function above to register the cut copper blocks. register_copper_variants("cut", { diff --git a/mods/ITEMS/xpanes/init.lua b/mods/ITEMS/xpanes/init.lua index 85405308b..26f550874 100644 --- a/mods/ITEMS/xpanes/init.lua +++ b/mods/ITEMS/xpanes/init.lua @@ -159,10 +159,12 @@ function xpanes.register_pane(name, def) _mcl_silk_touch_drop = def._mcl_silk_touch_drop and {"xpanes:" .. name .. "_flat"}, }) - minetest.register_craft({ - output = "xpanes:" .. name .. "_flat 16", - recipe = def.recipe - }) + if def.recipe then + minetest.register_craft({ + output = "xpanes:" .. name .. "_flat 16", + recipe = def.recipe + }) + end if mod_doc and def._doc_items_create_entry ~= false then doc.add_entry_alias("nodes", "xpanes:" .. name .. "_flat", "nodes", "xpanes:" .. name) diff --git a/textures/xpanes_pane_copper_block.png b/textures/xpanes_pane_copper_block.png new file mode 100644 index 000000000..f3f7ffa59 Binary files /dev/null and b/textures/xpanes_pane_copper_block.png differ diff --git a/textures/xpanes_pane_copper_exposed.png b/textures/xpanes_pane_copper_exposed.png new file mode 100644 index 000000000..e1ad8dcef Binary files /dev/null and b/textures/xpanes_pane_copper_exposed.png differ diff --git a/textures/xpanes_pane_copper_oxidized.png b/textures/xpanes_pane_copper_oxidized.png new file mode 100644 index 000000000..c6410500a Binary files /dev/null and b/textures/xpanes_pane_copper_oxidized.png differ diff --git a/textures/xpanes_pane_copper_weathered.png b/textures/xpanes_pane_copper_weathered.png new file mode 100644 index 000000000..aa8eecc57 Binary files /dev/null and b/textures/xpanes_pane_copper_weathered.png differ diff --git a/textures/xpanes_top_copper_block.png b/textures/xpanes_top_copper_block.png new file mode 100644 index 000000000..bb6c18e44 Binary files /dev/null and b/textures/xpanes_top_copper_block.png differ diff --git a/textures/xpanes_top_copper_exposed.png b/textures/xpanes_top_copper_exposed.png new file mode 100644 index 000000000..4752ed204 Binary files /dev/null and b/textures/xpanes_top_copper_exposed.png differ diff --git a/textures/xpanes_top_copper_oxidized.png b/textures/xpanes_top_copper_oxidized.png new file mode 100644 index 000000000..414dc05ee Binary files /dev/null and b/textures/xpanes_top_copper_oxidized.png differ diff --git a/textures/xpanes_top_copper_weathered.png b/textures/xpanes_top_copper_weathered.png new file mode 100644 index 000000000..c81cfa4eb Binary files /dev/null and b/textures/xpanes_top_copper_weathered.png differ