Draw flower icons on map
This commit is contained in:
parent
5c7ddf881d
commit
67c75b061c
41
init.lua
41
init.lua
|
@ -331,6 +331,47 @@ maps.create_map = function(pos, player_name)
|
|||
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
|
||||
image:save(
|
||||
filepath,
|
||||
|
|
Loading…
Reference in New Issue