Make loose repacking not lose meta
This affects things like witness hints, and may have been causing witness hints not to work for leaching if the leached nodes self-repack afterwards.
This commit is contained in:
parent
969ff065b0
commit
025e237be0
@ -92,9 +92,13 @@ function nodecore.node_sound(pos, kind, opts)
|
||||
return nodecore.sound_play_except(t.name, t, opts and opts.except)
|
||||
end
|
||||
|
||||
function nodecore.set_loud(pos, node, opts)
|
||||
minetest.set_node(pos, node)
|
||||
opts = opts or {}
|
||||
opts.node = node
|
||||
return nodecore.node_sound(pos, "place", opts)
|
||||
local function mkloud(fn)
|
||||
return function(pos, node, opts)
|
||||
fn(pos, node)
|
||||
opts = opts or {}
|
||||
opts.node = node
|
||||
return nodecore.node_sound(pos, "place", opts)
|
||||
end
|
||||
end
|
||||
nodecore.set_loud = mkloud(minetest.set_node)
|
||||
nodecore.swap_loud = mkloud(minetest.swap_node)
|
||||
|
@ -111,6 +111,6 @@ nodecore.register_soaking_abm({
|
||||
soakcheck = function(data, pos, node)
|
||||
if data.total < 100 then return end
|
||||
local def = minetest.registered_items[node.name] or {}
|
||||
return nodecore.set_loud(pos, {name = def.repack_to})
|
||||
return nodecore.swap_loud(pos, {name = def.repack_to})
|
||||
end
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user