Draw flower icons on map

This commit is contained in:
Nils Dagsson Moskopp 2022-05-19 19:32:47 +02:00
parent 5c7ddf881d
commit 67c75b061c
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 41 additions and 0 deletions

View File

@ -331,6 +331,47 @@ maps.create_map = function(pos, player_name)
end end
end end
local positions = minetest.find_nodes_in_area_under_air(
minp,
maxp,
"group:flower"
)
for _, p in ipairs(positions) do
local z = p.z - minp.z + 1
local x = p.x - minp.x + 1
local draw_flower = (
z > 1 and
z < size - 3 and
x > 2 and
x < size - 2
)
if draw_flower then
local _ = { nil } -- transparent
local F = { 9 } -- line
local flower = {
{ _, _, _, },
{ _, F, _, },
{ _, F, _, },
{ _, _, _, },
}
image:blit_icon(
flower,
{
x = x - 2,
z = z - 1,
},
{
[4] = true,
[5] = true,
[6] = true,
[7] = true,
[8] = true,
[9] = true,
}
)
end
end
local filepath = textures_dir .. filename local filepath = textures_dir .. filename
image:save( image:save(
filepath, filepath,