general
976a83012d
* added settings to disable specific animals * honey blocks and beehives aren't ground content closes https://codeberg.org/tenplus1/mobs_animal/pulls/1 closes https://github.com/pandorabox-io/pandorabox.io#836 * Many node definitions seem to have not set is_ground_content to false, means jumping a ship near mapblocks that haven't been generated yet, can lead to loss of ships or at least parts of it. * chickens eat seed on ground, so add farming dependency missing * backported the have chance of chicken dropping a feather * backported commit bf12043fdcab68acfef299e26b6896a918ce1512 frombf12043fdc
* way to detect newer engines, for the sound_play extra parameter cherry picked from commit e644a1b52343c5c7e821d53c8b2f6dc9751a16fc backported frome644a1b523
minetest.sound_play uses optional parameter only in 5.3+ so autodetectting for future uses * add nil check to sheepy, fix warning msg when dye'ing sheep
90 lines
2.2 KiB
Lua
90 lines
2.2 KiB
Lua
local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
|
|
|
-- Check for translation method
|
|
local S
|
|
|
|
if minetest.get_translator ~= nil then
|
|
S = minetest.get_translator("mobs_jam") -- 5.x translation function
|
|
else
|
|
if minetest.get_modpath("intllib") then
|
|
dofile(minetest.get_modpath("intllib").."/init.lua")
|
|
if intllib.make_gettext_pair then
|
|
S = intllib.make_gettext_pair() -- new gettext method
|
|
else
|
|
S = intllib.Getter() -- old text file method
|
|
end
|
|
else -- boilerplate function
|
|
S = function(str, ...)
|
|
local args = {...}
|
|
return str:gsub("@%d+", function(match)
|
|
return args[tonumber(match:sub(2))]
|
|
end)
|
|
end
|
|
end
|
|
end
|
|
|
|
local is50 = minetest.has_feature("object_use_texture_alpha") or nil
|
|
local is54 = minetest.has_feature("use_texture_alpha_string_modes") or nil
|
|
|
|
mobs.intllib_animal = S
|
|
mobs.is54a = is54
|
|
|
|
-- Check for custom mob spawn file
|
|
local input = io.open(path .. "spawn.lua", "r")
|
|
|
|
if input then
|
|
mobs.custom_spawn_animal = true
|
|
input:close()
|
|
input = nil
|
|
end
|
|
|
|
-- helper function
|
|
local function ddoo(mob)
|
|
|
|
if minetest.settings:get_bool("mobs_animal." .. mob) == false then
|
|
print("[Mobs_Animal] " .. mob .. " disabled!")
|
|
return
|
|
end
|
|
|
|
dofile(path .. mob .. ".lua")
|
|
end
|
|
|
|
if not minetest.get_modpath("mobs_animal") then
|
|
ddoo("chicken") -- JKmurray
|
|
ddoo("cow") -- KrupnoPavel
|
|
ddoo("rat") -- PilzAdam
|
|
ddoo("sheep") -- PilzAdam
|
|
ddoo("warthog") -- KrupnoPavel
|
|
ddoo("bee") -- KrupnoPavel
|
|
ddoo("bunny") -- ExeterDad
|
|
ddoo("kitten") -- Jordach/BFD
|
|
ddoo("penguin") -- D00Med
|
|
ddoo("panda") -- AspireMint
|
|
end
|
|
|
|
if not minetest.get_modpath("mobs_doomed") or not minetest.get_modpath("dmobs") then
|
|
dofile(path .. "fox.lua") -- D00Med
|
|
dofile(path .. "owl.lua") -- D00Med
|
|
dofile(path .. "tortoise.lua") -- D00Med
|
|
end
|
|
|
|
if not minetest.get_modpath("mobs_monster") then
|
|
dofile(path .. "fire_spirit.lua") -- tenplus1
|
|
dofile(path .. "oerkki.lua") -- Pavel_S and PilzAdam (WTFPL)
|
|
dofile(path .. "lava_flan.lua") -- Lava Flan by Zeg9 (additional textures by JurajVajda)
|
|
end
|
|
|
|
-- 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 JAM (reduced animals mobs) loaded")
|