diff --git a/api.lua b/api.lua index dacd46f..1c0051c 100644 --- a/api.lua +++ b/api.lua @@ -219,12 +219,25 @@ function water_life.handle_drops(self) end end +function water_life.no_spawn_of(mobname) + if not mobname then + return + end + table.insert(water_life.no_spawn_table, mobname) +end + function water_life.register_shark_food(name) - table.insert(water_life.shark_food,name) + if not name then + return + end + table.insert(water_life.shark_food, name) end function water_life.register_gull_bait(name) - if name then water_life.gull_bait[name] = 1 end + if not name then + return + end + water_life.gull_bait[name] = 1 end function water_life.feed_shark(self) diff --git a/init.lua b/init.lua index c11c18f..1aa35dd 100644 --- a/init.lua +++ b/init.lua @@ -10,6 +10,7 @@ water_life.version = "220710" water_life.shark_food = {} water_life.repellant = {} water_life.gull_bait = {} +water_life.no_spawn_table = {} water_life.catchNet = "water_life:placeholder" water_life.petz = minetest.get_modpath("petz") water_life.mobsredo = minetest.get_modpath("mobs") diff --git a/spawn.lua b/spawn.lua index dbbd7a0..e33b73d 100644 --- a/spawn.lua +++ b/spawn.lua @@ -66,8 +66,12 @@ local function repel_insects(player) end local function spawn_it_here(pos, mobname) - - minetest.chat_send_all("Spawned: "..mobname); + + for i = 0, #water_life.no_spawn_table, 1 do + if water_life.no_spawn_table[i] == mobname then + return + end + end minetest.add_entity(pos,mobname) end