override anvil entity if cottages anvil is enabled

This commit is contained in:
flux 2022-10-18 08:25:26 -07:00
parent 77346267d7
commit cc6ee4f56c
No known key found for this signature in database
GPG Key ID: 9333B27816848A15
1 changed files with 18 additions and 0 deletions

View File

@ -63,3 +63,21 @@ else
end,
})
end
if minetest.registered_entities["anvil:item"] then
-- luacheck: globals minetest
minetest.registered_entities["anvil:item"].on_activate = function(self)
if self.object then
self.object:remove()
end
end
else
minetest.register_entity(":anvil:item", {
on_activate = function(self)
if self.object then
self.object:remove()
end
end
})
end