Add ancient_world structures.

master
Beha 2017-01-09 15:47:08 -05:00
parent 06017517c5
commit 035dfa96c9
6 changed files with 56 additions and 0 deletions

View File

@ -12,8 +12,10 @@ end
domodfile("config.lua")
local mod_ready_registry = {}
local has_loaded = {}
function kingdoms.mod_ready(mod)
has_loaded[mod] = true
if mod_ready_registry[mod] then
for _,f in ipairs(mod_ready_registry[mod]) do
if f.params then
@ -26,6 +28,9 @@ function kingdoms.mod_ready(mod)
end
function kingdoms.at_mod_load(mod, func, ...)
if has_loaded[mod] then
return func(...)
end
mod_ready_registry[mod] = mod_ready_registry[mod] or {}
table.insert(mod_ready_registry[mod], {
func = func,

View File

@ -31,5 +31,9 @@ domodfile("spells/attack.lua")
domodfile("spells/defense.lua")
domodfile("spells/teleportation.lua")
if rawget(_G, "ancient_world") then
domodfile("structures.lua")
end
magic.log("action", "Loaded.")
kingdoms.mod_ready("magic")

Binary file not shown.

Binary file not shown.

Binary file not shown.

47
magic/structures.lua Normal file
View File

@ -0,0 +1,47 @@
ancient_world.register("magic:magic_hovel_1", {
schematic = minetest.get_modpath("magic") .. "/schematics/magic_hovel_1.mts",
type = "decoration",
limit_y = {
max = -1024,
min = -31000,
},
on = {"default:stone"},
random_replacements = {
["ancient_world:placeholder_1"] = {"magic:nightcall", "magic:daypull"},
},
})
ancient_world.register("magic:magic_hovel_2", {
schematic = minetest.get_modpath("magic") .. "/schematics/magic_hovel_2.mts",
type = "decoration",
on = {"default:dirt_with_grass"},
offset = {
x = 0,
y = -3,
z = 0,
},
random_replacements = {
["ancient_world:placeholder_1"] = true,
},
})
ancient_world.register("magic:underground_lab_1", {
schematic = minetest.get_modpath("magic") .. "/schematics/underground_lab_1.mts",
type = "decoration",
limit_y = {
max = -512,
min = -31000,
},
offset = {
x = 0,
y = -16,
z = 0,
},
on = {"default:stone"},
replacements = {
["ancient_world:placeholder_2"] = "air",
},
random_replacements = {
["ancient_world:placeholder_1"] = true,
},
})