Fix a few crashes, make the abm work, and revive the wax off advancement

This commit is contained in:
PrairieWind 2023-05-20 09:59:28 -06:00 committed by ancientmarinerdev
parent 7c46826958
commit 0fba7eaed4
5 changed files with 26 additions and 23 deletions

View file

@ -4,9 +4,9 @@ minetest.register_abm({
interval = 500,
chance = 3,
action = function(pos, node)
local def = minetest.registered_nodes[node]
local def = minetest.registered_nodes[node.name]
if def and def._mcl_oxidized_variant then
minetest.swap_node(pos, { name = def._mcl_oxidized_varient, param2 = node.param2 })
minetest.set_node(pos, { name = def._mcl_oxidized_variant, param2 = node.param2 })
end
end,
})

View file

@ -34,7 +34,7 @@ for i = 1, #stair_oxidization do
def_variant_oxidized = "mcl_stairs:stair_copper_" .. stair_oxidization[i][2]
minetest.override_item(def, { _mcl_oxidized_variant = def_variant_oxidized })
def_variant_waxed = "mcl_stairs:stair_waxed_copper_" .. stair_oxidization[i][2]
def_variant_waxed = "mcl_stairs:stair_waxed_copper_" .. stair_oxidization[i][1]
minetest.override_item(def, { _mcl_waxed_variant = def_variant_waxed })
-- slabs

View file

