tweak and tidy code

This commit is contained in:
tenplus1
2024-08-10 14:10:22 +01:00
parent 10865e9ab4
commit 53f72b8a9e
14 changed files with 243 additions and 345 deletions

View File

@ -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")