diff --git a/mods/ENTITIES/mobs_mc/0_gameconfig.lua b/mods/ENTITIES/mobs_mc/0_gameconfig.lua index 692f6245..410719f6 100644 --- a/mods/ENTITIES/mobs_mc/0_gameconfig.lua +++ b/mods/ENTITIES/mobs_mc/0_gameconfig.lua @@ -249,8 +249,9 @@ mobs_mc.spawn = { desert = { "default:desert_sand", "group:sand" }, jungle = { "default:dirt_with_rainforest_litter", "default:jungleleaves", "default:junglewood", "mcl_core:jungleleaves", "mcl_core:junglewood" }, snow = { "default:snow", "default:snowblock", "default:dirt_with_snow" }, - end_city = { "default:cobble", "mcl_end:purpur_block", "mcl_end:end_stone", "mcl_portals:void"}, + end_city = { "default:sandstonebrick", "mcl_end:purpur_block", "mcl_end:end_stone" }, wolf = { mobs_mc.items.grass_block, "default:dirt_with_rainforest_litter", "default:dirt", "default:dirt_with_snow", "default:snow", "default:snowblock" }, + village = { "mg_villages:road" }, -- These probably don't need overrides mushroom_island = { mobs_mc.items.mycelium, "mcl_core:mycelium" }, @@ -260,13 +261,31 @@ mobs_mc.spawn = { water = { mobs_mc.items.water_source, "mcl_core:water_source", "default:water_source" }, } +-- This table contains important spawn height references for the mob spawn height. +-- Please base your mob spawn height on these numbers to keep things clean. +mobs_mc.spawn_height = { + water = tonumber(minetest.setting_get("water_level")) or 0, -- Water level in the Overworld + + -- Overworld boundaries (inclusive) + overworld_min = -2999, + overworld_max = 31000, + + -- Nether boundaries (inclusive) + nether_min = -3369, + nether_max = -3000, + + -- End boundaries (inclusive) + end_min = -6200, + end_max = -6000, +} + mobs_mc.misc = { shears_wear = 276, -- Wear to add per shears usage (238 uses) } -- Item name overrides from mobs_mc_gameconfig (if present) if minetest.get_modpath("mobs_mc_gameconfig") and mobs_mc.override then - local tables = {"items", "follow", "replace", "spawn", "misc"} + local tables = {"items", "follow", "replace", "spawn", "spawn_height", "misc"} for t=1, #tables do local tbl = tables[t] if mobs_mc.override[tbl] then diff --git a/mods/ENTITIES/mobs_mc/bat.lua b/mods/ENTITIES/mobs_mc/bat.lua index 5de504f8..5e6b9aa9 100644 --- a/mods/ENTITIES/mobs_mc/bat.lua +++ b/mods/ENTITIES/mobs_mc/bat.lua @@ -54,7 +54,7 @@ else end -- Spawn on solid blocks at or below Sea level and the selected light level -mobs:spawn_specific("mobs_mc:bat", mobs_mc.spawn.solid,{"air"},0, maxlight, 20, 5000, 2, -500, 0) +mobs:spawn_specific("mobs_mc:bat", mobs_mc.spawn.solid, {"air"}, 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 767d5760..3af10105 100644 --- a/mods/ENTITIES/mobs_mc/blaze.lua +++ b/mods/ENTITIES/mobs_mc/blaze.lua @@ -71,8 +71,8 @@ mobs:register_mob("mobs_mc:blaze", { blood_amount = 0, }) -mobs:register_spawn("mobs_mc:blaze", mobs_mc.spawn.nether_fortress, minetest.LIGHT_MAX+1, 0, 5000, 1, -1000, true) - +mobs:spawn_specific("mobs_mc:blaze", mobs_mc.spawn.nether_fortress, {"air"}, 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", { visual = "sprite", diff --git a/mods/ENTITIES/mobs_mc/chicken.lua b/mods/ENTITIES/mobs_mc/chicken.lua index 09f6ee26..cd8a22b2 100644 --- a/mods/ENTITIES/mobs_mc/chicken.lua +++ b/mods/ENTITIES/mobs_mc/chicken.lua @@ -95,7 +95,7 @@ mobs:register_mob("mobs_mc:chicken", { }) --spawn -mobs:register_spawn("mobs_mc:chicken", mobs_mc.spawn.grassland, minetest.LIGHT_MAX+1, 9, 17000, 3, 31000) +mobs:spawn_specific("mobs_mc:chicken", mobs_mc.spawn.grassland, {"air"}, 9, minetest.LIGHT_MAX+1, 30, 17000, 3, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:chicken", S("Chicken"), "mobs_mc_spawn_icon_chicken.png", 0) diff --git a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua index 83bfd853..f7f2d47b 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -134,9 +134,8 @@ mobs:register_mob("mobs_mc:mooshroom", mooshroom_def) -- Spawning -mobs:register_spawn("mobs_mc:cow", mobs_mc.spawn.grassland, minetest.LIGHT_MAX+1, 9, 17000, 20, 31000) -mobs:register_spawn("mobs_mc:mooshroom", mobs_mc.spawn.mushroom_island, minetest.LIGHT_MAX+1, 9, 17000, 10, 31000) - +mobs:spawn_specific("mobs_mc:cow", mobs_mc.spawn.grassland, {"air"}, 9, minetest.LIGHT_MAX+1, 30, 17000, 20, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific("mobs_mc:mooshroom", mobs_mc.spawn.mushroom_island, {"air"}, 9, minetest.LIGHT_MAX+1, 30, 17000, 10, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -- compatibility mobs:alias_mob("mobs_animal:cow", "mobs_mc:cow") diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index 6f481b40..b8ba9e2c 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -122,7 +122,7 @@ mobs:register_mob("mobs_mc:creeper", { }) -mobs:spawn_specific("mobs_mc:creeper", mobs_mc.spawn.solid, {"air"},0, 7, 20, 16500, 1, -310, 31000) +mobs:spawn_specific("mobs_mc:creeper", mobs_mc.spawn.solid, {"air"}, 0, 7, 20, 16500, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -- compatibility mobs:alias_mob("mobs:creeper", "mobs_mc:creeper") diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index 5b0d236b..1161cb00 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -146,12 +146,13 @@ mobs:register_mob("mobs_mc:enderman", { }) +-- End spawn +mobs:spawn_specific("mobs_mc:enderman", mobs_mc.spawn.solid, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 3000, 4, mobs_mc.spawn_height.end_min, mobs_mc.spawn_height.end_max) +-- Overworld spawn +mobs:spawn_specific("mobs_mc:enderman", mobs_mc.spawn.solid, {"air"}, 0, 7, 30, 9000, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +-- Nether spawn (rare) +mobs:spawn_specific("mobs_mc:enderman", mobs_mc.spawn.solid, {"air"}, 0, 7, 30, 27500, 4, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) ---spawn on solid blocks -mobs:register_spawn("mobs_mc:enderman", mobs_mc.spawn.desert, 7, 0, 9000, -31000, 31000) ---mobs:register_spawn("mobs_mc:enderman", mobs_mc.end_city, minetest.LIGHT_MAX+1, 0, 9000, -31000, -5000) -mobs:spawn_specific("mobs_mc:enderman", "mcl_end:end_stone", {"air"}, 0, minetest.LIGHT_MAX+1, 5, 20, 2, -31000, -5000) -mobs:spawn_specific("mobs_mc:enderman", "mcl_end:end_stone", {"mcl_portals:void"}, 0, minetest.LIGHT_MAX+1, 5, 20, 2, -31000, -5000) -- 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 3b71a1b0..f1200647 100644 --- a/mods/ENTITIES/mobs_mc/ghast.lua +++ b/mods/ENTITIES/mobs_mc/ghast.lua @@ -77,8 +77,8 @@ mobs:register_mob("mobs_mc:ghast", { }) ---mobs:register_spawn("mobs_mc:ghast", {"default:flowing_lava", "nether:rack","air"}, 17, -1, 5000, 1, -2000) -mobs:spawn_specific("mobs_mc:ghast", mobs_mc.spawn.nether, {"air"},0, minetest.LIGHT_MAX+1, 0, 18000, 2, -3610, -2100) +mobs:spawn_specific("mobs_mc:ghast", mobs_mc.spawn.nether, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 18000, 2, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) + -- fireball (weapon) mobs:register_arrow(":mobs_monster:fireball", { visual = "sprite", diff --git a/mods/ENTITIES/mobs_mc/guardian.lua b/mods/ENTITIES/mobs_mc/guardian.lua index 73063129..de9cac1d 100644 --- a/mods/ENTITIES/mobs_mc/guardian.lua +++ b/mods/ENTITIES/mobs_mc/guardian.lua @@ -81,7 +81,7 @@ mobs:register_mob("mobs_mc:guardian", { blood_amount = 0, }) -mobs:register_spawn("mobs_mc:guardian", mobs_mc.spawn.water, minetest.LIGHT_MAX+1, 0, 5000, 2, -1000, true) +mobs:spawn_specific("mobs_mc:guardian", mobs_mc.spawn.water, mobs_mc.spawn_water, 0, minetest.LIGHT_MAX+1, 30, 25000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water - 10) -- spawn eggs mobs:register_egg("mobs_mc:guardian", S("Guardian"), "mobs_mc_spawn_icon_guardian.png", 0) diff --git a/mods/ENTITIES/mobs_mc/guardian_elder.lua b/mods/ENTITIES/mobs_mc/guardian_elder.lua index 9b74aca0..27e21c45 100644 --- a/mods/ENTITIES/mobs_mc/guardian_elder.lua +++ b/mods/ENTITIES/mobs_mc/guardian_elder.lua @@ -86,7 +86,7 @@ mobs:register_mob("mobs_mc:guardian_elder", { blood_amount = 0, }) -mobs:register_spawn("mobs_mc:guardian_elder", mobs_mc.spawn.water, minetest.LIGHT_MAX+1, 0, 5000, 2, -1000, true) +mobs:spawn_specific("mobs_mc:guardian_elder", mobs_mc.spawn.water, mobs_mc.spawn_water, 0, minetest.LIGHT_MAX+1, 30, 40000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water-18) -- spawn eggs mobs:register_egg("mobs_mc:guardian_elder", S("Elder Guardian"), "mobs_mc_spawn_icon_guardian_elder.png", 0) diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index 34c29ede..7672eb66 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -330,9 +330,8 @@ mobs:register_mob("mobs_mc:mule", mule) --=========================== --Spawn Function -mobs:register_spawn("mobs_mc:horse", mobs_mc.spawn.grassland_savanna, minetest.LIGHT_MAX+1, 0, 15000, 12, 31000) -mobs:register_spawn("mobs_mc:donkey", mobs_mc.spawn.grassland_savanna, minetest.LIGHT_MAX+1, 0, 15000, 12, 31000) - +mobs:spawn_specific("mobs_mc:horse", mobs_mc.spawn.grassland_savanna, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 15000, 12, mobs_mc.spawn_height.water+3, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific("mobs_mc:donkey", mobs_mc.spawn.grassland_savanna, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 15000, 12, mobs_mc.spawn_height.water+3, mobs_mc.spawn_height.overworld_max) -- compatibility mobs:alias_mob("mobs:horse", "mobs_mc:horse") diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index 82c25119..d689993d 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -139,7 +139,7 @@ mobs:register_mob("mobs_mc:llama", { }) --spawn -mobs:register_spawn("mobs_mc:llama", mobs_mc.spawn.savanna, minetest.LIGHT_MAX+1, 0, 15000, 1, 40) +mobs:spawn_specific("mobs_mc:llama", mobs_mc.spawn.savanna, {"air"}, 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 cd9e2e3a..e1c11e8c 100644 --- a/mods/ENTITIES/mobs_mc/ocelot.lua +++ b/mods/ENTITIES/mobs_mc/ocelot.lua @@ -140,12 +140,13 @@ local base_spawn_chance = 5000 mobs:spawn({ name = "mobs_mc:ocelot", nodes = mobs_mc.spawn.jungle, + neighbors = {"air"}, light_max = minetest.LIGHT_MAX+1, light_min = 0, chance = math.ceil(base_spawn_chance * 1.5), -- emulates 1/3 spawn failure rate active_object_count = 12, - min_height = 1, -- Right above ocean level - max_height = 31000, + min_height = mobs_mc.spawn_height.water+1, -- Right above ocean level + max_height = mobs_mc.spawn_height.overworld_max, on_spawn = function(self, pos) --[[ Note: Minecraft has a 1/3 spawn failure rate. In this mod it is emulated by reducing the spawn rate accordingly (see above). ]] diff --git a/mods/ENTITIES/mobs_mc/parrot.lua b/mods/ENTITIES/mobs_mc/parrot.lua index 21e1b965..e030d16f 100644 --- a/mods/ENTITIES/mobs_mc/parrot.lua +++ b/mods/ENTITIES/mobs_mc/parrot.lua @@ -89,7 +89,7 @@ mobs:register_mob("mobs_mc:parrot", { --spawn -- TODO: Increase spawn chance if polished -mobs:spawn_specific("mobs_mc:parrot", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX+1, 20, 20000, 2, 15, 20) +--mobs:spawn_specific("mobs_mc:parrot", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 30000, 1, mobs_mc.spawn_height.water+1, 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 aa4944f9..05481544 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -168,7 +168,7 @@ mobs:register_mob("mobs_mc:pig", { end, }) -mobs:register_spawn("mobs_mc:pig", mobs_mc.spawn.grassland, minetest.LIGHT_MAX+1, 9, 15000, 30, 31000) +mobs:spawn_specific("mobs_mc:pig", mobs_mc.spawn.grassland, {"air"}, 9, minetest.LIGHT_MAX+1, 30, 15000, 30, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -- compatibility mobs:alias_mob("mobs:pig", "mobs_mc:pig") diff --git a/mods/ENTITIES/mobs_mc/polar_bear.lua b/mods/ENTITIES/mobs_mc/polar_bear.lua index 24858bcb..8028655a 100644 --- a/mods/ENTITIES/mobs_mc/polar_bear.lua +++ b/mods/ENTITIES/mobs_mc/polar_bear.lua @@ -69,13 +69,9 @@ mobs:register_mob("mobs_mc:polar_bear", { mobs:alias_mob("mobs_mc:polarbear", "mobs_mc:polar_bear") -mobs:register_spawn("mobs_mc:polar_bear", mobs_mc.spawn.snow, minetest.LIGHT_MAX+1, 0, 7000, 3, 31000) - +mobs:spawn_specific("mobs_mc:polar_bear", mobs_mc.spawn.snow, {"air"}, 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/rabbit.lua b/mods/ENTITIES/mobs_mc/rabbit.lua index c937d86c..5e1b2b52 100644 --- a/mods/ENTITIES/mobs_mc/rabbit.lua +++ b/mods/ENTITIES/mobs_mc/rabbit.lua @@ -104,10 +104,13 @@ mobs:register_mob("mobs_mc:killer_bunny", killer_bunny) local spawn = { name = "mobs_mc:rabbit", + neighbors = {"air"}, chance = 15000, active_object_count = 99, min_light = 0, max_light = minetest.LIGHT_MAX+1, + min_height = mobs_mc.spawn_height.overworld_min, + max_height = mobs_mc.spawn_height.overworld_max, } local spawn_desert = table.copy(spawn) diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index 48176e72..bfc8ac0f 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -202,7 +202,7 @@ mobs:register_mob("mobs_mc:sheep", { if mobs:capture_mob(self, clicker, 0, 5, 70, false, nil) then return end end, }) -mobs:register_spawn("mobs_mc:sheep", mobs_mc.spawn.grassland, minetest.LIGHT_MAX+1, 0, 15000, 3, 31000) +mobs:spawn_specific("mobs_mc:sheep", mobs_mc.spawn.grassland, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 15000, 3, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -- compatibility mobs:alias_mob("mobs_animal:sheep", "mobs_mc:sheep") diff --git a/mods/ENTITIES/mobs_mc/shulker.lua b/mods/ENTITIES/mobs_mc/shulker.lua index f9173995..8c779293 100644 --- a/mods/ENTITIES/mobs_mc/shulker.lua +++ b/mods/ENTITIES/mobs_mc/shulker.lua @@ -83,12 +83,7 @@ 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", mobs_mc.spawn.end_city, 0, minetest.LIGHT_MAX+1, 5, 3, 1, -31000, -5000) -mobs:spawn_specific("mobs_mc:shulker", "mcl_end:purpur_block", {"air"}, 0, minetest.LIGHT_MAX+1, 5, 20, 2, -31000, -5000) -mobs:spawn_specific("mobs_mc:shulker", "mcl_end:purpur_block", {"mcl_portals:void"}, 0, minetest.LIGHT_MAX+1, 5, 20, 2, -31000, -5000) - - - +mobs:spawn_specific("mobs_mc:shulker", "mcl_end:purpur_block", {"air"}, 0, minetest.LIGHT_MAX+1, 30, 5000, 2, mobs_mc.spawn_height.end_min, mobs_mc.spawn_height.end_max) if minetest.settings:get_bool("log_mods") then minetest.log("action", "MC Shulkers loaded") diff --git a/mods/ENTITIES/mobs_mc/skeleton+stray.lua b/mods/ENTITIES/mobs_mc/skeleton+stray.lua index 183c9568..7632adcd 100644 --- a/mods/ENTITIES/mobs_mc/skeleton+stray.lua +++ b/mods/ENTITIES/mobs_mc/skeleton+stray.lua @@ -122,10 +122,15 @@ mobs:register_mob("mobs_mc:stray", stray) -- compatibility mobs:alias_mob("mobs:skeleton", "mobs_mc:skeleton") ---spawn -mobs:spawn_specific("mobs_mc:skeleton", mobs_mc.spawn.solid,{"air"}, 0, 7, 20, 17000, 2, -110, 31000) +-- Overworld spawn +mobs:spawn_specific("mobs_mc:skeleton", mobs_mc.spawn.solid, {"air"}, 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", mobs_mc.spawn.nether_fortress, {"air"}, 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", mobs_mc.spawn.snow, {"air"}, 0, 7, 20, 19000, 2, -110, 31000) +mobs:spawn_specific("mobs_mc:stray", mobs_mc.spawn.snow, {"air"}, 0, 7, 20, 19000, 2, mobs_mc.spawn_height.water, mobs_mc.spawn_height.overworld_max) + -- spawn eggs mobs:register_egg("mobs_mc:skeleton", S("Skeleton"), "mobs_mc_spawn_icon_skeleton.png", 0) diff --git a/mods/ENTITIES/mobs_mc/skeleton_wither.lua b/mods/ENTITIES/mobs_mc/skeleton_wither.lua index fbf94ba8..400fa509 100644 --- a/mods/ENTITIES/mobs_mc/skeleton_wither.lua +++ b/mods/ENTITIES/mobs_mc/skeleton_wither.lua @@ -94,7 +94,8 @@ mobs:register_mob("mobs_mc:witherskeleton", { }) --spawn -mobs:register_spawn("mobs_mc:witherskeleton", mobs_mc.spawn.nether_fortress, 7, 0, 5000, 3, -3000, true) +mobs:spawn_specific("mobs_mc:witherskeleton", mobs_mc.spawn.nether_fortress, {"air"}, 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) diff --git a/mods/ENTITIES/mobs_mc/slime+magma_cube.lua b/mods/ENTITIES/mobs_mc/slime+magma_cube.lua index ecd4e64a..e0c9d58a 100644 --- a/mods/ENTITIES/mobs_mc/slime+magma_cube.lua +++ b/mods/ENTITIES/mobs_mc/slime+magma_cube.lua @@ -118,11 +118,12 @@ slime_tiny.on_die = nil 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:register_spawn("mobs_mc:slime_tiny", mobs_mc.spawn.solid, minetest.LIGHT_MAX+1, 0, 35000, 4, -12) -mobs:register_spawn("mobs_mc:slime_small", mobs_mc.spawn.solid, minetest.LIGHT_MAX+1, 0, 35000, 4, -12) -mobs:register_spawn("mobs_mc:slime_big", mobs_mc.spawn.solid, minetest.LIGHT_MAX+1, 0, 35000, 4, -12) - +mobs:spawn_specific("mobs_mc:slime_tiny", mobs_mc.spawn.solid, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 12000, 4, smin, smax) +mobs:spawn_specific("mobs_mc:slime_small", mobs_mc.spawn.solid, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 8500, 4, smin, smax) +mobs:spawn_specific("mobs_mc:slime_big", mobs_mc.spawn.solid, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 10000, 4, smin, smax) -- Magma cube local magma_cube_big = { @@ -240,14 +241,17 @@ magma_cube_tiny.on_die = nil 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:register_spawn("mobs_mc:magma_cube_tiny", mobs_mc.spawn.nether, minetest.LIGHT_MAX+1, 0, 15000, 4, -1000) -mobs:register_spawn("mobs_mc:magma_cube_small", mobs_mc.spawn.nether, minetest.LIGHT_MAX+1, 0, 15500, 4, -1000) -mobs:register_spawn("mobs_mc:magma_cube_big", mobs_mc.spawn.nether, minetest.LIGHT_MAX+1, 0, 16000, 4, -1000) +mobs:spawn_specific("mobs_mc:magma_cube_tiny", mobs_mc.spawn.nether, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 15000, 4, mmin, mmax) +mobs:spawn_specific("mobs_mc:magma_cube_small", mobs_mc.spawn.nether, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 15500, 4, mmin, mmax) +mobs:spawn_specific("mobs_mc:magma_cube_big", mobs_mc.spawn.nether, {"air"}, 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) +mobs:spawn_specific("mobs_mc:magma_cube_big", mobs_mc.spawn.nether_fortress, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 11200, 4, mmin, mmax) -mobs:register_spawn("mobs_mc:magma_cube_tiny", mobs_mc.spawn.nether_fortress, minetest.LIGHT_MAX+1, 0, 11000, 4, -1000) -mobs:register_spawn("mobs_mc:magma_cube_small", mobs_mc.spawn.nether_fortress, minetest.LIGHT_MAX+1, 0, 11100, 4, -1000) -mobs:register_spawn("mobs_mc:magma_cube_big", mobs_mc.spawn.nether_fortress, minetest.LIGHT_MAX+1, 0, 11200, 4, -1000) -- Compability mobs:alias_mob("mobs_mc:greensmall", "mobs_mc:slime_tiny") diff --git a/mods/ENTITIES/mobs_mc/spider.lua b/mods/ENTITIES/mobs_mc/spider.lua index bb2f2db7..73f37cc6 100644 --- a/mods/ENTITIES/mobs_mc/spider.lua +++ b/mods/ENTITIES/mobs_mc/spider.lua @@ -77,8 +77,7 @@ cave_spider.walk_velocity = 4.1 mobs:register_mob("mobs_mc:cave_spider", cave_spider) -mobs:register_spawn("mobs_mc:spider", mobs_mc.spawn.solid, 7, 0, 19500, 2, 3000) - +mobs:spawn_specific("mobs_mc:spider", mobs_mc.spawn.solid, {"air"}, 0, 7, 30, 17000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -- compatibility mobs:alias_mob("mobs:spider", "mobs_mc:spider") diff --git a/mods/ENTITIES/mobs_mc/squid.lua b/mods/ENTITIES/mobs_mc/squid.lua index c1b291eb..2ab401d1 100644 --- a/mods/ENTITIES/mobs_mc/squid.lua +++ b/mods/ENTITIES/mobs_mc/squid.lua @@ -60,7 +60,7 @@ mobs:register_mob("mobs_mc:squid", { -- Spawn near the water surface -local water = tonumber(minetest.settings:get("water_level")) or 0 +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", mobs_mc.spawn.water, {mobs_mc.items.water_source}, 0, minetest.LIGHT_MAX+1, 30, 5500, 3, water-16, water) diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index 24601144..76a728e2 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -168,8 +168,7 @@ mobs:register_mob("mobs_mc:villager", { ]] }) ---mobs:register_spawn("mobs_mc:villager", {"default:gravel"}, 7, -1, 4090, 4, 31000) -mobs:register_spawn("mobs_mc:villager", {"mg_villages:road"}, minetest.LIGHT_MAX+1, -1,8000, 4, 31000) +mobs:spawn_specific("mobs_mc:villager", mobs_mc.spawn.village, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 8000, 4, mobs_mc.spawn_height.water+1, mobs_mc.spawn_height.overworld_max) -- compatibility mobs:alias_mob("mobs:villager", "mobs_mc:villager") diff --git a/mods/ENTITIES/mobs_mc/villager_zombie.lua b/mods/ENTITIES/mobs_mc/villager_zombie.lua index e5094f2e..b5c079c8 100644 --- a/mods/ENTITIES/mobs_mc/villager_zombie.lua +++ b/mods/ENTITIES/mobs_mc/villager_zombie.lua @@ -83,11 +83,8 @@ mobs:register_mob("mobs_mc:villager_zombie", { fear_height = 5, }) ---mobs:register_spawn("mobs_mc:villager", {"default:gravel"}, 7, -1, 4090, 4, 31000) -mobs:register_spawn("mobs_mc:villager_zombie", {"mg_villages:road"}, 7, -1, 4090, 4, 31000) - - +mobs:spawn_specific("mobs_mc:villager_zombie", mobs_mc.spawn.village, {"air"}, 0, 7, 30, 4090, 4, mobs_mc.spawn_height.water+1, 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) diff --git a/mods/ENTITIES/mobs_mc/witch.lua b/mods/ENTITIES/mobs_mc/witch.lua index 99ec2eb0..85abbdc2 100644 --- a/mods/ENTITIES/mobs_mc/witch.lua +++ b/mods/ENTITIES/mobs_mc/witch.lua @@ -110,7 +110,7 @@ mobs:register_arrow(":mobs:potion_arrow", { }) -- TODO: Spawn when witch works properly ---mobs:spawn_specific("mobs_mc:witch", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX-6, 12, 20000, 2, 1, 30) +--mobs:spawn_specific("mobs_mc:witch", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX-6, 12, 20000, 2, mobs_mc.spawn_height.water-6, mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:witch", S("Witch"), "mobs_mc_spawn_icon_witch.png", 0) diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index cf17b3b5..7f22ce90 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -207,7 +207,7 @@ end mobs:register_mob("mobs_mc:dog", dog) -- Spawn -mobs:register_spawn("mobs_mc:wolf", mobs_mc.spawn.wolf, minetest.LIGHT_MAX+1, 0, 9000, 20, 31000) +mobs:spawn_specific("mobs_mc:wolf", mobs_mc.spawn.wolf, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 9000, 20, mobs_mc.spawn_height.water+3, mobs_mc.spawn_height.overworld_max) -- Compatibility mobs:alias_mob("mobs:wolf", "mobs_mc:wolf") diff --git a/mods/ENTITIES/mobs_mc/zombie.lua b/mods/ENTITIES/mobs_mc/zombie.lua index 8d2dda47..4408a7be 100644 --- a/mods/ENTITIES/mobs_mc/zombie.lua +++ b/mods/ENTITIES/mobs_mc/zombie.lua @@ -122,12 +122,11 @@ mobs:register_mob("mobs_mc:baby_husk", baby_husk) -- Spawning -mobs:register_spawn("mobs_mc:zombie", mobs_mc.spawn.solid, 7, 0, 6000, 4, 31000) +mobs:spawn_specific("mobs_mc:zombie", mobs_mc.spawn.solid, {"air"}, 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:register_spawn("mobs_mc:baby_zombie", mobs_mc.spawn.solid, 7, 0, 60000, 4, 31000) -mobs:register_spawn("mobs_mc:husk", mobs_mc.spawn.desert, 7, 0, 6500, 4, 31000) -mobs:register_spawn("mobs_mc:baby_husk", mobs_mc.spawn.desert, 7, 0, 65000, 4, 31000) - +mobs:spawn_specific("mobs_mc:baby_zombie", mobs_mc.spawn.solid, {"air"}, 0, 7, 30, 60000, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific("mobs_mc:husk", mobs_mc.spawn.desert, {"air"}, 0, 7, 30, 6500, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific("mobs_mc:baby_husk", mobs_mc.spawn.desert, {"air"}, 0, 7, 30, 65000, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -- Compatibility mobs:alias_mob("mobs:zombie", "mobs_mc:zombie") diff --git a/mods/ENTITIES/mobs_mc/zombiepig.lua b/mods/ENTITIES/mobs_mc/zombiepig.lua index 6b2ad65e..3661ec47 100644 --- a/mods/ENTITIES/mobs_mc/zombiepig.lua +++ b/mods/ENTITIES/mobs_mc/zombiepig.lua @@ -80,7 +80,7 @@ mobs:register_mob("mobs_mc:pigman", pigman) local baby_pigman = table.copy(pigman) baby_pigman.collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.94, 0.25} -baby_pigman.visual_size = {x=0.5, y=0.5} +baby_pigman.visual_size = {x=pigman.visual_size.x/2, y=pigman.visual_size.y/2} baby_pigman.textures = {{"mobs_mc_zombie_pigman.png"}} baby_pigman.walk_velocity = 1.2 baby_pigman.run_velocity = 2.4 @@ -88,13 +88,13 @@ baby_pigman.light_damage = 0 mobs:register_mob("mobs_mc:baby_pigman", baby_pigman) +-- Regular spawning in the Nether +mobs:spawn_specific("mobs_mc:pigman", mobs_mc.spawn.solid, {"air"}, 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:register_spawn("mobs_mc:baby_pigman", mobs_mc.spawn.nether, minetest.LIGHT_MAX+1, 0, 100000, 4, 31000) +mobs:spawn_specific("mobs_mc:baby_pigman", mobs_mc.spawn.solid, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 100000, 4, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) ---mobs:register_spawn("mobs_mc:pigman", {"nether:rack"}, 17, -1, 5000, 3, -2000) -mobs:register_spawn("mobs_mc:pigman", mobs_mc.spawn.nether, minetest.LIGHT_MAX+1, 0, 6000, 3, -2000) -mobs:register_spawn("mobs_mc:pigman", mobs_mc.spawn.nether_portal, minetest.LIGHT_MAX+1, 0, 500, 4, 31000) -mobs:spawn_specific("mobs_mc:pigman", mobs_mc.spawn.nether_portal, {"air", "mcl_portals:nether_air"},0, minetest.LIGHT_MAX+1, 7, 9000, 2, -31000, 31000) +-- 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) -- compatibility mobs:alias_mob("mobs:pigman", "mobs_mc:pigman") diff --git a/mods/ENTITIES/mobs_mc_gameconfig/depends.txt b/mods/ENTITIES/mobs_mc_gameconfig/depends.txt new file mode 100644 index 00000000..3b355984 --- /dev/null +++ b/mods/ENTITIES/mobs_mc_gameconfig/depends.txt @@ -0,0 +1 @@ +mcl_init diff --git a/mods/ENTITIES/mobs_mc_gameconfig/init.lua b/mods/ENTITIES/mobs_mc_gameconfig/init.lua index e598d3fd..a8f403f1 100644 --- a/mods/ENTITIES/mobs_mc_gameconfig/init.lua +++ b/mods/ENTITIES/mobs_mc_gameconfig/init.lua @@ -179,6 +179,26 @@ mobs_mc.override.spawn = { jungle = { "mcl_core:podzol", "mcl_core:jungletree", "mcl_core:jungleleaves", "mcl_flowers:fern" }, snow = { "mcl_core:snow", "mcl_core:snowblock", "mcl_core:dirt_with_grass_snow" }, end_city = { "mcl_end:purpur_block" }, + nether = { "mcl_nether:netherrack", "mcl_nether:quartz_ore" }, + -- Netherrack added because there are no Nether fortresses yet. TODO: Remove netherrac from list as soon they're available + nether_fortress = { "mcl_nether:nether_brick", "mcl_nether:netherrack" }, wolf = { mobs_mc.override.items.grass_block, "mcl_core:dirt", "mcl_core:dirt_with_grass_snow", "mcl_core:snow", "mcl_core:snowblock", "mcl_core:podzol" }, } +-- This table contains important spawn height references for the mob spawn height. +mobs_mc.override.spawn_height = { + water = tonumber(minetest.setting_get("water_level")) or 0, -- Water level in the Overworld + + -- Overworld boundaries (inclusive) + overworld_min = mcl_vars.mg_overworld_min, + overworld_max = mcl_vars.mg_overworld_max, + + -- Nether boundaries (inclusive) + nether_min = mcl_vars.mg_nether_min, + nether_max = mcl_vars.mg_nether_max, + + -- End boundaries (inclusive) + end_min = mcl_vars.mg_end_min, + end_max = mcl_vars.mg_end_max, +} +