forked from Mineclonia/Mineclonia
Add craft predict for map copying
This commit is contained in:
parent
ec23f89033
commit
ea272c40a0
|
@ -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 = {}
|
||||
|
|
Loading…
Reference in New Issue