Implement legacy linking functions

This commit is contained in:
Jude Melton-Houghton 2022-07-22 21:57:51 -04:00
parent 55cc5076dc
commit e4f2f84203
1 changed files with 12 additions and 0 deletions

View File

@ -12,3 +12,15 @@ for hash, _ in pairs(old_forceloaded_blocks) do
minetest.forceload_free_block(unhash_blockpos(hash))
end
os.remove(minetest.get_worldpath().."/mesecon_forceloaded")
-- Implement mesecon.rules_link_rule_all and mesecon.rules_link_rule_all_inverted
-- for mods that use them, even though they were internal functions.
function mesecon.rules_link_rule_all(output, rule)
return {mesecon.link(output, vector.add(output, rule))}
end
function mesecon.rules_link_rule_all_inverted(input, rule)
local r = mesecon.link_inverted(input, vector.add(input, rule))
return {r and mesecon.invertRule(r)}
end