1
0
mirror of https://codeberg.org/tenplus1/mobs_animal.git synced 2024-12-22 17:00:26 +01:00

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,6 +1,5 @@
local S = mobs.intllib_animal
-- Translation support
local S = minetest.get_translator("mobs_animal")
-- Bee by KrupnoPavel (.b3d model by sirrobzeroone)

View File

@ -1,6 +1,5 @@
local S = mobs.intllib_animal
-- Translation support
local S = minetest.get_translator("mobs_animal")
-- Bunny by ExeterDad

View File

@ -1,6 +1,5 @@
local S = mobs.intllib_animal
-- Translation support
local S = minetest.get_translator("mobs_animal")
-- Chicken by JK Murray and Sirrobzeroone

View File

@ -1,6 +1,5 @@
local S = mobs.intllib_animal
-- Translation support
local S = minetest.get_translator("mobs_animal")
-- Cow by sirrobzeroone

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

View File

@ -1,5 +1,6 @@
-- Translation support
local S = minetest.get_translator("mobs_animal")
local S = mobs.intllib_animal
local hairball = minetest.settings:get("mobs_hairball")
local kitten_types = {

View File

@ -1,4 +1,5 @@
name = mobs_animal
description = Add farm animals and a few extra into your world.
depends = mobs
optional_depends = default, lucky_block
description = Adds farm animals.
min_minetest_version = 5.0

View File

@ -1,6 +1,5 @@
local S = mobs.intllib_animal
-- Translation support
local S = minetest.get_translator("mobs_animal")
-- Panda by AspireMint (CC BY-SA 3.0)

View File

@ -1,6 +1,5 @@
local S = mobs.intllib_animal
-- Translation support
local S = minetest.get_translator("mobs_animal")
-- Penguin by D00Med

View File

@ -1,6 +1,5 @@
local S = mobs.intllib_animal
-- Translation support
local S = minetest.get_translator("mobs_animal")
-- Rat by KPavel and PilzAdam (B3D model by sirrobzeroone)

View File

@ -1,4 +1,6 @@
local S = mobs.intllib_animal
-- Translation support
local S = minetest.get_translator("mobs_animal")
local random = math.random
local all_colours = {
{"black", S("Black"), "#212121b0"}, -- referenced down in mobs:spawn

View File

@ -1,6 +1,5 @@
local S = mobs.intllib_animal
-- Translation support
local S = minetest.get_translator("mobs_animal")
-- Warthog originally by KrupnoPavel, B3D model by sirrobzeroone