diff --git a/mods/mapgen/mapgen.lua b/mods/mapgen/mapgen.lua index 2b7306a..e616316 100644 --- a/mods/mapgen/mapgen.lua +++ b/mods/mapgen/mapgen.lua @@ -2084,6 +2084,18 @@ minetest.register_decoration({ height = 1, }) + --giant grass + + minetest.register_decoration({ + deco_type = "simple", + place_on = "mapgen:dirt_with_swampgrass", + sidelen = 16, + fill_ratio = 0.1, + biomes = {"swamp",}, + decoration = "mapgen:giantgrass", + height = 1, +}) + --pineapple minetest.register_decoration({ deco_type = "simple", @@ -2313,6 +2325,18 @@ minetest.register_decoration({ y_max = 31000, decoration = "default:junglegrass", }) + + --Aloe Vera + +minetest.register_decoration({ + deco_type = "simple", + place_on = "default:desert_sand", + sidelen = 16, + fill_ratio = 0.02, + biomes = {"swamp",}, + decoration = "mapgen:aloe_vera", + height = 1, +}) -- Dry shrub @@ -2406,7 +2430,7 @@ minetest.register_on_generated(function(minp, maxp) for n = 1, #dirt do local pos = {x = dirt[n].x, y = dirt[n].y, z = dirt[n].z } local name = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name - if name == "mapgen:lavender_flower" or name == "mapgen:swamp_grass_1" or name == "mapgen:swamp_grass_2" or name == "mapgen:swamp_grass_3" or name == "mapgen:swamp_grass_4" or name == "mapgen:swamp_grass_5" then + if name == "mapgen:lavender_flower" or name == "mapgen:swamp_grass_1" or name == "mapgen:giantgrass" or name == "mapgen:swamp_grass_2" or name == "mapgen:swamp_grass_3" or name == "mapgen:swamp_grass_4" or name == "mapgen:swamp_grass_5" then minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) end end diff --git a/mods/mapgen/textures/mapgen_giantgrass.png b/mods/mapgen/textures/mapgen_giantgrass.png index cc155ab..a37f257 100644 Binary files a/mods/mapgen/textures/mapgen_giantgrass.png and b/mods/mapgen/textures/mapgen_giantgrass.png differ diff --git a/mods/mobs_npc/npc.lua b/mods/mobs_npc/npc.lua index 3caf035..d5c2d62 100644 --- a/mods/mobs_npc/npc.lua +++ b/mods/mobs_npc/npc.lua @@ -66,11 +66,24 @@ mobs:register_mob("mobs_npc:npc", { local light_sources = minetest.find_node_near(pos, 5, {"default:torch", "default:torch_wall", "default:torch_floor", "default:torch_ceiling", "mese_lamp"}) local doors = minetest.find_node_near(pos, 5, {"doors:door_wood_a", "doors:door_glass_a", "doors:door_obsidian_glass_a"}) local is_owned = minetest.find_node_near(pos, 5, {"villages:colony_deed", "villages:hobo_deed",}) - local node_below = minetest.get_node({x=pos.x, y=pos.y-2.2, z=pos.z}) - local good_floor = minetest.get_item_group("node_below", "crumbly") + local node_below = minetest.get_node({x=pos.x, y=pos.y-2.2, z=pos.z}).name + local good_floor = minetest.get_item_group(node_below, "crumbly") if beds ~= nil and light_sources ~= nil and doors ~= nil and is_owned == nil and self.home == nil and good_floor == 0 then self.home = pos - minetest.set_node({x=pos.x, y=pos.y-1.5, z=pos.z}, {name="villages:colony_deed", param2=1}) + local free_space = minetest.find_node_near(light_sources, 1, {"air"}) + local pos1 = free_space + if minetest.get_node({x=pos1.x-1, y=pos1.y, z=pos1.z}).name ~= "air" then + minetest.set_node({x=pos1.x, y=pos1.y, z=pos1.z}, {name="villages:colony_deed", param2=3}) + minetest.chat_send_all("param3") + elseif minetest.get_node({x=pos1.x+1, y=pos1.y, z=pos1.z}).name ~= "air" then + minetest.set_node({x=pos1.x, y=pos1.y, z=pos1.z}, {name="villages:colony_deed", param2=2}) + minetest.chat_send_all("param2") + elseif minetest.get_node({x=pos1.x, y=pos1.y, z=pos1.z-1}).name ~= "air" then + minetest.set_node({x=pos1.x, y=pos1.y, z=pos1.z}, {name="villages:colony_deed", param2=5}) + minetest.chat_send_all("param5") + elseif minetest.get_node({x=pos1.x, y=pos1.y, z=pos1.z+1}).name ~= "air" then + minetest.set_node({x=pos1.x, y=pos1.y, z=pos1.z}, {name="villages:colony_deed", param2=4}) + end minetest.chat_send_all("NPC home set!") end