From f22b3fd4576dbf6adac365fdecad7fc9bd28b889 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 2 May 2021 12:23:29 +0200 Subject: [PATCH] Implement copying maps --- mods/ITEMS/mcl_maps/init.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mods/ITEMS/mcl_maps/init.lua b/mods/ITEMS/mcl_maps/init.lua index 9dc098b7c1..a01077eeff 100644 --- a/mods/ITEMS/mcl_maps/init.lua +++ b/mods/ITEMS/mcl_maps/init.lua @@ -185,6 +185,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 = {}