1
0
Fork 0

Fix door param2 change when scrapping or waxing

This commit is contained in:
JoseDouglas26 2024-02-20 10:42:36 -03:00
parent ff23d46125
commit 787ef17925
2 changed files with 4 additions and 4 deletions

View File

@ -20,10 +20,10 @@ function mcl_honey.wax_block(pos, node, player, itemstack, pointed_thing)
if def.groups.door == 1 then if def.groups.door == 1 then
if node.name:find("_b_") then if node.name:find("_b_") then
local top_pos = { x = pos.x, y = pos.y + 1, z = pos.z } local top_pos = { x = pos.x, y = pos.y + 1, z = pos.z }
minetest.swap_node(top_pos, { name = def._mcl_waxed_variant:gsub("_b_", "_t_") }) minetest.swap_node(top_pos, { name = def._mcl_waxed_variant:gsub("_b_", "_t_"), param2 = node.param2 })
elseif node.name:find("_t_") then elseif node.name:find("_t_") then
local bot_pos = { x = pos.x, y = pos.y - 1, z = pos.z } local bot_pos = { x = pos.x, y = pos.y - 1, z = pos.z }
minetest.swap_node(bot_pos, { name = def._mcl_waxed_variant:gsub("_t_", "_b_") }) minetest.swap_node(bot_pos, { name = def._mcl_waxed_variant:gsub("_t_", "_b_"), param2 = node.param2 })
end end
end end
else else

View File

@ -414,10 +414,10 @@ local function make_stripped_trunk(itemstack, placer, pointed_thing)
local pt_under = pointed_thing.under local pt_under = pointed_thing.under
if node_name:find("_b_") then if node_name:find("_b_") then
local top_pos = {x = pt_under.x, y = pt_under.y + 1, z = pt_under.z} local top_pos = {x = pt_under.x, y = pt_under.y + 1, z = pt_under.z}
minetest.swap_node(top_pos, {name=noddef._mcl_stripped_variant:gsub("_b_", "_t_")}) minetest.swap_node(top_pos, {name=noddef._mcl_stripped_variant:gsub("_b_", "_t_"), param2=node.param2})
elseif node_name:find("_t_") then elseif node_name:find("_t_") then
local bot_pos = {x = pt_under.x, y = pt_under.y - 1, z = pt_under.z} local bot_pos = {x = pt_under.x, y = pt_under.y - 1, z = pt_under.z}
minetest.swap_node(bot_pos, {name=noddef._mcl_stripped_variant:gsub("_t_", "_b_")}) minetest.swap_node(bot_pos, {name=noddef._mcl_stripped_variant:gsub("_t_", "_b_"), param2=node.param2})
end end
end end
minetest.swap_node(pointed_thing.under, {name=noddef._mcl_stripped_variant, param2=node.param2}) minetest.swap_node(pointed_thing.under, {name=noddef._mcl_stripped_variant, param2=node.param2})