From 8e1e02d1fbc189680dbd004bdd905446467a4e29 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 06:04:36 -0400 Subject: [PATCH 01/12] Add biome list --- mods/ENTITIES/mcl_mobs/spawning.lua | 163 ++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index b56fe1cee0..9ea774ba9c 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -1,3 +1,166 @@ +--[[ + +THIS IS THE BIG LIST OF ALL BIOMES - used for programming/updating mobs + +underground: +FlowerForest_underground +JungleEdge_underground +StoneBeach_underground +MesaBryce_underground +Mesa_underground +RoofedForest_underground +Jungle_underground +Swampland_underground +MushroomIsland_underground +BirchForest_underground +Plains_underground +MesaPlateauF_underground +ExtremeHills_underground +MegaSpruceTaiga_underground +BirchForestM_underground +SavannaM_underground +MesaPlateauFM_underground +Desert_underground +Savanna_underground +Forest_underground +SunflowerPlains_underground +ColdTaiga_underground +IcePlains_underground +IcePlainsSpikes_underground +MegaTaiga_underground +Taiga_underground +ExtremeHills+_underground +JungleM_underground +ExtremeHillsM_underground +JungleEdgeM_underground + +ocean: +RoofedForest_ocean +JungleEdgeM_ocean +BirchForestM_ocean +BirchForest_ocean +IcePlains_deep_ocean +Jungle_deep_ocean +Savanna_ocean +MesaPlateauF_ocean +ExtremeHillsM_deep_ocean +Savanna_deep_ocean +SunflowerPlains_ocean +Swampland_deep_ocean +Swampland_ocean +MegaSpruceTaiga_deep_ocean +ExtremeHillsM_ocean +JungleEdgeM_deep_ocean +SunflowerPlains_deep_ocean +BirchForest_deep_ocean +IcePlainsSpikes_ocean +Mesa_ocean +StoneBeach_ocean +Plains_deep_ocean +JungleEdge_deep_ocean +SavannaM_deep_ocean +Desert_deep_ocean +Mesa_deep_ocean +ColdTaiga_deep_ocean +Plains_ocean +MesaPlateauFM_ocean +Forest_deep_ocean +JungleM_deep_ocean +FlowerForest_deep_ocean +MushroomIsland_ocean +MegaTaiga_ocean +StoneBeach_deep_ocean +IcePlainsSpikes_deep_ocean +ColdTaiga_ocean +SavannaM_ocean +MesaPlateauF_deep_ocean +MesaBryce_deep_ocean +ExtremeHills+_deep_ocean +ExtremeHills_ocean +MushroomIsland_deep_ocean +Forest_ocean +MegaTaiga_deep_ocean +JungleEdge_ocean +MesaBryce_ocean +MegaSpruceTaiga_ocean +ExtremeHills+_ocean +Jungle_ocean +RoofedForest_deep_ocean +IcePlains_ocean +FlowerForest_ocean +ExtremeHills_deep_ocean +MesaPlateauFM_deep_ocean +Desert_ocean +Taiga_ocean +BirchForestM_deep_ocean +Taiga_deep_ocean +JungleM_ocean + +water or beach? +MesaPlateauFM_sandlevel +MesaPlateauF_sandlevel +MesaBryce_sandlevel +Mesa_sandlevel + +beach: +FlowerForest_beach +Forest_beach +StoneBeach +ColdTaiga_beach_water +Taiga_beach +Savanna_beach +Plains_beach +ExtremeHills_beach +ColdTaiga_beach +Swampland_shore +MushroomIslandShore +JungleM_shore +Jungle_shore + +dimension biome: +Nether +End + +Overworld regular: +Mesa +FlowerForest +Swampland +Taiga +ExtremeHills +Jungle +Savanna +BirchForest +MegaSpruceTaiga +MegaTaiga +ExtremeHills+ +Forest +Plains +Desert +ColdTaiga +MushroomIsland +IcePlainsSpikes +SunflowerPlains +IcePlains +RoofedForest + +I have no idea: +ExtremeHills+_snowtop +MesaPlateauFM_grasstop +JungleEdgeM +ExtremeHillsM +JungleM +BirchForestM +MesaPlateauF +MesaPlateauFM +MesaPlateauF_grasstop +MesaBryce +JungleEdge +SavannaM +]]-- + + + + local mobs_spawn = minetest.settings:get_bool("mobs_spawn", true) ~= false -- count how many mobs of one type are inside an area --[[ From bf4bf9a0cc60a1a15f1ddbfed314ec5a9c75561c Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 06:10:07 -0400 Subject: [PATCH 02/12] Ignore default or void dimensions --- mods/ENTITIES/mcl_mobs/spawning.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 9ea774ba9c..765c78ba04 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -551,11 +551,16 @@ if mobs_spawn then minetest.register_globalstep(function(dtime) timer = timer + dtime if timer >= 15 then - timer = 0--15--0 + timer = 15--0 for _,player in ipairs(minetest.get_connected_players()) do for i = 1,math.random(5) do local player_pos = player:get_pos() local _,dimension = mcl_worlds.y_to_layer(player_pos.y) + + if dimension == "void" or dimension == "default" then + goto continue -- ignore void and unloaded area + end + local min,max = decypher_limits(player_pos.y) local goal_pos = position_calculation(player_pos) @@ -566,7 +571,7 @@ if mobs_spawn then goto continue --skip if in unloaded area end - --print(minetest.get_biome_name(gotten_biome.biome)) + print(minetest.get_biome_name(gotten_biome.biome)) local mob_def = spawn_dictionary[dimension][math.random(1,#spawn_dictionary[dimension])] From f4a6bdc6b89b2d605cfd06f0b7baa6170a19314c Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 06:48:25 -0400 Subject: [PATCH 03/12] Make reference list copy-pastable --- mods/ENTITIES/mcl_mobs/spawning.lua | 307 ++++++++++++++-------------- 1 file changed, 159 insertions(+), 148 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 765c78ba04..40c9ee7a9b 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -3,159 +3,159 @@ THIS IS THE BIG LIST OF ALL BIOMES - used for programming/updating mobs underground: -FlowerForest_underground -JungleEdge_underground -StoneBeach_underground -MesaBryce_underground -Mesa_underground -RoofedForest_underground -Jungle_underground -Swampland_underground -MushroomIsland_underground -BirchForest_underground -Plains_underground -MesaPlateauF_underground -ExtremeHills_underground -MegaSpruceTaiga_underground -BirchForestM_underground -SavannaM_underground -MesaPlateauFM_underground -Desert_underground -Savanna_underground -Forest_underground -SunflowerPlains_underground -ColdTaiga_underground -IcePlains_underground -IcePlainsSpikes_underground -MegaTaiga_underground -Taiga_underground -ExtremeHills+_underground -JungleM_underground -ExtremeHillsM_underground -JungleEdgeM_underground +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", ocean: -RoofedForest_ocean -JungleEdgeM_ocean -BirchForestM_ocean -BirchForest_ocean -IcePlains_deep_ocean -Jungle_deep_ocean -Savanna_ocean -MesaPlateauF_ocean -ExtremeHillsM_deep_ocean -Savanna_deep_ocean -SunflowerPlains_ocean -Swampland_deep_ocean -Swampland_ocean -MegaSpruceTaiga_deep_ocean -ExtremeHillsM_ocean -JungleEdgeM_deep_ocean -SunflowerPlains_deep_ocean -BirchForest_deep_ocean -IcePlainsSpikes_ocean -Mesa_ocean -StoneBeach_ocean -Plains_deep_ocean -JungleEdge_deep_ocean -SavannaM_deep_ocean -Desert_deep_ocean -Mesa_deep_ocean -ColdTaiga_deep_ocean -Plains_ocean -MesaPlateauFM_ocean -Forest_deep_ocean -JungleM_deep_ocean -FlowerForest_deep_ocean -MushroomIsland_ocean -MegaTaiga_ocean -StoneBeach_deep_ocean -IcePlainsSpikes_deep_ocean -ColdTaiga_ocean -SavannaM_ocean -MesaPlateauF_deep_ocean -MesaBryce_deep_ocean -ExtremeHills+_deep_ocean -ExtremeHills_ocean -MushroomIsland_deep_ocean -Forest_ocean -MegaTaiga_deep_ocean -JungleEdge_ocean -MesaBryce_ocean -MegaSpruceTaiga_ocean -ExtremeHills+_ocean -Jungle_ocean -RoofedForest_deep_ocean -IcePlains_ocean -FlowerForest_ocean -ExtremeHills_deep_ocean -MesaPlateauFM_deep_ocean -Desert_ocean -Taiga_ocean -BirchForestM_deep_ocean -Taiga_deep_ocean -JungleM_ocean +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", water or beach? -MesaPlateauFM_sandlevel -MesaPlateauF_sandlevel -MesaBryce_sandlevel -Mesa_sandlevel +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", beach: -FlowerForest_beach -Forest_beach -StoneBeach -ColdTaiga_beach_water -Taiga_beach -Savanna_beach -Plains_beach -ExtremeHills_beach -ColdTaiga_beach -Swampland_shore -MushroomIslandShore -JungleM_shore -Jungle_shore +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", dimension biome: -Nether -End +"Nether", +"End", Overworld regular: -Mesa -FlowerForest -Swampland -Taiga -ExtremeHills -Jungle -Savanna -BirchForest -MegaSpruceTaiga -MegaTaiga -ExtremeHills+ -Forest -Plains -Desert -ColdTaiga -MushroomIsland -IcePlainsSpikes -SunflowerPlains -IcePlains -RoofedForest +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", I have no idea: -ExtremeHills+_snowtop -MesaPlateauFM_grasstop -JungleEdgeM -ExtremeHillsM -JungleM -BirchForestM -MesaPlateauF -MesaPlateauFM -MesaPlateauF_grasstop -MesaBryce -JungleEdge -SavannaM +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", ]]-- @@ -219,6 +219,7 @@ end --[[ Custom elements changed: + name: the mobs name @@ -233,7 +234,11 @@ types of spawning: "ground" "lava" -what is aoc??? +biomes: tells the spawner to allow certain mobs to spawn in certain biomes +{"this", "that", "grasslands", "whatever"} + + +what is aoc??? objects in area WARNING: BIOME INTEGRATION NEEDED -> How to get biome through lua?? ]]-- @@ -245,7 +250,10 @@ local spawn_dictionary = { ["end"] = {} } -function mobs:spawn_specific(name, dimension, type_of_spawning, min_light, max_light, interval, chance, aoc, min_height, max_height, day_toggle, on_spawn) +function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_light, max_light, interval, chance, aoc, min_height, max_height, day_toggle, on_spawn) + + print(dump(bimoes)) + -- Do mobs spawn at all? if not mobs_spawn then return @@ -472,7 +480,7 @@ end ]]-- ---I'm not sure what this does but disabling it doesn't cause a crash -j4i +--Don't disable this yet-j4i -- MarkBu's spawn function function mobs:spawn(def) @@ -546,6 +554,7 @@ end) --todo mob limiting --MAIN LOOP +--[[ if mobs_spawn then local timer = 15 --0 minetest.register_globalstep(function(dtime) @@ -557,9 +566,10 @@ if mobs_spawn then local player_pos = player:get_pos() local _,dimension = mcl_worlds.y_to_layer(player_pos.y) - if dimension == "void" or dimension == "default" then - goto continue -- ignore void and unloaded area - end + if dimension == "void" or dimension == "default" then + goto continue -- ignore void and unloaded area + end + local min,max = decypher_limits(player_pos.y) @@ -635,4 +645,5 @@ if mobs_spawn then end end end) -end \ No newline at end of file +end +]]-- \ No newline at end of file From 0ad833c046095d83a789705aa15dd7f30fd8f3ed Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 06:57:24 -0400 Subject: [PATCH 04/12] Add bats, chicken, and blaze spawn info --- mods/ENTITIES/mcl_mobs/spawning.lua | 7 ++- mods/ENTITIES/mobs_mc/bat.lua | 76 ++++++++++++++++++++++++++++- mods/ENTITIES/mobs_mc/blaze.lua | 13 ++++- mods/ENTITIES/mobs_mc/chicken.lua | 29 ++++++++++- 4 files changed, 118 insertions(+), 7 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 40c9ee7a9b..515dbaf3d0 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -142,8 +142,6 @@ Overworld regular: "SunflowerPlains", "IcePlains", "RoofedForest", - -I have no idea: "ExtremeHills+_snowtop", "MesaPlateauFM_grasstop", "JungleEdgeM", @@ -252,7 +250,7 @@ local spawn_dictionary = { function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_light, max_light, interval, chance, aoc, min_height, max_height, day_toggle, on_spawn) - print(dump(bimoes)) + print(dump(biomes)) -- Do mobs spawn at all? if not mobs_spawn then @@ -543,7 +541,7 @@ local function decypher_limits(posy) posy = math.floor(posy) return posy - 32, posy + 32 end - +--[[ minetest.register_on_mods_loaded(function() for _,data in pairs(minetest.registered_biomes) do print(data.name) @@ -551,6 +549,7 @@ minetest.register_on_mods_loaded(function() print(dump(spawn_dictionary)) end) +]]-- --todo mob limiting --MAIN LOOP diff --git a/mods/ENTITIES/mobs_mc/bat.lua b/mods/ENTITIES/mobs_mc/bat.lua index b6825bbbf4..a525f55830 100644 --- a/mods/ENTITIES/mobs_mc/bat.lua +++ b/mods/ENTITIES/mobs_mc/bat.lua @@ -64,7 +64,81 @@ else end -- Spawn on solid blocks at or below Sea level and the selected light level -mobs:spawn_specific("mobs_mc:bat", "overworld", "air", 0, maxlight, 20, 5000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water-1) +mobs:spawn_specific( +"mobs_mc:bat", +"overworld", +"air", +{ +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +}, +0, +maxlight, +20, +5000, +2, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.water-1) -- spawn eggs diff --git a/mods/ENTITIES/mobs_mc/blaze.lua b/mods/ENTITIES/mobs_mc/blaze.lua index d56acdf380..847e2f4a53 100644 --- a/mods/ENTITIES/mobs_mc/blaze.lua +++ b/mods/ENTITIES/mobs_mc/blaze.lua @@ -128,7 +128,18 @@ mobs:register_mob("mobs_mc:blaze", { end, }) -mobs:spawn_specific("mobs_mc:blaze", "nether", "ground", 0, minetest.LIGHT_MAX+1, 30, 5000, 3, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) +mobs:spawn_specific( +"mobs_mc:blaze", +"nether", +"ground", +{"Nether"}, +0, +minetest.LIGHT_MAX+1, +30, +5000, +3, +mobs_mc.spawn_height.nether_min, +mobs_mc.spawn_height.nether_max) -- Blaze fireball mobs:register_arrow("mobs_mc:blaze_fireball", { diff --git a/mods/ENTITIES/mobs_mc/chicken.lua b/mods/ENTITIES/mobs_mc/chicken.lua index 397b6b8da0..43044aae05 100644 --- a/mods/ENTITIES/mobs_mc/chicken.lua +++ b/mods/ENTITIES/mobs_mc/chicken.lua @@ -100,7 +100,34 @@ mobs:register_mob("mobs_mc:chicken", { }) --spawn -mobs:spawn_specific("mobs_mc:chicken", "overworld", "ground", 9, minetest.LIGHT_MAX+1, 30, 17000, 3, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:chicken", +"overworld", +"ground", +{ +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"ColdTaiga", +"SunflowerPlains", +"RoofedForest", +"MesaPlateauFM_grasstop", +"ExtremeHillsM", +"BirchForestM", +} +9, +minetest.LIGHT_MAX+1, +30, 17000, +3, +mobs_mc.spawn_height.spawn_height.water, +mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:chicken", S("Chicken"), "mobs_mc_spawn_icon_chicken.png", 0) From f900b24b53a802fd5db1bf1a633d7f89e42bcce5 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 07:39:18 -0400 Subject: [PATCH 05/12] Add in all biome information to mobs --- mods/ENTITIES/mobs_mc/chicken.lua | 4 +- mods/ENTITIES/mobs_mc/cow+mooshroom.lua | 49 ++++- mods/ENTITIES/mobs_mc/creeper.lua | 153 +++++++++++++- mods/ENTITIES/mobs_mc/enderman.lua | 184 ++++++++++++++++- mods/ENTITIES/mobs_mc/ghast.lua | 15 +- mods/ENTITIES/mobs_mc/horse.lua | 52 ++++- mods/ENTITIES/mobs_mc/llama.lua | 20 +- mods/ENTITIES/mobs_mc/ocelot.lua | 18 +- mods/ENTITIES/mobs_mc/parrot.lua | 18 +- mods/ENTITIES/mobs_mc/pig.lua | 30 ++- mods/ENTITIES/mobs_mc/polar_bear.lua | 18 +- mods/ENTITIES/mobs_mc/sheep.lua | 30 ++- mods/ENTITIES/mobs_mc/shulker.lua | 15 +- mods/ENTITIES/mobs_mc/silverfish.lua | 22 +- mods/ENTITIES/mobs_mc/skeleton+stray.lua | 188 ++++++++++++++++- mods/ENTITIES/mobs_mc/skeleton_wither.lua | 17 +- mods/ENTITIES/mobs_mc/slime+magma_cube.lua | 182 ++++++++++++++++- mods/ENTITIES/mobs_mc/spider.lua | 153 +++++++++++++- mods/ENTITIES/mobs_mc/squid.lua | 153 +++++++++++++- mods/ENTITIES/mobs_mc/villager.lua | 30 ++- mods/ENTITIES/mobs_mc/wolf.lua | 30 ++- mods/ENTITIES/mobs_mc/zombie.lua | 224 ++++++++++++++++++++- mods/ENTITIES/mobs_mc/zombiepig.lua | 30 ++- 23 files changed, 1589 insertions(+), 46 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/chicken.lua b/mods/ENTITIES/mobs_mc/chicken.lua index 43044aae05..246bf216ac 100644 --- a/mods/ENTITIES/mobs_mc/chicken.lua +++ b/mods/ENTITIES/mobs_mc/chicken.lua @@ -121,12 +121,12 @@ mobs:spawn_specific( "MesaPlateauFM_grasstop", "ExtremeHillsM", "BirchForestM", -} +}, 9, minetest.LIGHT_MAX+1, 30, 17000, 3, -mobs_mc.spawn_height.spawn_height.water, +mobs_mc.spawn_height.water, mobs_mc.spawn_height.overworld_max) -- spawn eggs diff --git a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua index a094d6d355..656570a83a 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -145,9 +145,52 @@ mobs:register_mob("mobs_mc:mooshroom", mooshroom_def) -- Spawning -mobs:spawn_specific("mobs_mc:cow", "overworld", "ground", 9, minetest.LIGHT_MAX+1, 30, 17000, 10, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) ---WARNING: THIS NEEDS A BIOME INTEGRATION -mobs:spawn_specific("mobs_mc:mooshroom", "overworld", "ground", 9, minetest.LIGHT_MAX+1, 30, 17000, 5, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:cow", +"overworld", +"ground", +{ +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"ColdTaiga", +"SunflowerPlains", +"RoofedForest", +"MesaPlateauFM_grasstop", +"ExtremeHillsM", +"BirchForestM", +}, +9, +minetest.LIGHT_MAX+1, +30, +17000, +10, +mobs_mc.spawn_height.water, +mobs_mc.spawn_height.overworld_max) + + +mobs:spawn_specific( +"mobs_mc:mooshroom", +"overworld", +"ground", +{ +"MushroomIslandShore", +"MushroomIsland" +}, +9, +minetest.LIGHT_MAX+1, +30, +17000, +5, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) -- spawn egg mobs:register_egg("mobs_mc:cow", S("Cow"), "mobs_mc_spawn_icon_cow.png", 0) diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index f1f0a3ef69..0c884d5699 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -253,7 +253,158 @@ mobs:register_mob("mobs_mc:creeper_charged", { glow = 3, }) -mobs:spawn_specific("mobs_mc:creeper", "overworld", "ground", 0, 7, 20, 16500, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:creeper", +"overworld", +"ground", +{ +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +7, +20, +16500, +2, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:creeper", S("Creeper"), "mobs_mc_spawn_icon_creeper.png", 0) diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index ca3bc84cea..ba04f8b594 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -562,11 +562,189 @@ mobs:register_mob("mobs_mc:enderman", { -- End spawn -mobs:spawn_specific("mobs_mc:enderman", "end", "ground", 0, minetest.LIGHT_MAX+1, 30, 3000, 12, mobs_mc.spawn_height.end_min, mobs_mc.spawn_height.end_max) +mobs:spawn_specific( +"mobs_mc:enderman", +"end", +"ground", +{ +"End" +}, +0, +minetest.LIGHT_MAX+1, +30, +3000, +12, +mobs_mc.spawn_height.end_min, +mobs_mc.spawn_height.end_max) -- Overworld spawn -mobs:spawn_specific("mobs_mc:enderman", "overworld", "ground", 0, 7, 30, 19000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:enderman", +"overworld", +"ground", +{ +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +7, +30, +19000, +2, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) + -- Nether spawn (rare) -mobs:spawn_specific("mobs_mc:enderman", "nether", "ground", 0, 7, 30, 27500, 4, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) +mobs:spawn_specific( +"mobs_mc:enderman", +"nether", +"ground", +{ +"Nether" +}, +0, +7, +30, +27500, +4, +mobs_mc.spawn_height.nether_min, +mobs_mc.spawn_height.nether_max) -- spawn eggs mobs:register_egg("mobs_mc:enderman", S("Enderman"), "mobs_mc_spawn_icon_enderman.png", 0) diff --git a/mods/ENTITIES/mobs_mc/ghast.lua b/mods/ENTITIES/mobs_mc/ghast.lua index e2f6b13692..9c3e0cee1a 100644 --- a/mods/ENTITIES/mobs_mc/ghast.lua +++ b/mods/ENTITIES/mobs_mc/ghast.lua @@ -75,7 +75,20 @@ mobs:register_mob("mobs_mc:ghast", { }) -mobs:spawn_specific("mobs_mc:ghast", "nether", "air", 0, minetest.LIGHT_MAX+1, 30, 18000, 2, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) +mobs:spawn_specific( +"mobs_mc:ghast", +"nether", +"air", +{ +"Nether" +}, +0, +minetest.LIGHT_MAX+1, +30, +18000, +2, +mobs_mc.spawn_height.nether_min, +mobs_mc.spawn_height.nether_max) -- fireball (projectile) mobs:register_arrow("mobs_mc:fireball", { diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index 00c292c1de..938a6b6ace 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -510,8 +510,56 @@ mobs:register_mob("mobs_mc:mule", mule) --=========================== --Spawn Function -mobs:spawn_specific("mobs_mc:horse", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 15000, 4, mobs_mc.spawn_height.water+3, mobs_mc.spawn_height.overworld_max) -mobs:spawn_specific("mobs_mc:donkey", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 15000, 4, mobs_mc.spawn_height.water+3, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:horse", +"overworld", +"ground", +{ +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"ColdTaiga", +"SunflowerPlains", +"RoofedForest", +"MesaPlateauFM_grasstop", +"ExtremeHillsM", +"BirchForestM", +}, +0, +minetest.LIGHT_MAX+1, +30, +15000, +4, +mobs_mc.spawn_height.water+3, +mobs_mc.spawn_height.overworld_max) + + +mobs:spawn_specific( +"mobs_mc:donkey", +"overworld", +"ground", +{ +"Mesa", +"MesaPlateauFM_grasstop", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +}, +0, +minetest.LIGHT_MAX+1, +30, +15000, +4, +mobs_mc.spawn_height.water+3, +mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:horse", S("Horse"), "mobs_mc_spawn_icon_horse.png", 0) diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index 0efb8e0ab2..8ff82b502a 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -217,7 +217,25 @@ mobs:register_mob("mobs_mc:llama", { }) --spawn -mobs:spawn_specific("mobs_mc:llama", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 15000, 5, mobs_mc.spawn_height.water+15, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:llama", +"overworld", +"ground", +{ +"Mesa", +"MesaPlateauFM_grasstop", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +}, +0, +minetest.LIGHT_MAX+1, +30, +15000, +5, +mobs_mc.spawn_height.water+15, +mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:llama", S("Llama"), "mobs_mc_spawn_icon_llama.png", 0) diff --git a/mods/ENTITIES/mobs_mc/ocelot.lua b/mods/ENTITIES/mobs_mc/ocelot.lua index 3b5273185e..f3c8c87ae1 100644 --- a/mods/ENTITIES/mobs_mc/ocelot.lua +++ b/mods/ENTITIES/mobs_mc/ocelot.lua @@ -153,7 +153,23 @@ local base_spawn_chance = 5000 -- Spawn ocelot --they get the same as the llama because I'm trying to rework so much of this code right now -j4i -mobs:spawn_specific("mobs_mc:ocelot", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 15000, 5, mobs_mc.spawn_height.water+15, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:ocelot", +"overworld", +"ground", +{ +"Jungle", +"JungleEdgeM", +"JungleM", +"JungleEdge", +}, +0, +minetest.LIGHT_MAX+1, +30, +15000, +5, +mobs_mc.spawn_height.water+15, +mobs_mc.spawn_height.overworld_max) --[[ mobs:spawn({ name = "mobs_mc:ocelot", diff --git a/mods/ENTITIES/mobs_mc/parrot.lua b/mods/ENTITIES/mobs_mc/parrot.lua index c67263fb92..60329211e1 100644 --- a/mods/ENTITIES/mobs_mc/parrot.lua +++ b/mods/ENTITIES/mobs_mc/parrot.lua @@ -91,7 +91,23 @@ mobs:register_mob("mobs_mc:parrot", { }) -- Parrots spawn rarely in jungles. TODO: Also check for jungle *biome* <- I'll get to this eventually -j4i -mobs:spawn_specific("mobs_mc:parrot","overworld", "air", 0, minetest.LIGHT_MAX+1, 7, 30000, 1, mobs_mc.spawn_height.water+7, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:parrot", +"overworld", +"air", +{ +"Jungle", +"JungleEdgeM", +"JungleM", +"JungleEdge", +}, +0, +minetest.LIGHT_MAX+1, +7, +30000, +1, +mobs_mc.spawn_height.water+7, +mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0) diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua index 143fcb4950..b7cdf1afe9 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -182,7 +182,35 @@ mobs:register_mob("mobs_mc:pig", { end, }) -mobs:spawn_specific("mobs_mc:pig", "overworld", "ground", 9, minetest.LIGHT_MAX+1, 30, 15000, 8, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:pig", +"overworld", +"ground", +{ +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"ColdTaiga", +"SunflowerPlains", +"RoofedForest", +"MesaPlateauFM_grasstop", +"ExtremeHillsM", +"BirchForestM", +}, +9, +minetest.LIGHT_MAX+1, +30, +15000, +8, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:pig", S("Pig"), "mobs_mc_spawn_icon_pig.png", 0) diff --git a/mods/ENTITIES/mobs_mc/polar_bear.lua b/mods/ENTITIES/mobs_mc/polar_bear.lua index 745c13a26c..5d2853f6d2 100644 --- a/mods/ENTITIES/mobs_mc/polar_bear.lua +++ b/mods/ENTITIES/mobs_mc/polar_bear.lua @@ -67,7 +67,23 @@ mobs:register_mob("mobs_mc:polar_bear", { }) -mobs:spawn_specific("mobs_mc:polar_bear", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 7000, 3, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:polar_bear", +"overworld", +"ground", +{ +"ColdTaiga", +"IcePlainsSpikes", +"IcePlains", +"ExtremeHills+_snowtop", +}, +0, +minetest.LIGHT_MAX+1, +30, +7000, +3, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) -- spawn egg mobs:register_egg("mobs_mc:polar_bear", S("Polar Bear"), "mobs_mc_spawn_icon_polarbear.png", 0) diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index b3400ab5f5..d82df8cf9d 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -303,7 +303,35 @@ mobs:register_mob("mobs_mc:sheep", { end end, }) -mobs:spawn_specific("mobs_mc:sheep", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 15000, 3, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:sheep", +"overworld", +"ground", +{ +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"ColdTaiga", +"SunflowerPlains", +"RoofedForest", +"MesaPlateauFM_grasstop", +"ExtremeHillsM", +"BirchForestM", +}, +0, +minetest.LIGHT_MAX+1, +30, +15000, +3, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:sheep", S("Sheep"), "mobs_mc_spawn_icon_sheep.png", 0) diff --git a/mods/ENTITIES/mobs_mc/shulker.lua b/mods/ENTITIES/mobs_mc/shulker.lua index 583c5eed1e..8000d0937b 100644 --- a/mods/ENTITIES/mobs_mc/shulker.lua +++ b/mods/ENTITIES/mobs_mc/shulker.lua @@ -81,4 +81,17 @@ mobs:register_arrow("mobs_mc:shulkerbullet", { mobs:register_egg("mobs_mc:shulker", S("Shulker"), "mobs_mc_spawn_icon_shulker.png", 0) -mobs:spawn_specific("mobs_mc:shulker", "end", "ground", 0, minetest.LIGHT_MAX+1, 30, 5000, 2, mobs_mc.spawn_height.end_min, mobs_mc.spawn_height.end_max) +mobs:spawn_specific( +"mobs_mc:shulker", +"end", +"ground", +{ +"End" +}, +0, +minetest.LIGHT_MAX+1, +30, +5000, +2, +mobs_mc.spawn_height.end_min, +mobs_mc.spawn_height.end_max) diff --git a/mods/ENTITIES/mobs_mc/silverfish.lua b/mods/ENTITIES/mobs_mc/silverfish.lua index 433211503b..9a6f3fc98d 100644 --- a/mods/ENTITIES/mobs_mc/silverfish.lua +++ b/mods/ENTITIES/mobs_mc/silverfish.lua @@ -23,13 +23,23 @@ mobs:register_mob("mobs_mc:silverfish", { }, pathfinding = 1, visual_size = {x=3, y=3}, - sounds = { - random = "mobs_mc_silverfish_idle", - death = "mobs_mc_silverfish_death", - damage = "mobs_mc_silverfish_hurt", - distance = 16, + sounds = {"FlowerForest", + "Swampland", + "Taiga", + "ExtremeHills", + "BirchForest", + "MegaSpruceTaiga", + "MegaTaiga", + "ExtremeHills+", + "Forest", + "Plains", + "ColdTaiga", + "SunflowerPlains", + "RoofedForest", + "MesaPlateauFM_grasstop", + "ExtremeHillsM", + "BirchForestM", }, - makes_footstep_sound = false, walk_velocity = 0.6, run_velocity = 2, jump = true, diff --git a/mods/ENTITIES/mobs_mc/skeleton+stray.lua b/mods/ENTITIES/mobs_mc/skeleton+stray.lua index 84e51c5170..b43873b2aa 100644 --- a/mods/ENTITIES/mobs_mc/skeleton+stray.lua +++ b/mods/ENTITIES/mobs_mc/skeleton+stray.lua @@ -139,13 +139,195 @@ table.insert(stray.drops, { mobs:register_mob("mobs_mc:stray", stray) -- Overworld spawn -mobs:spawn_specific("mobs_mc:skeleton", "overworld", "ground", 0, 7, 20, 17000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:skeleton", +"overworld", +"ground", +{ +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +7, +20, +17000, +2, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) + + -- Nether spawn -mobs:spawn_specific("mobs_mc:skeleton", "nether", "ground", 0, 7, 30, 10000, 3, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) +mobs:spawn_specific( +"mobs_mc:skeleton", +"nether", +"ground", +{ +"Nether" +}, +0, +7, +30, +10000, +3, +mobs_mc.spawn_height.nether_min, +mobs_mc.spawn_height.nether_max) -- Stray spawn -- TODO: Spawn directly under the sky -mobs:spawn_specific("mobs_mc:stray", "overworld", "ground", 0, 7, 20, 19000, 2, mobs_mc.spawn_height.water, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:stray", +"overworld", +"ground", +{ +"ColdTaiga", +"IcePlainsSpikes", +"IcePlains", +"ExtremeHills+_snowtop", +}, +0, +7, +20, +19000, +2, +mobs_mc.spawn_height.water, +mobs_mc.spawn_height.overworld_max) -- spawn eggs diff --git a/mods/ENTITIES/mobs_mc/skeleton_wither.lua b/mods/ENTITIES/mobs_mc/skeleton_wither.lua index d9de90d84b..da472d6057 100644 --- a/mods/ENTITIES/mobs_mc/skeleton_wither.lua +++ b/mods/ENTITIES/mobs_mc/skeleton_wither.lua @@ -94,7 +94,20 @@ mobs:register_mob("mobs_mc:witherskeleton", { }) --spawn -mobs:spawn_specific("mobs_mc:witherskeleton", "nether", "ground", 0, 7, 30, 5000, 5, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) +mobs:spawn_specific( +"mobs_mc:witherskeleton", +"nether", +"ground", +{ +"Nether" +}, +0, +7, +30, +5000, +5, +mobs_mc.spawn_height.nether_min, +mobs_mc.spawn_height.nether_max) -- spawn eggs -mobs:register_egg("mobs_mc:witherskeleton", S("Wither Skeleton"), "mobs_mc_spawn_icon_witherskeleton.png", 0) +mobs:register_egg("mobs_mc:witherskeleton", S("Wither Skeleton"), "mobs_mc_spawn_icon_witherskeleton.png", 0) \ No newline at end of file diff --git a/mods/ENTITIES/mobs_mc/slime+magma_cube.lua b/mods/ENTITIES/mobs_mc/slime+magma_cube.lua index 2f9e8c8a90..6c8000a50d 100644 --- a/mods/ENTITIES/mobs_mc/slime+magma_cube.lua +++ b/mods/ENTITIES/mobs_mc/slime+magma_cube.lua @@ -157,9 +157,137 @@ mobs:register_mob("mobs_mc:slime_tiny", slime_tiny) local smin = mobs_mc.spawn_height.overworld_min local smax = mobs_mc.spawn_height.water - 23 -mobs:spawn_specific("mobs_mc:slime_tiny", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 12000, 4, smin, smax) -mobs:spawn_specific("mobs_mc:slime_small", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 8500, 4, smin, smax) -mobs:spawn_specific("mobs_mc:slime_big", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 10000, 4, smin, smax) +mobs:spawn_specific( +"mobs_mc:slime_tiny", +"overworld", +"ground", +{ +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +minetest.LIGHT_MAX+1, +30, +12000, +4, +smin, +smax) + +mobs:spawn_specific( +"mobs_mc:slime_small", +"overworld", +"ground", +{ +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +minetest.LIGHT_MAX+1, +30, +8500, +4, +smin, +smax) + +mobs:spawn_specific( +"mobs_mc:slime_big", +"overworld", +"ground", +{ +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +minetest.LIGHT_MAX+1, +30, +10000, +4, +smin, +smax) -- Magma cube local magma_cube_big = { @@ -272,9 +400,51 @@ mobs:register_mob("mobs_mc:magma_cube_tiny", magma_cube_tiny) local mmin = mobs_mc.spawn_height.nether_min local mmax = mobs_mc.spawn_height.nether_max -mobs:spawn_specific("mobs_mc:magma_cube_tiny", "nether", "ground", 0, minetest.LIGHT_MAX+1, 30, 15000, 4, mmin, mmax) -mobs:spawn_specific("mobs_mc:magma_cube_small", "nether", "ground", 0, minetest.LIGHT_MAX+1, 30, 15500, 4, mmin, mmax) -mobs:spawn_specific("mobs_mc:magma_cube_big", "nether", "ground", 0, minetest.LIGHT_MAX+1, 30, 16000, 4, mmin, mmax) +mobs:spawn_specific( +"mobs_mc:magma_cube_tiny", +"nether", +"ground", +{ +"Nether" +}, +0, +minetest.LIGHT_MAX+1, +30, +15000, +4, +mmin, +mmax) + + +mobs:spawn_specific( +"mobs_mc:magma_cube_small", +"nether", +"ground", +{ +"Nether" +}, +0, +minetest.LIGHT_MAX+1, +30, +15500, +4, +mmin, +mmax) + +mobs:spawn_specific( +"mobs_mc:magma_cube_big", +"nether", +"ground", +{ +"Nether" +}, +0, +minetest.LIGHT_MAX+1, +30, +16000, +4, +mmin, +mmax) --mobs:spawn_specific("mobs_mc:magma_cube_tiny", mobs_mc.spawn.nether_fortress, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 11000, 4, mmin, mmax) --mobs:spawn_specific("mobs_mc:magma_cube_small", mobs_mc.spawn.nether_fortress, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 11100, 4, mmin, mmax) diff --git a/mods/ENTITIES/mobs_mc/spider.lua b/mods/ENTITIES/mobs_mc/spider.lua index 1361e6a3ae..bb5e29eb1f 100644 --- a/mods/ENTITIES/mobs_mc/spider.lua +++ b/mods/ENTITIES/mobs_mc/spider.lua @@ -87,7 +87,158 @@ cave_spider.sounds.base_pitch = 1.25 mobs:register_mob("mobs_mc:cave_spider", cave_spider) -mobs:spawn_specific("mobs_mc:spider", "overworld", "ground", 0, 7, 30, 17000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:spider", +"overworld", +"ground", +{ +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +7, +30, +17000, +2, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:spider", S("Spider"), "mobs_mc_spawn_icon_spider.png", 0) diff --git a/mods/ENTITIES/mobs_mc/squid.lua b/mods/ENTITIES/mobs_mc/squid.lua index 2dbb7c557d..cf794ea5bf 100644 --- a/mods/ENTITIES/mobs_mc/squid.lua +++ b/mods/ENTITIES/mobs_mc/squid.lua @@ -62,7 +62,158 @@ mobs:register_mob("mobs_mc:squid", { local water = mobs_mc.spawn_height.water --name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height -mobs:spawn_specific("mobs_mc:squid", "overworld", "water", 0, minetest.LIGHT_MAX+1, 30, 5500, 3, water-16, water) +mobs:spawn_specific( +"mobs_mc:squid", +"overworld", +"water", +{ +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +minetest.LIGHT_MAX+1, +30, +5500, +3, +water-16, +water+1) -- spawn eggs mobs:register_egg("mobs_mc:squid", S("Squid"), "mobs_mc_spawn_icon_squid.png", 0) diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index 0b53d8015f..d251ba8239 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -1074,7 +1074,35 @@ mobs:register_mob("mobs_mc:villager", { -mobs:spawn_specific("mobs_mc:villager", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 20, 4, mobs_mc.spawn_height.water+1, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:villager", +"overworld", +"ground", +{ +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"ColdTaiga", +"SunflowerPlains", +"RoofedForest", +"MesaPlateauFM_grasstop", +"ExtremeHillsM", +"BirchForestM", +}, +0, +minetest.LIGHT_MAX+1, +30, +20, +4, +mobs_mc.spawn_height.water+1, +mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:villager", S("Villager"), "mobs_mc_spawn_icon_villager.png", 0) diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index 953c2df729..b1c077d465 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -232,6 +232,34 @@ end mobs:register_mob("mobs_mc:dog", dog) -- Spawn -mobs:spawn_specific("mobs_mc:wolf", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 9000, 7, mobs_mc.spawn_height.water+3, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:wolf", +"overworld", +"ground", +{ +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"ColdTaiga", +"SunflowerPlains", +"RoofedForest", +"MesaPlateauFM_grasstop", +"ExtremeHillsM", +"BirchForestM", +}, +0, +minetest.LIGHT_MAX+1, +30, +9000, +7, +mobs_mc.spawn_height.water+3, +mobs_mc.spawn_height.overworld_max) mobs:register_egg("mobs_mc:wolf", S("Wolf"), "mobs_mc_spawn_icon_wolf.png", 0) diff --git a/mods/ENTITIES/mobs_mc/zombie.lua b/mods/ENTITIES/mobs_mc/zombie.lua index 64f99d34dd..fed83f233a 100644 --- a/mods/ENTITIES/mobs_mc/zombie.lua +++ b/mods/ENTITIES/mobs_mc/zombie.lua @@ -135,11 +135,227 @@ mobs:register_mob("mobs_mc:baby_husk", baby_husk) -- Spawning -mobs:spawn_specific("mobs_mc:zombie", "overworld", "ground", 0, 7, 30, 6000, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:zombie", +"overworld", +"ground", +{ +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +}, +0, +7, +30, +6000, +4, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) -- Baby zombie is 20 times less likely than regular zombies -mobs:spawn_specific("mobs_mc:baby_zombie", "overworld", "ground", 0, 7, 30, 60000, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -mobs:spawn_specific("mobs_mc:husk", "overworld", "ground", 0, 7, 30, 6500, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -mobs:spawn_specific("mobs_mc:baby_husk", "overworld", "ground", 0, 7, 30, 65000, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:baby_zombie", +"overworld", +"ground", +{ +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +}, +0, +7, +30, +60000, +4, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) + + +mobs:spawn_specific( +"mobs_mc:husk", +"overworld", +"ground", +{ +"Desert", +"SavannaM", +"Savanna", +"Savanna_beach", +}, +0, +7, +30, +6500, +4, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:baby_husk", +"overworld", +"ground", +{ +"Desert", +"SavannaM", +"Savanna", +"Savanna_beach", +}, +0, +7, +30, +65000, +4, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) -- Spawn eggs mobs:register_egg("mobs_mc:husk", S("Husk"), "mobs_mc_spawn_icon_husk.png", 0) diff --git a/mods/ENTITIES/mobs_mc/zombiepig.lua b/mods/ENTITIES/mobs_mc/zombiepig.lua index e996425c8b..ebd8ce4856 100644 --- a/mods/ENTITIES/mobs_mc/zombiepig.lua +++ b/mods/ENTITIES/mobs_mc/zombiepig.lua @@ -111,9 +111,35 @@ baby_pigman.child = 1 mobs:register_mob("mobs_mc:baby_pigman", baby_pigman) -- Regular spawning in the Nether -mobs:spawn_specific("mobs_mc:pigman", "nether", "ground", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) +mobs:spawn_specific( +"mobs_mc:pigman", +"nether", +"ground", +{ +"Nether" +}, +0, +minetest.LIGHT_MAX+1, +30, +6000, +3, +mobs_mc.spawn_height.nether_min, +mobs_mc.spawn_height.nether_max) -- Baby zombie is 20 times less likely than regular zombies -mobs:spawn_specific("mobs_mc:baby_pigman", "nether", "ground", 0, minetest.LIGHT_MAX+1, 30, 100000, 4, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) +mobs:spawn_specific( +"mobs_mc:baby_pigman", +"nether", +"ground", +{ +"Nether" +}, +0, +minetest.LIGHT_MAX+1, +30, +100000, +4, +mobs_mc.spawn_height.nether_min, +mobs_mc.spawn_height.nether_max) -- Spawning in Nether portals in the Overworld --mobs:spawn_specific("mobs_mc:pigman", mobs_mc.spawn.nether_portal, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 500, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) From aacb8fc7b95013e42c832927088708b8c9889201 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 08:09:43 -0400 Subject: [PATCH 06/12] Add in extra_mobs information --- mods/ENTITIES/extra_mobs/cod.lua | 153 ++++++++++++++++++++- mods/ENTITIES/extra_mobs/dolphin.lua | 153 ++++++++++++++++++++- mods/ENTITIES/extra_mobs/fox.lua | 50 ++++++- mods/ENTITIES/extra_mobs/glow_squid.lua | 153 ++++++++++++++++++++- mods/ENTITIES/extra_mobs/hoglin+zoglin.lua | 15 +- mods/ENTITIES/extra_mobs/piglin.lua | 31 ++++- mods/ENTITIES/extra_mobs/salmon.lua | 153 ++++++++++++++++++++- mods/ENTITIES/extra_mobs/strider.lua | 15 +- mods/ENTITIES/mcl_mobs/spawning.lua | 24 +++- mods/ENTITIES/mobs_mc/rabbit.lua | 30 +++- mods/ENTITIES/mobs_mc/villager_zombie.lua | 95 ++++++++++++- 11 files changed, 851 insertions(+), 21 deletions(-) diff --git a/mods/ENTITIES/extra_mobs/cod.lua b/mods/ENTITIES/extra_mobs/cod.lua index 1a77a0ab8d..32b9639807 100644 --- a/mods/ENTITIES/extra_mobs/cod.lua +++ b/mods/ENTITIES/extra_mobs/cod.lua @@ -102,7 +102,158 @@ mobs:register_mob("extra_mobs:cod", cod) --spawning TODO: in schools local water = mobs_mc.spawn_height.water -mobs:spawn_specific("extra_mobs:cod", "overworld", "water", 0, minetest.LIGHT_MAX+1, 30, 4000, 3, water-16, water) +mobs:spawn_specific( +"extra_mobs:cod", +"overworld", +"water", +{ +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +minetest.LIGHT_MAX+1, +30, +4000, +3, +water-16, +water) --spawn egg mobs:register_egg("extra_mobs:cod", S("Cod"), "extra_mobs_spawn_icon_cod.png", 0) diff --git a/mods/ENTITIES/extra_mobs/dolphin.lua b/mods/ENTITIES/extra_mobs/dolphin.lua index 7701041bba..b16e13bf7c 100644 --- a/mods/ENTITIES/extra_mobs/dolphin.lua +++ b/mods/ENTITIES/extra_mobs/dolphin.lua @@ -91,7 +91,158 @@ mobs:register_mob("extra_mobs:dolphin", dolphin) --spawning TODO: in schools local water = mobs_mc.spawn_height.water -mobs:spawn_specific("extra_mobs:dolphin", "overworld", "water", 0, minetest.LIGHT_MAX+1, 30, 4000, 3, water-16, water) +mobs:spawn_specific( +"extra_mobs:dolphin", +"overworld", +"water", +{ +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +minetest.LIGHT_MAX+1, +30, +4000, +3, +water-16, +water) --spawn egg mobs:register_egg("extra_mobs:dolphin", S("dolphin"), "extra_mobs_spawn_icon_dolphin.png", 0) diff --git a/mods/ENTITIES/extra_mobs/fox.lua b/mods/ENTITIES/extra_mobs/fox.lua index eb17414904..0f17714720 100644 --- a/mods/ENTITIES/extra_mobs/fox.lua +++ b/mods/ENTITIES/extra_mobs/fox.lua @@ -123,10 +123,54 @@ local fox = { mobs:register_mob("extra_mobs:fox", fox) -- spawning -mobs:spawn_specific("extra_mobs:fox", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, 0, 500) +mobs:spawn_specific( +"extra_mobs:fox", +"overworld", +"ground", +{ +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"ColdTaiga", +"SunflowerPlains", +"RoofedForest", +"MesaPlateauFM_grasstop", +"ExtremeHillsM", +"BirchForestM", +}, +0, +minetest.LIGHT_MAX+1, +30, +6000, +3, +0, +500) -mobs:spawn_specific("extra_mobs:fox", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, 0, 500) -mobs:spawn_specific("extra_mobs:artic_fox", "overworld", "mcl_core:snow", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, 0, 500) +--mobs:spawn_specific("extra_mobs:fox", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, 0, 500) +mobs:spawn_specific( +"extra_mobs:artic_fox", +"overworld", +"ground", +{ +"ColdTaiga", +"IcePlainsSpikes", +"IcePlains", +"ExtremeHills+_snowtop", +}, +0, +minetest.LIGHT_MAX+1, +30, +6000, +3, +0, +500) -- spawn eggs mobs:register_egg("extra_mobs:fox", S("Fox"), "extra_mobs_spawn_icon_fox.png", 0) diff --git a/mods/ENTITIES/extra_mobs/glow_squid.lua b/mods/ENTITIES/extra_mobs/glow_squid.lua index 55f97675df..b66a2a0f33 100644 --- a/mods/ENTITIES/extra_mobs/glow_squid.lua +++ b/mods/ENTITIES/extra_mobs/glow_squid.lua @@ -75,7 +75,158 @@ mobs:register_mob("extra_mobs:glow_squid",{ -- spawning local water = mobs_mc.spawn_height.water -mobs:spawn_specific("extra_mobs:glow_squid", "overworld", "water", 0, minetest.LIGHT_MAX+1, 30, 10000, 3, water-16, water) +mobs:spawn_specific( +"extra_mobs:glow_squid", +"overworld", +"water", +{ +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +minetest.LIGHT_MAX+1, +30, +10000, +3, +water-16, +water) -- spawn egg mobs:register_egg("extra_mobs:glow_squid", S("Glow Squid"), "extra_mobs_spawn_icon_glow_squid.png", 0) diff --git a/mods/ENTITIES/extra_mobs/hoglin+zoglin.lua b/mods/ENTITIES/extra_mobs/hoglin+zoglin.lua index efd7ff08a9..e83e88a960 100644 --- a/mods/ENTITIES/extra_mobs/hoglin+zoglin.lua +++ b/mods/ENTITIES/extra_mobs/hoglin+zoglin.lua @@ -115,7 +115,20 @@ baby_hoglin.child = 1 mobs:register_mob("extra_mobs:baby_hoglin", baby_hoglin)]] -- Regular spawning in the Nether -mobs:spawn_specific("extra_mobs:hoglin", "nether", "ground", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, mcl_vars.mg_nether_min, mcl_vars.mg_nether_max) +mobs:spawn_specific( +"extra_mobs:hoglin", +"nether", +"ground", +{ +"Nether" +}, +0, +minetest.LIGHT_MAX+1, +30, +6000, +3, +mcl_vars.mg_nether_min, +mcl_vars.mg_nether_max) -- spawn eggs mobs:register_egg("extra_mobs:hoglin", S("Hoglin"), "extra_mobs_spawn_icon_hoglin.png", 0) diff --git a/mods/ENTITIES/extra_mobs/piglin.lua b/mods/ENTITIES/extra_mobs/piglin.lua index 5578ca9052..5975649bae 100644 --- a/mods/ENTITIES/extra_mobs/piglin.lua +++ b/mods/ENTITIES/extra_mobs/piglin.lua @@ -264,8 +264,35 @@ mobs:register_mob("extra_mobs:piglin_brute", piglin_brute) -- Regular spawning in the Nether -mobs:spawn_specific("extra_mobs:piglin", "nether", "ground", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, mcl_vars.mg_nether_min, mcl_vars.mg_nether_max) -mobs:spawn_specific("extra_mobs:sword_piglin", "nether", "ground", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, mcl_vars.mg_nether_min, mcl_vars.mg_nether_max) +mobs:spawn_specific( +"extra_mobs:piglin", +"nether", +"ground", +{ +"Nether" +}, +0, +minetest.LIGHT_MAX+1, +30, +6000, +3, +mcl_vars.mg_nether_min, +mcl_vars.mg_nether_max) + +mobs:spawn_specific( +"extra_mobs:sword_piglin", +"nether", +"ground", +{ +"Nether" +}, +0, +minetest.LIGHT_MAX+1, +30, +6000, +3, +mcl_vars.mg_nether_min, +mcl_vars.mg_nether_max) -- spawn eggs mobs:register_egg("extra_mobs:piglin", S("piglin"), "extra_mobs_spawn_icon_piglin.png", 0) mobs:register_egg("extra_mobs:piglin_brute", S("piglin Brute"), "extra_mobs_spawn_icon_piglin.png", 0) diff --git a/mods/ENTITIES/extra_mobs/salmon.lua b/mods/ENTITIES/extra_mobs/salmon.lua index 35e5547891..bb03a7e512 100644 --- a/mods/ENTITIES/extra_mobs/salmon.lua +++ b/mods/ENTITIES/extra_mobs/salmon.lua @@ -61,7 +61,158 @@ mobs:register_mob("extra_mobs:salmon", salmon) --spawning TODO: in schools local water = mobs_mc.spawn_height.water -mobs:spawn_specific("extra_mobs:salmon", "overworld", "water", 0, minetest.LIGHT_MAX+1, 30, 4000, 3, water-16, water) +mobs:spawn_specific( +"extra_mobs:salmon", +"overworld", +"water", +{ +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"ExtremeHillsM_deep_ocean", +"Savanna_deep_ocean", +"SunflowerPlains_ocean", +"Swampland_deep_ocean", +"Swampland_ocean", +"MegaSpruceTaiga_deep_ocean", +"ExtremeHillsM_ocean", +"JungleEdgeM_deep_ocean", +"SunflowerPlains_deep_ocean", +"BirchForest_deep_ocean", +"IcePlainsSpikes_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_deep_ocean", +"JungleEdge_deep_ocean", +"SavannaM_deep_ocean", +"Desert_deep_ocean", +"Mesa_deep_ocean", +"ColdTaiga_deep_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"Forest_deep_ocean", +"JungleM_deep_ocean", +"FlowerForest_deep_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"IcePlainsSpikes_deep_ocean", +"ColdTaiga_ocean", +"SavannaM_ocean", +"MesaPlateauF_deep_ocean", +"MesaBryce_deep_ocean", +"ExtremeHills+_deep_ocean", +"ExtremeHills_ocean", +"MushroomIsland_deep_ocean", +"Forest_ocean", +"MegaTaiga_deep_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"RoofedForest_deep_ocean", +"IcePlains_ocean", +"FlowerForest_ocean", +"ExtremeHills_deep_ocean", +"MesaPlateauFM_deep_ocean", +"Desert_ocean", +"Taiga_ocean", +"BirchForestM_deep_ocean", +"Taiga_deep_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +}, +0, +minetest.LIGHT_MAX+1, +30, +4000, +3, +water-16, +water) --spawn egg mobs:register_egg("extra_mobs:salmon", S("Salmon"), "extra_mobs_spawn_icon_salmon.png", 0) diff --git a/mods/ENTITIES/extra_mobs/strider.lua b/mods/ENTITIES/extra_mobs/strider.lua index 17c994946e..164bae2f8d 100644 --- a/mods/ENTITIES/extra_mobs/strider.lua +++ b/mods/ENTITIES/extra_mobs/strider.lua @@ -217,7 +217,20 @@ baby_strider.child = 1 mobs:register_mob("extra_mobs:baby_strider", baby_strider) -- Regular spawning in the Nether -mobs:spawn_specific("extra_mobs:strider", "nether", "lava", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, mcl_vars.mg_nether_min, mcl_vars.mg_nether_max) +mobs:spawn_specific( +"extra_mobs:strider", +"nether", +"lava", +{ +"Nether" +}, +0, +minetest.LIGHT_MAX+1, +30, +6000, +3, +mcl_vars.mg_nether_min, +mcl_vars.mg_nether_max) -- spawn eggs mobs:register_egg("extra_mobs:strider", S("Strider"), "extra_mobs_spawn_icon_strider.png", 0) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 515dbaf3d0..f7220f1e0e 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -242,15 +242,11 @@ WARNING: BIOME INTEGRATION NEEDED -> How to get biome through lua?? ]]-- --this is where all of the spawning information is kept -local spawn_dictionary = { - ["overworld"] = {}, - ["nether"] = {}, - ["end"] = {} -} +local spawn_dictionary = {} function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_light, max_light, interval, chance, aoc, min_height, max_height, day_toggle, on_spawn) - print(dump(biomes)) + --print(dump(biomes)) -- Do mobs spawn at all? if not mobs_spawn then @@ -438,6 +434,20 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh --load information into the spawn dictionary + + --allow for new dimensions to be auto added + --this will take extra time, a whole few nanoseconds + --but will allow modularity + if not spawn_dictionary[dimension] then + spawn_dictionary[dimension] = {} + end + + print("----") + print(name) + for _,added_biome in pairs(biomes) do + print(added_biome) + end + --[[ local key = #spawn_dictionary[dimension] + 1 spawn_dictionary[dimension][key] = {} @@ -452,7 +462,7 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh spawn_dictionary[dimension][key]["max_height"] = max_height spawn_dictionary[dimension][key]["day_toggle"] = day_toggle spawn_dictionary[dimension][key]["on_spawn"] = spawn_abm_action - + ]]-- --[[ minetest.register_abm({ label = name .. " spawning", diff --git a/mods/ENTITIES/mobs_mc/rabbit.lua b/mods/ENTITIES/mobs_mc/rabbit.lua index f09a70584a..74bdffcd80 100644 --- a/mods/ENTITIES/mobs_mc/rabbit.lua +++ b/mods/ENTITIES/mobs_mc/rabbit.lua @@ -109,7 +109,35 @@ mobs:register_mob("mobs_mc:killer_bunny", killer_bunny) -- Mob spawning rules. -- Different skins depending on spawn location <- we'll get to this when the spawning algorithm is fleshed out -mobs:spawn_specific("mobs_mc:rabbit", "overworld", "ground", 9, minetest.LIGHT_MAX+1, 30, 15000, 8, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:rabbit", +"overworld", +"ground", +{ +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"ColdTaiga", +"SunflowerPlains", +"RoofedForest", +"MesaPlateauFM_grasstop", +"ExtremeHillsM", +"BirchForestM", +}, +9, +minetest.LIGHT_MAX+1, +30, +15000, +8, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) --[[ local spawn = { diff --git a/mods/ENTITIES/mobs_mc/villager_zombie.lua b/mods/ENTITIES/mobs_mc/villager_zombie.lua index bcede2183c..325cf5955b 100644 --- a/mods/ENTITIES/mobs_mc/villager_zombie.lua +++ b/mods/ENTITIES/mobs_mc/villager_zombie.lua @@ -146,8 +146,99 @@ mobs:register_mob("mobs_mc:villager_zombie", { harmed_by_heal = true, }) -mobs:spawn_specific("mobs_mc:villager_zombie", "overworld", "ground", 0, 7, 30, 4090, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -mobs:spawn_specific("mobs_mc:villager_zombie", "overworld", "ground", 0, 7, 30, 60000, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific( +"mobs_mc:villager_zombie", +"overworld", +"ground", +{ +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"ColdTaiga_underground", +"IcePlains_underground", +"IcePlainsSpikes_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +"Mesa", +"FlowerForest", +"Swampland", +"Taiga", +"ExtremeHills", +"Jungle", +"Savanna", +"BirchForest", +"MegaSpruceTaiga", +"MegaTaiga", +"ExtremeHills+", +"Forest", +"Plains", +"Desert", +"ColdTaiga", +"MushroomIsland", +"IcePlainsSpikes", +"SunflowerPlains", +"IcePlains", +"RoofedForest", +"ExtremeHills+_snowtop", +"MesaPlateauFM_grasstop", +"JungleEdgeM", +"ExtremeHillsM", +"JungleM", +"BirchForestM", +"MesaPlateauF", +"MesaPlateauFM", +"MesaPlateauF_grasstop", +"MesaBryce", +"JungleEdge", +"SavannaM", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"ColdTaiga_beach_water", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"ColdTaiga_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"MesaPlateauFM_sandlevel", +"MesaPlateauF_sandlevel", +"MesaBryce_sandlevel", +"Mesa_sandlevel", +}, +0, +7, +30, +4090, +4, +mobs_mc.spawn_height.overworld_min, +mobs_mc.spawn_height.overworld_max) +--mobs:spawn_specific("mobs_mc:villager_zombie", "overworld", "ground", 0, 7, 30, 60000, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:villager_zombie", S("Zombie Villager"), "mobs_mc_spawn_icon_zombie_villager.png", 0) From 5ca30fa8eec24a1f9bee879bb49d3dfce82484fb Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 08:12:43 -0400 Subject: [PATCH 07/12] Combine air and ground type spawning into ground --- mods/ENTITIES/mcl_mobs/spawning.lua | 15 +++++++++++---- mods/ENTITIES/mobs_mc/bat.lua | 2 +- mods/ENTITIES/mobs_mc/ghast.lua | 2 +- mods/ENTITIES/mobs_mc/parrot.lua | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index f7220f1e0e..829005a8cd 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -227,7 +227,6 @@ dimension: "end" types of spawning: -"air" "water" "ground" "lava" @@ -438,15 +437,23 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh --allow for new dimensions to be auto added --this will take extra time, a whole few nanoseconds --but will allow modularity + + + if type_of_spawning == "air" then + print("---------------------------- HERE") + print(name) + print("---------------------------- sdfkhjsadfhjklsfsehjkfsdhjk") + end + if not spawn_dictionary[dimension] then spawn_dictionary[dimension] = {} end - print("----") - print(name) for _,added_biome in pairs(biomes) do - print(added_biome) + --print(added_biome) end + + --[[ local key = #spawn_dictionary[dimension] + 1 diff --git a/mods/ENTITIES/mobs_mc/bat.lua b/mods/ENTITIES/mobs_mc/bat.lua index a525f55830..a0aa8e4f57 100644 --- a/mods/ENTITIES/mobs_mc/bat.lua +++ b/mods/ENTITIES/mobs_mc/bat.lua @@ -66,7 +66,7 @@ end -- Spawn on solid blocks at or below Sea level and the selected light level mobs:spawn_specific( "mobs_mc:bat", -"overworld", +"ground", "air", { "FlowerForest_underground", diff --git a/mods/ENTITIES/mobs_mc/ghast.lua b/mods/ENTITIES/mobs_mc/ghast.lua index 9c3e0cee1a..83a10bfc40 100644 --- a/mods/ENTITIES/mobs_mc/ghast.lua +++ b/mods/ENTITIES/mobs_mc/ghast.lua @@ -78,7 +78,7 @@ mobs:register_mob("mobs_mc:ghast", { mobs:spawn_specific( "mobs_mc:ghast", "nether", -"air", +"ground", { "Nether" }, diff --git a/mods/ENTITIES/mobs_mc/parrot.lua b/mods/ENTITIES/mobs_mc/parrot.lua index 60329211e1..5efcb191b4 100644 --- a/mods/ENTITIES/mobs_mc/parrot.lua +++ b/mods/ENTITIES/mobs_mc/parrot.lua @@ -94,7 +94,7 @@ mobs:register_mob("mobs_mc:parrot", { mobs:spawn_specific( "mobs_mc:parrot", "overworld", -"air", +"ground", { "Jungle", "JungleEdgeM", From 47c59edb511fde5db934fca519b9d8aa1fc68838 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 08:13:46 -0400 Subject: [PATCH 08/12] Fix typo --- mods/ENTITIES/mobs_mc/bat.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/bat.lua b/mods/ENTITIES/mobs_mc/bat.lua index a0aa8e4f57..677b96aad3 100644 --- a/mods/ENTITIES/mobs_mc/bat.lua +++ b/mods/ENTITIES/mobs_mc/bat.lua @@ -66,8 +66,8 @@ end -- Spawn on solid blocks at or below Sea level and the selected light level mobs:spawn_specific( "mobs_mc:bat", +"overworld", "ground", -"air", { "FlowerForest_underground", "JungleEdge_underground", From adab48ff0c95c2fad11e4d58824d635ae6945875 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 08:29:16 -0400 Subject: [PATCH 09/12] Readjust mobs internal settings to not cause insane memory usage --- mods/ENTITIES/mcl_mobs/spawning.lua | 30 +++++++++++++++++++------- mods/ENTITIES/mobs_mc/0_gameconfig.lua | 10 ++++----- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 829005a8cd..d4d6880856 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -438,21 +438,35 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh --this will take extra time, a whole few nanoseconds --but will allow modularity - - if type_of_spawning == "air" then - print("---------------------------- HERE") - print(name) - print("---------------------------- sdfkhjsadfhjklsfsehjkfsdhjk") - end - + --build dimensions modularly if not spawn_dictionary[dimension] then spawn_dictionary[dimension] = {} end + --build biome list modularly for _,added_biome in pairs(biomes) do - --print(added_biome) + if not spawn_dictionary[dimension][added_biome] then + spawn_dictionary[dimension][added_biome] = {} + end + + --build type of spawning per biome modularly + if not spawn_dictionary[dimension][added_biome][type_of_spawning] then + spawn_dictionary[dimension][added_biome][type_of_spawning] = {} + end + + --build light levels to spawn mob + for i = min_light,max_light do + if not spawn_dictionary[dimension][added_biome][type_of_spawning][i] then + spawn_dictionary[dimension][added_biome][type_of_spawning][i] = {} + end + + for y = min_height, max_height do + --print(y) + end + end end + --[[ local key = #spawn_dictionary[dimension] + 1 diff --git a/mods/ENTITIES/mobs_mc/0_gameconfig.lua b/mods/ENTITIES/mobs_mc/0_gameconfig.lua index 74c92d4153..b979c7353a 100644 --- a/mods/ENTITIES/mobs_mc/0_gameconfig.lua +++ b/mods/ENTITIES/mobs_mc/0_gameconfig.lua @@ -290,13 +290,13 @@ mobs_mc.spawn = { mobs_mc.spawn_height = { water = tonumber(minetest.settings:get("water_level")) or 0, -- Water level in the Overworld - -- Overworld boundaries (inclusive) - overworld_min = -2999, - overworld_max = 31000, + -- Overworld boundaries (inclusive) --had to make this reasonable otherwise mob spawning would go nuts using data + overworld_min = -64,-- -2999, + overworld_max = 256,-- 31000, -- Nether boundaries (inclusive) - nether_min = -3369, - nether_max = -3000, + nether_min = -29067,-- -3369, + nether_max = -28939,-- -3000, -- End boundaries (inclusive) end_min = -6200, From bb078b0c4c48ac6932d2953561ac03bea3bde51a Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 08:33:50 -0400 Subject: [PATCH 10/12] Fix silverfish typo --- mods/ENTITIES/mcl_mobs/spawning.lua | 2 +- mods/ENTITIES/mobs_mc/silverfish.lua | 21 ++++++--------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index d4d6880856..01e2eb9e53 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -461,7 +461,7 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh end for y = min_height, max_height do - --print(y) + print(y) end end end diff --git a/mods/ENTITIES/mobs_mc/silverfish.lua b/mods/ENTITIES/mobs_mc/silverfish.lua index 9a6f3fc98d..9befe19054 100644 --- a/mods/ENTITIES/mobs_mc/silverfish.lua +++ b/mods/ENTITIES/mobs_mc/silverfish.lua @@ -24,22 +24,13 @@ mobs:register_mob("mobs_mc:silverfish", { pathfinding = 1, visual_size = {x=3, y=3}, sounds = {"FlowerForest", - "Swampland", - "Taiga", - "ExtremeHills", - "BirchForest", - "MegaSpruceTaiga", - "MegaTaiga", - "ExtremeHills+", - "Forest", - "Plains", - "ColdTaiga", - "SunflowerPlains", - "RoofedForest", - "MesaPlateauFM_grasstop", - "ExtremeHillsM", - "BirchForestM", + sounds = { + random = "mobs_mc_silverfish_idle", + death = "mobs_mc_silverfish_death", + damage = "mobs_mc_silverfish_hurt", + distance = 16, }, + makes_footstep_sound = false, walk_velocity = 0.6, run_velocity = 2, jump = true, From 518252679f642d00057889b462eb8c87b0992de7 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 08:42:57 -0400 Subject: [PATCH 11/12] Fix a lot of things --- mods/ENTITIES/extra_mobs/cod.lua | 4 +++- mods/ENTITIES/extra_mobs/depends.txt | 1 + mods/ENTITIES/extra_mobs/dolphin.lua | 2 +- mods/ENTITIES/extra_mobs/fox.lua | 8 ++++---- mods/ENTITIES/extra_mobs/glow_squid.lua | 2 +- mods/ENTITIES/extra_mobs/hoglin+zoglin.lua | 4 ++-- mods/ENTITIES/extra_mobs/piglin.lua | 8 ++++---- mods/ENTITIES/extra_mobs/salmon.lua | 2 +- mods/ENTITIES/extra_mobs/strider.lua | 4 ++-- mods/ENTITIES/mcl_mobs/spawning.lua | 4 +++- mods/ENTITIES/mobs_mc/silverfish.lua | 1 - 11 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 mods/ENTITIES/extra_mobs/depends.txt diff --git a/mods/ENTITIES/extra_mobs/cod.lua b/mods/ENTITIES/extra_mobs/cod.lua index 32b9639807..3d3289734b 100644 --- a/mods/ENTITIES/extra_mobs/cod.lua +++ b/mods/ENTITIES/extra_mobs/cod.lua @@ -101,7 +101,9 @@ mobs:register_mob("extra_mobs:cod", cod) --spawning TODO: in schools -local water = mobs_mc.spawn_height.water + +local water = mobs_mc.spawn_height.water + 1 + mobs:spawn_specific( "extra_mobs:cod", "overworld", diff --git a/mods/ENTITIES/extra_mobs/depends.txt b/mods/ENTITIES/extra_mobs/depends.txt new file mode 100644 index 0000000000..db57bb24f8 --- /dev/null +++ b/mods/ENTITIES/extra_mobs/depends.txt @@ -0,0 +1 @@ +mobs_mc \ No newline at end of file diff --git a/mods/ENTITIES/extra_mobs/dolphin.lua b/mods/ENTITIES/extra_mobs/dolphin.lua index b16e13bf7c..467cf4017d 100644 --- a/mods/ENTITIES/extra_mobs/dolphin.lua +++ b/mods/ENTITIES/extra_mobs/dolphin.lua @@ -90,7 +90,7 @@ mobs:register_mob("extra_mobs:dolphin", dolphin) --spawning TODO: in schools -local water = mobs_mc.spawn_height.water +local water = mobs_mc.spawn_height.water + 1 mobs:spawn_specific( "extra_mobs:dolphin", "overworld", diff --git a/mods/ENTITIES/extra_mobs/fox.lua b/mods/ENTITIES/extra_mobs/fox.lua index 0f17714720..d42e6902ae 100644 --- a/mods/ENTITIES/extra_mobs/fox.lua +++ b/mods/ENTITIES/extra_mobs/fox.lua @@ -150,8 +150,8 @@ minetest.LIGHT_MAX+1, 30, 6000, 3, -0, -500) +mobs_mc.spawn_height.water, +mobs_mc.spawn_height.overworld_max) --mobs:spawn_specific("extra_mobs:fox", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, 0, 500) mobs:spawn_specific( @@ -169,8 +169,8 @@ minetest.LIGHT_MAX+1, 30, 6000, 3, -0, -500) +mobs_mc.spawn_height.water, +mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("extra_mobs:fox", S("Fox"), "extra_mobs_spawn_icon_fox.png", 0) diff --git a/mods/ENTITIES/extra_mobs/glow_squid.lua b/mods/ENTITIES/extra_mobs/glow_squid.lua index b66a2a0f33..6f9fc38c9c 100644 --- a/mods/ENTITIES/extra_mobs/glow_squid.lua +++ b/mods/ENTITIES/extra_mobs/glow_squid.lua @@ -74,7 +74,7 @@ mobs:register_mob("extra_mobs:glow_squid",{ -- spawning -local water = mobs_mc.spawn_height.water +local water = mobs_mc.spawn_height.water + 1 mobs:spawn_specific( "extra_mobs:glow_squid", "overworld", diff --git a/mods/ENTITIES/extra_mobs/hoglin+zoglin.lua b/mods/ENTITIES/extra_mobs/hoglin+zoglin.lua index e83e88a960..06708e5732 100644 --- a/mods/ENTITIES/extra_mobs/hoglin+zoglin.lua +++ b/mods/ENTITIES/extra_mobs/hoglin+zoglin.lua @@ -127,8 +127,8 @@ minetest.LIGHT_MAX+1, 30, 6000, 3, -mcl_vars.mg_nether_min, -mcl_vars.mg_nether_max) +mobs_mc.spawn_height.nether_min, +mobs_mc.spawn_height.nether_max) -- spawn eggs mobs:register_egg("extra_mobs:hoglin", S("Hoglin"), "extra_mobs_spawn_icon_hoglin.png", 0) diff --git a/mods/ENTITIES/extra_mobs/piglin.lua b/mods/ENTITIES/extra_mobs/piglin.lua index 5975649bae..bb111c7d75 100644 --- a/mods/ENTITIES/extra_mobs/piglin.lua +++ b/mods/ENTITIES/extra_mobs/piglin.lua @@ -276,8 +276,8 @@ minetest.LIGHT_MAX+1, 30, 6000, 3, -mcl_vars.mg_nether_min, -mcl_vars.mg_nether_max) +mobs_mc.spawn_height.nether_min, +mobs_mc.spawn_height.nether_max) mobs:spawn_specific( "extra_mobs:sword_piglin", @@ -291,8 +291,8 @@ minetest.LIGHT_MAX+1, 30, 6000, 3, -mcl_vars.mg_nether_min, -mcl_vars.mg_nether_max) +mobs_mc.spawn_height.nether_min, +mobs_mc.spawn_height.nether_max) -- spawn eggs mobs:register_egg("extra_mobs:piglin", S("piglin"), "extra_mobs_spawn_icon_piglin.png", 0) mobs:register_egg("extra_mobs:piglin_brute", S("piglin Brute"), "extra_mobs_spawn_icon_piglin.png", 0) diff --git a/mods/ENTITIES/extra_mobs/salmon.lua b/mods/ENTITIES/extra_mobs/salmon.lua index bb03a7e512..c8d6e1cfd5 100644 --- a/mods/ENTITIES/extra_mobs/salmon.lua +++ b/mods/ENTITIES/extra_mobs/salmon.lua @@ -60,7 +60,7 @@ mobs:register_mob("extra_mobs:salmon", salmon) --spawning TODO: in schools -local water = mobs_mc.spawn_height.water +local water = mobs_mc.spawn_height.water + 1 mobs:spawn_specific( "extra_mobs:salmon", "overworld", diff --git a/mods/ENTITIES/extra_mobs/strider.lua b/mods/ENTITIES/extra_mobs/strider.lua index 164bae2f8d..1847161565 100644 --- a/mods/ENTITIES/extra_mobs/strider.lua +++ b/mods/ENTITIES/extra_mobs/strider.lua @@ -229,8 +229,8 @@ minetest.LIGHT_MAX+1, 30, 6000, 3, -mcl_vars.mg_nether_min, -mcl_vars.mg_nether_max) +mobs_mc.spawn_height.nether_min, +mobs_mc.spawn_height.nether_max) -- spawn eggs mobs:register_egg("extra_mobs:strider", S("Strider"), "extra_mobs_spawn_icon_strider.png", 0) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 01e2eb9e53..0b386390b7 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -461,11 +461,13 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh end for y = min_height, max_height do - print(y) + --print(y) end end end + print("--") + print(min_height, max_height) --[[ diff --git a/mods/ENTITIES/mobs_mc/silverfish.lua b/mods/ENTITIES/mobs_mc/silverfish.lua index 9befe19054..433211503b 100644 --- a/mods/ENTITIES/mobs_mc/silverfish.lua +++ b/mods/ENTITIES/mobs_mc/silverfish.lua @@ -23,7 +23,6 @@ mobs:register_mob("mobs_mc:silverfish", { }, pathfinding = 1, visual_size = {x=3, y=3}, - sounds = {"FlowerForest", sounds = { random = "mobs_mc_silverfish_idle", death = "mobs_mc_silverfish_death", From 9d48549ec5901de887eb9fb2d75fd07f08edb39b Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 09:52:50 -0400 Subject: [PATCH 12/12] Complete prototype of biome generated mobs --- mods/ENTITIES/extra_mobs/cod.lua | 2 +- mods/ENTITIES/extra_mobs/fox.lua | 7 +- mods/ENTITIES/mcl_mobs/spawning.lua | 226 ++++++++++--------------- mods/ENTITIES/mobs_mc/0_gameconfig.lua | 4 +- 4 files changed, 101 insertions(+), 138 deletions(-) diff --git a/mods/ENTITIES/extra_mobs/cod.lua b/mods/ENTITIES/extra_mobs/cod.lua index 3d3289734b..69a9d1e777 100644 --- a/mods/ENTITIES/extra_mobs/cod.lua +++ b/mods/ENTITIES/extra_mobs/cod.lua @@ -89,7 +89,7 @@ local cod = { y = lp.y - s.y, z = lp.z - s.z } - if not object:is_player() and object:get_luaentity().name == "extra_mobs:cod" then + if object and not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "extra_mobs:cod" then self.state = "runaway" self.object:set_rotation({x=0,y=(atan(vec.z / vec.x) + 3 * pi / 2) - self.rotate,z=0}) end diff --git a/mods/ENTITIES/extra_mobs/fox.lua b/mods/ENTITIES/extra_mobs/fox.lua index d42e6902ae..7df04b5544 100644 --- a/mods/ENTITIES/extra_mobs/fox.lua +++ b/mods/ENTITIES/extra_mobs/fox.lua @@ -88,7 +88,7 @@ local fox = { end) end for _,object in pairs(minetest.get_objects_inside_radius(self.object:get_pos(), 8)) do - if not object:is_player() and object:get_luaentity().name == "extra_mobs:fox" and self.state ~= "attack" and math.random(1, 500) == 1 then + if object and not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "extra_mobs:fox" and self.state ~= "attack" and math.random(1, 500) == 1 then self.horny = true end local lp = object:get_pos() @@ -98,7 +98,7 @@ local fox = { y = lp.y - s.y, z = lp.z - s.z } - if object:is_player() and not object:get_player_control().sneak or not object:is_player() and object:get_luaentity().name == "mobs_mc:wolf" then + if object and object:is_player() and not object:get_player_control().sneak or not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "mobs_mc:wolf" then self.state = "runaway" self.object:set_rotation({x=0,y=(atan(vec.z / vec.x) + 3 * pi / 2) - self.rotate,z=0}) if self.reach > vector.distance(self.object:get_pos(), object:get_pos()) and self.timer > .9 then @@ -154,6 +154,7 @@ mobs_mc.spawn_height.water, mobs_mc.spawn_height.overworld_max) --mobs:spawn_specific("extra_mobs:fox", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, 0, 500) +--[[ mobs:spawn_specific( "extra_mobs:artic_fox", "overworld", @@ -171,6 +172,6 @@ minetest.LIGHT_MAX+1, 3, mobs_mc.spawn_height.water, mobs_mc.spawn_height.overworld_max) - +]]-- -- spawn eggs mobs:register_egg("extra_mobs:fox", S("Fox"), "extra_mobs_spawn_icon_fox.png", 0) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 0b386390b7..8665911942 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -1,29 +1,18 @@ +--lua locals +local get_node = minetest.get_node +local get_item_group = minetest.get_item_group +local get_node_light = minetest.get_node_light +local find_nodes_in_area_under_air = minetest.find_nodes_in_area_under_air +local new_vector = vector.new +local math_random = math.random +local get_biome_name = minetest.get_biome_name --[[ THIS IS THE BIG LIST OF ALL BIOMES - used for programming/updating mobs underground: "FlowerForest_underground", -"JungleEdge_underground", -"StoneBeach_underground", -"MesaBryce_underground", -"Mesa_underground", -"RoofedForest_underground", -"Jungle_underground", -"Swampland_underground", -"MushroomIsland_underground", -"BirchForest_underground", -"Plains_underground", -"MesaPlateauF_underground", -"ExtremeHills_underground", -"MegaSpruceTaiga_underground", -"BirchForestM_underground", -"SavannaM_underground", -"MesaPlateauFM_underground", -"Desert_underground", -"Savanna_underground", -"Forest_underground", -"SunflowerPlains_underground", +"JungleEdge_underground",local spawning_position = spawning_position_list[math.random(1,#spawning_position_list)] "ColdTaiga_underground", "IcePlains_underground", "IcePlainsSpikes_underground", @@ -433,59 +422,22 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh --load information into the spawn dictionary + local key = #spawn_dictionary + 1 + spawn_dictionary[key] = {} + spawn_dictionary[key]["name"] = name + spawn_dictionary[key]["dimension"] = dimension + spawn_dictionary[key]["type_of_spawning"] = type_of_spawning + spawn_dictionary[key]["biomes"] = biomes + spawn_dictionary[key]["min_light"] = min_light + spawn_dictionary[key]["max_light"] = max_light + spawn_dictionary[key]["interval"] = interval + spawn_dictionary[key]["chance"] = chance + spawn_dictionary[key]["aoc"] = aoc + spawn_dictionary[key]["min_height"] = min_height + spawn_dictionary[key]["max_height"] = max_height + spawn_dictionary[key]["day_toggle"] = day_toggle + spawn_dictionary[key]["on_spawn"] = spawn_abm_action - --allow for new dimensions to be auto added - --this will take extra time, a whole few nanoseconds - --but will allow modularity - - --build dimensions modularly - if not spawn_dictionary[dimension] then - spawn_dictionary[dimension] = {} - end - - --build biome list modularly - for _,added_biome in pairs(biomes) do - if not spawn_dictionary[dimension][added_biome] then - spawn_dictionary[dimension][added_biome] = {} - end - - --build type of spawning per biome modularly - if not spawn_dictionary[dimension][added_biome][type_of_spawning] then - spawn_dictionary[dimension][added_biome][type_of_spawning] = {} - end - - --build light levels to spawn mob - for i = min_light,max_light do - if not spawn_dictionary[dimension][added_biome][type_of_spawning][i] then - spawn_dictionary[dimension][added_biome][type_of_spawning][i] = {} - end - - for y = min_height, max_height do - --print(y) - end - end - end - - print("--") - print(min_height, max_height) - - - --[[ - local key = #spawn_dictionary[dimension] + 1 - - spawn_dictionary[dimension][key] = {} - spawn_dictionary[dimension][key]["name"] = name - spawn_dictionary[dimension][key]["type"] = type_of_spawning - spawn_dictionary[dimension][key]["min_light"] = min_light - spawn_dictionary[dimension][key]["max_light"] = max_light - spawn_dictionary[dimension][key]["interval"] = interval - spawn_dictionary[dimension][key]["chance"] = chance - spawn_dictionary[dimension][key]["aoc"] = aoc - spawn_dictionary[dimension][key]["min_height"] = min_height - spawn_dictionary[dimension][key]["max_height"] = max_height - spawn_dictionary[dimension][key]["day_toggle"] = day_toggle - spawn_dictionary[dimension][key]["on_spawn"] = spawn_abm_action - ]]-- --[[ minetest.register_abm({ label = name .. " spawning", @@ -499,7 +451,6 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh ]]-- end - -- compatibility with older mob registration -- we're going to forget about this for now -j4i --[[ @@ -574,108 +525,119 @@ local function decypher_limits(posy) posy = math.floor(posy) return posy - 32, posy + 32 end ---[[ -minetest.register_on_mods_loaded(function() - for _,data in pairs(minetest.registered_biomes) do - print(data.name) + +--a simple helper function for mob_spawn +local function biome_check(biome_list, biome_goal) + for _,data in ipairs(biome_list) do + if data == biome_goal then + return true + end end - print(dump(spawn_dictionary)) -end) -]]-- + return false +end + --todo mob limiting --MAIN LOOP ---[[ + if mobs_spawn then local timer = 15 --0 minetest.register_globalstep(function(dtime) timer = timer + dtime if timer >= 15 then - timer = 15--0 + timer = 0--15--0 for _,player in ipairs(minetest.get_connected_players()) do for i = 1,math.random(5) do + local player_pos = player:get_pos() + local _,dimension = mcl_worlds.y_to_layer(player_pos.y) if dimension == "void" or dimension == "default" then goto continue -- ignore void and unloaded area end - local min,max = decypher_limits(player_pos.y) local goal_pos = position_calculation(player_pos) - local gotten_biome = minetest.get_biome_data(goal_pos) + local spawning_position_list = find_nodes_in_area_under_air(new_vector(goal_pos.x,min,goal_pos.z), vector.new(goal_pos.x,max,goal_pos.z), {"group:solid", "group:water", "group:lava"}) + + --couldn't find node + if #spawning_position_list <= 0 then + goto continue + end + + local spawning_position = spawning_position_list[math_random(1,#spawning_position_list)] + + --I have no idea why this would happen, but better to be safe + if not spawning_position then + goto continue + end + + local gotten_node = get_node(spawning_position).name + + if not gotten_node or gotten_node == "air" then --skip air nodes + goto continue + end + + local gotten_biome = minetest.get_biome_data(spawning_position) if not gotten_biome then goto continue --skip if in unloaded area end - print(minetest.get_biome_name(gotten_biome.biome)) + gotten_biome = get_biome_name(gotten_biome.biome) --makes it easier to work with - local mob_def = spawn_dictionary[dimension][math.random(1,#spawn_dictionary[dimension])] + --grab random mob + local mob_def = spawn_dictionary[math.random(1,#spawn_dictionary)] - if not mob_def then --to catch a crazy error if it ever happens - minetest.log("error", "WARNING!! Attempted to spawn a mob that doesn't exist! Please notify developers!\nThe game will continue to run though.") - goto continue - end + if not mob_def then + goto continue --skip if something ridiculous happens (nil mob def) + end - if mob_def.type == "ground" then + --skip if not correct dimension + if mob_def.dimension ~= dimension then + goto continue + end - local spawning_position_list = minetest.find_nodes_in_area_under_air(vector.new(goal_pos.x,min,goal_pos.z), vector.new(goal_pos.x,max,goal_pos.z), {"group:solid"}) + --add this so mobs don't spawn inside nodes + spawning_position.y = spawning_position.y + 1 - if #spawning_position_list <= 0 then - goto continue - end - - local spawning_position = spawning_position_list[math.random(1,#spawning_position_list)] + if spawning_position.y < mob_def.min_height or spawning_position.y > mob_def.max_height then + goto continue + end - spawning_position.y = spawning_position.y + 1 + --only need to poll for node light if everything else worked + local gotten_light = get_node_light(spawning_position) - local gotten_light = minetest.get_node_light(spawning_position) + --don't spawn if not in light limits + if gotten_light < mob_def.min_light or gotten_light > mob_def.max_light then + goto continue + end - if gotten_light and gotten_light >= mob_def.min_light and gotten_light <= mob_def.max_light then - minetest.add_entity(spawning_position, mob_def.name) - end - elseif mob_def.type == "air" then - local spawning_position_list = minetest.find_nodes_in_area(vector.new(goal_pos.x,min,goal_pos.z), vector.new(goal_pos.x,max,goal_pos.z), {"air"}) + local is_water = get_item_group(gotten_node, "water") ~= 0 + local is_lava = get_item_group(gotten_node, "lava") ~= 0 - if #spawning_position_list <= 0 then - goto continue - end - - local spawning_position = spawning_position_list[math.random(1,#spawning_position_list)] + if mob_def.type_of_spawning == "ground" and is_water then + goto continue + end - local gotten_light = minetest.get_node_light(spawning_position) + if mob_def.type_of_spawning == "ground" and is_lava then + goto continue + end - if gotten_light and gotten_light >= mob_def.min_light and gotten_light <= mob_def.max_light then - minetest.add_entity(spawning_position, mob_def.name) - end - elseif mob_def.type == "water" then - local spawning_position_list = minetest.find_nodes_in_area(vector.new(goal_pos.x,min,goal_pos.z), vector.new(goal_pos.x,max,goal_pos.z), {"group:water"}) - - if #spawning_position_list <= 0 then - goto continue - end - - local spawning_position = spawning_position_list[math.random(1,#spawning_position_list)] - - local gotten_light = minetest.get_node_light(spawning_position) - - if gotten_light and gotten_light >= mob_def.min_light and gotten_light <= mob_def.max_light then - minetest.add_entity(spawning_position, mob_def.name) - end - --elseif mob_def.type == "lava" then - --implement later - end - --local spawn minetest.find_nodes_in_area_under_air(vector.new(pos.x,pos.y-find_node_height,pos.z), vector.new(pos.x,pos.y+find_node_height,pos.z), {"group:solid"}) + --adjust the position for water and lava mobs + if mob_def.type_of_spawning == "water" or mob_def.type_of_spawning == "lava" then + spawning_position.y = spawning_position.y - 1 + end + --everything is correct, spawn mob + minetest.add_entity(spawning_position, mob_def.name) ::continue:: --this is a safety catch end end end end) end -]]-- \ No newline at end of file diff --git a/mods/ENTITIES/mobs_mc/0_gameconfig.lua b/mods/ENTITIES/mobs_mc/0_gameconfig.lua index b979c7353a..c92ccbba52 100644 --- a/mods/ENTITIES/mobs_mc/0_gameconfig.lua +++ b/mods/ENTITIES/mobs_mc/0_gameconfig.lua @@ -290,9 +290,9 @@ mobs_mc.spawn = { mobs_mc.spawn_height = { water = tonumber(minetest.settings:get("water_level")) or 0, -- Water level in the Overworld - -- Overworld boundaries (inclusive) --had to make this reasonable otherwise mob spawning would go nuts using data + -- Overworld boundaries (inclusive) --I adjusted this to be more reasonable overworld_min = -64,-- -2999, - overworld_max = 256,-- 31000, + overworld_max = 31000, -- Nether boundaries (inclusive) nether_min = -29067,-- -3369,