tidy code

This commit is contained in:
tenplus1
2023-08-13 10:56:57 +01:00
parent 47b757abf5
commit 797ad49600
12 changed files with 26 additions and 43 deletions

View File

@ -1,20 +1,7 @@
local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
-- Check for translation method
local S
if minetest.get_translator then
S = minetest.get_translator("mobs_animal") -- 5.x translation function
else -- boilerplate function
S = function(str, ...)
local args = {...}
return str:gsub("@%d+", function(match)
return args[tonumber(match:sub(2))]
end)
end
end
mobs.intllib_animal = S
-- Translation support
local S = minetest.get_translator("mobs_animal")
-- Check for custom mob spawn file
local input = io.open(path .. "spawn.lua", "r")
@ -62,4 +49,4 @@ if minetest.get_modpath("lucky_block") then
end
print ("[MOD] Mobs Redo Animals loaded")
print ("[MOD] Mobs Animal loaded")