diff --git a/init.lua b/init.lua index 2c2bf5f..89333f4 100644 --- a/init.lua +++ b/init.lua @@ -171,6 +171,52 @@ maps.create_map = function(pos, player_name) local image = tga_encoder.image(pixels) + local positions = minetest.find_nodes_in_area( + minp, + maxp, + "group:door" + ) + for _, p in ipairs(positions) do + local z = p.z - minp.z + 1 + local x = p.x - minp.x + 1 + local draw_house = ( + z > 1 and + z < size - 7 and + x > 4 and + x < size - 4 + ) + if draw_house then + local _ = { nil } -- transparent + local O = { 8 } -- outline + local F = { 9 } -- filling + local house = { + { _, _, _, _, _, _, _ }, + { _, O, O, O, O, O, _ }, + { _, O, F, F, F, O, _ }, + { _, O, F, F, F, O, _ }, + { _, O, F, F, F, O, _ }, + { _, _, O, F, O, _, _ }, + { _, _, _, O, _, _, _ }, + { _, _, _, _, _, _, _ }, + } + image:blit_icon( + house, + { + x = x - 5, + z = z - 1, + }, + { + [4] = true, + [5] = true, + [6] = true, + [7] = true, + [8] = true, + [9] = true, + } + ) + end + end + local positions = minetest.find_nodes_in_area_under_air( minp, maxp,