Fix copied maps not retaining marker information
This commit is contained in:
parent
0f706533b6
commit
4cc3a4cfaa
@ -149,6 +149,10 @@ function cartographer.create_map_item(size, detail, scale)
|
||||
return map;
|
||||
end
|
||||
|
||||
-- Create a copy of the given map
|
||||
-- stack: An itemstack containing a map
|
||||
--
|
||||
-- Returns an itemstack with the copied map
|
||||
function cartographer.copy_map_item(stack)
|
||||
local meta = stack:get_meta();
|
||||
|
||||
@ -169,6 +173,9 @@ function cartographer.copy_map_item(stack)
|
||||
for k,v in pairs(src.fill) do
|
||||
dest.fill[k] = v;
|
||||
end
|
||||
for k,v in pairs(src.markers) do
|
||||
dest.markers[k] = v;
|
||||
end
|
||||
|
||||
copy_meta:set_int("cartographer:map_id", new_id);
|
||||
copy_meta:set_string("description", "Map #" .. tostring(new_id) .. "\n[" .. tostring(fromchunk(dest.x)) .. "," .. tostring(fromchunk(dest.z)) .. "] - [" .. tostring(fromchunk(dest.x + dest.w)) .. "," .. tostring(fromchunk(dest.z + dest.h)) .. "]")
|
||||
|
Loading…
Reference in New Issue
Block a user