forked from mtcontrib/mobs_animal
tweak and tidy code
This commit is contained in:
16
init.lua
16
init.lua
@ -1,9 +1,11 @@
|
||||
|
||||
-- translation and mod path
|
||||
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
||||
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
|
||||
-- Check for custom mob spawn file
|
||||
|
||||
local input = io.open(path .. "spawn.lua", "r")
|
||||
|
||||
if input then
|
||||
@ -12,8 +14,8 @@ if input then
|
||||
input = nil
|
||||
end
|
||||
|
||||
|
||||
-- helper function
|
||||
|
||||
local function ddoo(mob)
|
||||
|
||||
if minetest.settings:get_bool("mobs_animal." .. mob) == false then
|
||||
@ -25,6 +27,7 @@ local function ddoo(mob)
|
||||
end
|
||||
|
||||
-- Animals
|
||||
|
||||
ddoo("chicken") -- JKmurray
|
||||
ddoo("cow") -- KrupnoPavel
|
||||
ddoo("rat") -- PilzAdam
|
||||
@ -36,17 +39,16 @@ ddoo("kitten") -- Jordach/BFD
|
||||
ddoo("penguin") -- D00Med
|
||||
ddoo("panda") -- AspireMint
|
||||
|
||||
-- Load custom spawning if found
|
||||
|
||||
-- Load custom spawning
|
||||
if mobs.custom_spawn_animal then
|
||||
dofile(path .. "spawn.lua")
|
||||
end
|
||||
|
||||
|
||||
-- Lucky Blocks
|
||||
|
||||
if minetest.get_modpath("lucky_block") then
|
||||
dofile(path .. "lucky_block.lua")
|
||||
end
|
||||
|
||||
|
||||
print ("[MOD] Mobs Animal loaded")
|
||||
|
Reference in New Issue
Block a user