Add two underground structures.

master
Beha 2017-01-08 20:56:21 -05:00
parent be967e44b4
commit fc14edb398
4 changed files with 28 additions and 3 deletions

View File

@ -51,6 +51,7 @@ end
ancient_world.registry = {}
function ancient_world.register(name, def)
local d = {
chance = 0.1,
offset = {x=0, y=0, z=0},
limit_y = {max = 31000, min = -31000},
}
@ -79,6 +80,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
{x=minp.x, y=math.max(minp.y, def.limit_y.min), z=minp.z},
{x=maxp.x, y=math.min(maxp.y, def.limit_y.max), z=maxp.z},
def.on)
elseif def.type == "embedded" then
possible = minetest.find_nodes_in_area(
{x=minp.x, y=math.max(minp.y, def.limit_y.min), z=minp.z},
{x=maxp.x, y=math.min(maxp.y, def.limit_y.max), z=maxp.z},
def.inside)
end
if #possible > 0 then
local r = table.copy(def.replacements or {})

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,6 @@
-- Old guardtower/outpost upon desert sand.
ancient_world.register("ancient_world:ruin_desert_sand_1:desert_sand", {
schematic = minetest.get_modpath("ancient_world") .. "/schematics/ruin_desert_sand_1.mts",
chance = 0.1,
type = "decoration",
offset = {
x = 0,
@ -21,7 +20,6 @@ ancient_world.register("ancient_world:ruin_desert_sand_1:desert_sand", {
-- Normal sand.
ancient_world.register("ancient_world:ruin_desert_sand_1:sand", {
schematic = minetest.get_modpath("ancient_world") .. "/schematics/ruin_desert_sand_1.mts",
chance = 0.1,
type = "decoration",
offset = {
x = 0,
@ -44,7 +42,6 @@ ancient_world.register("ancient_world:ruin_desert_sand_1:sand", {
-- Silver sand.
ancient_world.register("ancient_world:ruin_desert_sand_1:silver_sand", {
schematic = minetest.get_modpath("ancient_world") .. "/schematics/ruin_desert_sand_1.mts",
chance = 0.1,
type = "decoration",
offset = {
x = 0,
@ -64,3 +61,25 @@ ancient_world.register("ancient_world:ruin_desert_sand_1:silver_sand", {
},
})
ancient_world.register("ancient_world:underground_hovel_1", {
schematic = minetest.get_modpath("ancient_world") .. "/schematics/underground_hovel_1.mts",
type = "decoration",
limit_y = {
max = -64,
min = -31000,
},
on = {"default:stone"},
random_replacements = {
["ancient_world:placeholder_1"] = true,
},
})
ancient_world.register("ancient_world:underground_hovel_2", {
schematic = minetest.get_modpath("ancient_world") .. "/schematics/underground_hovel_2.mts",
type = "decoration",
limit_y = {
max = -64,
min = -31000,
},
on = {"default:stone"},
})