@ -43,7 +43,7 @@ minetest.register_node("mcl_copper:waxed_block", {
_doc_items_longdesc = S("A block of copper is mostly a decorative block."),
tiles = {"mcl_copper_block.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 3,
@ -69,7 +69,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed", {
_doc_items_longdesc = S("Exposed copper is a decorative block."),
tiles = {"mcl_copper_exposed.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
@ -95,7 +95,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered", {
_doc_items_longdesc = S("Weathered copper is a decorative block."),
tiles = {"mcl_copper_weathered.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
@ -120,7 +120,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized", {
_doc_items_longdesc = S("Oxidized copper is a decorative block."),
tiles = {"mcl_copper_oxidized.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
@ -136,7 +136,7 @@ minetest.register_node("mcl_copper:block_cut", {
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
_mcl_oxidized_variant = "mcl_copper:block_cut_exposed",
_mcl_oxidized_variant = "mcl_copper:block_exposed_cut",
_mcl_waxed_variant = "mcl_copper:waxed_block_cut",
})
@ -145,7 +145,7 @@ minetest.register_node("mcl_copper:waxed_block_cut", {
_doc_items_longdesc = S("Cut copper is a decorative block."),
tiles = {"mcl_copper_block_cut.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
@ -162,7 +162,7 @@ minetest.register_node("mcl_copper:block_exposed_cut", {
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
_mcl_waxed_variant = "mcl_copper:waxed_block_exposed_cut",
_mcl_oxidized_variant = "mcl_copper:block_cut_weathered",
_mcl_oxidized_variant = "mcl_copper:block_weathered_cut",
_mcl_stripped_variant = "mcl_copper:block_cut",
})
@ -171,7 +171,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed_cut", {
_doc_items_longdesc = S("Exposed cut copper is a decorative block."),
tiles = {"mcl_copper_exposed_cut.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
@ -188,7 +188,7 @@ minetest.register_node("mcl_copper:block_weathered_cut", {
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
_mcl_stripped_variant = "mcl_copper:block_exposed_cut",
_mcl_oxidized_variant = "mcl_copper:block_cut_oxidized",
_mcl_oxidized_variant = "mcl_copper:block_oxidized_cut",
_mcl_waxed_variant = "mcl_copper:waxed_block_weathered_cut",
})
@ -197,7 +197,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered_cut", {
_doc_items_longdesc = S("Weathered cut copper is a decorative block."),
tiles = {"mcl_copper_weathered_cut.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
@ -222,7 +222,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized_cut", {
_doc_items_longdesc = S("Oxidized cut copper is a decorative block."),
tiles = {"mcl_copper_oxidized_cut.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
@ -237,7 +237,7 @@ mcl_stairs.register_slab("copper_cut", "mcl_copper:block_cut",
S("Double Slab of Cut Copper"))
mcl_stairs.register_slab("waxed_copper_cut", "mcl_copper:waxed_block_cut",
{pickaxey = 2},
{pickaxey = 2, waxed = 1},
{"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"},
S("Waxed Slab of Cut Copper"),
nil, nil, nil,
@ -251,7 +251,7 @@ mcl_stairs.register_slab("copper_exposed_cut", "mcl_copper:block_exposed_cut",
S("Double Slab of Exposed Cut Copper"))
mcl_stairs.register_slab("waxed_copper_exposed_cut", "mcl_copper:waxed_block_exposed_cut",
{pickaxey = 2},
{pickaxey = 2, waxed = 1},
{"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"},
S("Waxed Slab of Exposed Cut Copper"),
nil, nil, nil,
@ -265,7 +265,7 @@ mcl_stairs.register_slab("copper_weathered_cut", "mcl_copper:block_weathered_cut
S("Double Slab of Weathered Cut Copper"))
mcl_stairs.register_slab("waxed_copper_weathered_cut", "mcl_copper:waxed_block_weathered_cut",
{pickaxey = 2},
{pickaxey = 2, waxed = 1},
{"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"},
S("Waxed Slab of Weathered Cut Copper"),
nil, nil, nil,
@ -279,7 +279,7 @@ mcl_stairs.register_slab("copper_oxidized_cut", "mcl_copper:block_oxidized_cut",
S("Double Slab of Oxidized Cut Copper"))
mcl_stairs.register_slab("waxed_copper_oxidized_cut", "mcl_copper:waxed_block_oxidized_cut",
{pickaxey = 2},
{pickaxey = 2, waxed = 1},
{"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"},
S("Waxed Slab of Oxidized Cut Copper"),
nil, nil, nil,
@ -293,7 +293,7 @@ mcl_stairs.register_stair("copper_cut", "mcl_copper:block_cut",
"woodlike")
mcl_stairs.register_stair("waxed_copper_cut", "mcl_copper:waxed_block_cut",
{pickaxey = 2},
{pickaxey = 2, waxed = 1},
{"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"},
S("Waxed Stairs of Cut Copper"),
nil, 6, nil,
@ -307,7 +307,7 @@ mcl_stairs.register_stair("copper_exposed_cut", "mcl_copper:block_exposed_cut",
"woodlike")
mcl_stairs.register_stair("waxed_copper_exposed_cut", "mcl_copper:waxed_block_exposed_cut",
{pickaxey = 2},
{pickaxey = 2, waxed = 1},
{"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"},
S("Waxed Stairs of Exposed Cut Copper"),
nil, 6, nil,
@ -321,7 +321,7 @@ mcl_stairs.register_stair("copper_weathered_cut", "mcl_copper:block_weathered_cu
"woodlike")
mcl_stairs.register_stair("waxed_copper_weathered_cut", "mcl_copper:waxed_block_weathered_cut",
{pickaxey = 2},
{pickaxey = 2, waxed = 1},
{"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"},
S("Waxed Stairs of Weathered Cut Copper"),
nil, 6, nil,
@ -335,7 +335,7 @@ mcl_stairs.register_stair("copper_oxidized_cut", "mcl_copper:block_oxidized_cut"
"woodlike")
mcl_stairs.register_stair("waxed_copper_oxidized_cut", "mcl_copper:waxed_block_oxidized_cut",
{pickaxey = 2},
{pickaxey = 2, waxed = 1},
{"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"},
S("Waxed Stairs of Oxidized Cut Copper"),
nil, 6, nil,

View file

@ -22,7 +22,7 @@ function mcl_honey.wax_block(pos, node, player, itemstack)
return
end
node.name = def._mcl_copper_waxed_variant
node.name = def._mcl_waxed_variant
minetest.set_node(pos, node)
awards.unlock(player:get_player_name(), "mcl:wax_on")
if not minetest.is_creative_enabled(player:get_player_name()) then

View file

@ -387,6 +387,9 @@ local function make_stripped_trunk(itemstack, placer, pointed_thing)
return itemstack
else
minetest.swap_node(pointed_thing.under, {name=noddef._mcl_stripped_variant, param2=node.param2})
if minetest.get_item_group(node_name, "waxed") ~= 0 then
awards.unlock(placer:get_player_name(), "mcl:wax_off")
end
if not minetest.is_creative_enabled(placer:get_player_name()) then
-- Add wear (as if digging a axey node)
local toolname = itemstack:get_name()