21 lines
518 B
Lua
21 lines
518 B
Lua
---
|
|
--- Generated by EmmyLua(https://github.com/EmmyLua)
|
|
--- Created by michieal.
|
|
--- DateTime: 2/15/23 1:11 AM
|
|
---
|
|
|
|
function register_oxidation_abm(node_name)
|
|
minetest.register_abm({
|
|
label = node_name .. "_oxidization_abm",
|
|
nodenames = { node_name },
|
|
interval = 500,
|
|
chance = 3,
|
|
action = function(pos, node)
|
|
local def = minetest.registered_nodes[node_name]
|
|
if def and def._mcl_oxidized_variant then
|
|
minetest.swap_node(pos, { name = oxidized_variant, param2 = node.param2 })
|
|
end
|
|
end,
|
|
})
|
|
end
|