Add craft predict for map copying

This commit is contained in:
Lizzy Fleckenstein 2021-05-02 19:30:27 +02:00 committed by Nils Dagsson Moskopp
parent ec23f89033
commit ea272c40a0
Signed by untrusted user who does not match committer: erle
GPG Key ID: A3BC671C35191080
1 changed files with 5 additions and 2 deletions

View File

@ -241,7 +241,7 @@ minetest.register_craft({
recipe = {"group:filled_map", "mcl_maps:empty_map"},
})
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
local function on_craft(itemstack, player, old_craft_grid, craft_inv)
if itemstack:get_name() == "mcl_maps:filled_map" then
for _, stack in pairs(old_craft_grid) do
if minetest.get_item_group(stack:get_name(), "filled_map") > 0 then
@ -250,7 +250,10 @@ minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv
end
end
end
end)
end
minetest.register_on_craft(on_craft)
minetest.register_craft_predict(on_craft)
local maps = {}
local huds = {}