Skip to content

Commit

Permalink
more fish spawning heights (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
SwissalpS authored Sep 6, 2024
1 parent 4a3c2f4 commit 2988828
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
4 changes: 4 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ if minetest.get_modpath("mobs_animal") then
end
end

if minetest.get_modpath("mobs_fish") then
dofile(MP .. "/mobs_fish.lua")
end

-- digistuff:channelcopier fix
if minetest.get_modpath("digistuff") then
dofile(MP .. "/digi_copier_fixer.lua")
Expand Down
72 changes: 72 additions & 0 deletions mobs_fish.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
-- Add extra areas where fish spawn

local l_spawn_chance = 10000
local l_water_level = minetest.settings:get("water_level")
local l_max_height_Earth = 777 -- Vacuum sometimes extends well below 1k
local l_max_height_Mars = 15777
local l_min_height_Mars = 11111

-- Extend Earth
mobs:spawn({
name = "mobs_fish:clownfish",
nodes = {
"default:water_source", "default:water_flowing",
"default:river_water_source", "default:river_water_flowing"
},
neighbors = {"default:sand","default:dirt","group:seaplants","group:seacoral"},
min_light = 5,
interval = 30,
chance = l_spawn_chance,
max_height = l_max_height_Earth,
min_height = l_water_level,
active_object_count = 5
})


mobs:spawn({
name = "mobs_fish:tropical",
nodes = {
"default:water_source", "default:water_flowing",
"default:river_water_source", "default:river_water_flowing"
},
neighbors = {"default:sand","default:dirt","group:seaplants","group:seacoral"},
min_light = 5,
interval = 30,
chance = l_spawn_chance,
max_height = l_max_height_Earth,
min_height = l_water_level,
active_object_count = 5
})


-- Extend Mars
mobs:spawn({
name = "mobs_fish:clownfish",
nodes = {
"default:water_source", "default:water_flowing",
"default:river_water_source", "default:river_water_flowing"
},
neighbors = {"default:sand","default:dirt","group:seaplants","group:seacoral"},
min_light = 5,
interval = 30,
chance = l_spawn_chance,
max_height = l_max_height_Mars,
min_height = l_min_height_Mars,
active_object_count = 5
})


mobs:spawn({
name = "mobs_fish:tropical",
nodes = {
"default:water_source", "default:water_flowing",
"default:river_water_source", "default:river_water_flowing"
},
neighbors = {"default:sand","default:dirt","group:seaplants","group:seacoral"},
min_light = 5,
interval = 30,
chance = l_spawn_chance,
max_height = l_max_height_Mars,
min_height = l_min_height_Mars,
active_object_count = 5
})
1 change: 1 addition & 0 deletions mod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ missions,
mobs,
mobs_animal,
mobs_monster,
mobs_fish,
moreblocks,
multitools,
mypaths,
Expand Down

0 comments on commit 2988828

Please sign in to comment.