Implement copying maps

This commit is contained in:
Elias Fleckenstein 2021-05-02 12:23:29 +02:00 committed by Nils Dagsson Moskopp
parent 8bee9270ef
commit d0b78d38f5
No known key found for this signature in database
GPG Key ID: A3BC671C35191080
1 changed files with 17 additions and 0 deletions

View File

@ -184,6 +184,23 @@ minetest.register_craft({
}
})
minetest.register_craft({
type = "shapeless",
output = "mcl_maps:filled_map 2",
recipe = {"mcl_maps:filled_map", "mcl_maps:empty_map"},
})
minetest.register_on_craft(function(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 stack:get_name() == "mcl_maps:filled_map" then
itemstack:get_meta():from_table(stack:get_meta():to_table())
return itemstack
end
end
end
end)
local maps = {}
local huds = {}