diff --git a/.gitignore b/.gitignore index a5c8936..477f6f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,8 @@ +# Folders .vscode -.env \ No newline at end of file +.env + +# Files +ns_vl_caves_schist_large.png +ns_vl_caves_gneiss_large.png +show.py diff --git a/init.lua b/init.lua index 7882487..f4e77da 100644 --- a/init.lua +++ b/init.lua @@ -304,6 +304,16 @@ function internal.register_ore(def) }) end +function internal.register_monster_spawn(name, biomes, interval, chance, aoc) + return mcl_mobs:spawn_specific( + "mobs_mc:" .. name, "overworld", "ground", biomes, 0, 7, + interval, chance, aoc, mcl_vars.mg_overworld_min, + mcl_vars.mg_overworld_max, nil, function(self, pos) + minetest.debug("Spawned " .. name .. " at position " .. minetest.pos_to_string(pos)) + end + ) +end + -- Register a new deepslate-like stone type. -- { -- -- Name of the deepslate type. Required. @@ -528,6 +538,17 @@ function internal.overwrite_register_biome() OLD_REGISTER_BIOME(slate_def) OLD_REGISTER_BIOME(schist_def) OLD_REGISTER_BIOME(gneiss_def) + + local biome_names = { slate_def.name, schist_def.name, gneiss_def.name } + + internal.register_monster_spawn("zombie", biome_names, 30, 1000, 4) + internal.register_monster_spawn("rover", biome_names, 30, 100, 2) + internal.register_monster_spawn("skeleton", biome_names, 20, 800, 2) + internal.register_monster_spawn("spider", biome_names, 30, 1000, 2) + internal.register_monster_spawn("stalker", biome_names, 20, 1000, 2) + internal.register_monster_spawn("villager_zombie", biome_names, 30, 50, 4) + internal.register_monster_spawn("zombie", biome_names, 30, 1000, 4) + internal.register_monster_spawn("baby_zombie", biome_names, 30, 50, 4) else return OLD_REGISTER_BIOME(def) end diff --git a/mod.conf b/mod.conf index 23498c8..b0846d0 100644 --- a/mod.conf +++ b/mod.conf @@ -2,5 +2,5 @@ name=ns_vl_caves description=Custom caves in VoxeLibre author=Noordstar title=VoxeLibre caves -depends=mcl_core,mcl_init,mcl_raw_ores,mcl_sounds,mcl_util,ns_cavegen +depends=mcl_core,mcl_init,mcl_mobs,mcl_raw_ores,mcl_sounds,mcl_util,ns_cavegen optional_depends= \ No newline at end of file