Fix furnace meta not being wiped

This commit is contained in:
ANAND 2019-03-05 18:40:00 +05:30 committed by rubenwardy
parent c9bcfbb36e
commit cb08c8c6e0
3 changed files with 15 additions and 9 deletions

@ -1 +1 @@
Subproject commit 9e2581925aed31e5572507a0aba8120c18f41fa0
Subproject commit 512d86a21c9de0b628d49def24740a32fc85c3ac

View file

@ -1 +1,2 @@
default
ctf_match?

View file

@ -238,6 +238,8 @@ local function furnace_node_timer(pos, elapsed)
return result
end
local furnaces = {}
local function on_destruct(pos)
local inv = minetest.get_inventory({ type = "node", pos = pos })
for _, list in pairs(inv:get_lists()) do
@ -245,6 +247,7 @@ local function on_destruct(pos)
minetest.add_item(pos, item)
end
end
furnaces[minetest.pos_to_string(pos)] = nil
end
--
@ -273,6 +276,7 @@ minetest.register_node("furnace:furnace", {
inv:set_size('src', 1)
inv:set_size('fuel', 1)
inv:set_size('dst', 4)
furnaces[minetest.pos_to_string(pos)] = true
end,
on_metadata_inventory_move = function(pos)
@ -332,11 +336,12 @@ minetest.register_node("furnace:furnace_active", {
minetest.register_alias("default:furnace", "furnace:furnace")
minetest.register_craft({
output = 'furnace:furnace',
recipe = {
{'group:stone', 'group:stone', 'group:stone'},
{'group:stone', '', 'group:stone'},
{'group:stone', 'group:stone', 'group:stone'},
}
})
if minetest.global_exists("ctf_match") then
ctf_match.register_on_new_match(function()
for i, _ in pairs(furnaces) do
local pos = minetest.string_to_pos(i)
minetest.remove_node(pos)
furnaces[i] = nil
end
end)
end