forked from mtcontrib/mob_horse
Compare commits
7 Commits
d0ccec70cb
...
af59d1e2b7
Author | SHA1 | Date | |
---|---|---|---|
af59d1e2b7 | |||
4022ae9a02 | |||
f7ac229ccf | |||
6d4701ca5f | |||
8996ad27d8 | |||
f550d5b4a1 | |||
9e0021a0f8 |
29
init.lua
29
init.lua
@ -1,8 +1,29 @@
|
|||||||
|
|
||||||
-- Load support for intllib.
|
-- Load support for intllib.
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
local MP = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
||||||
local S = minetest.get_translator and minetest.get_translator("mob_horse") or
|
|
||||||
dofile(MP .. "intllib.lua")
|
-- Check for translation method
|
||||||
|
local S
|
||||||
|
if minetest.get_translator ~= nil then
|
||||||
|
S = minetest.get_translator("mob_horse") -- 5.x translation function
|
||||||
|
else
|
||||||
|
if minetest.get_modpath("intllib") then
|
||||||
|
dofile(minetest.get_modpath("intllib") .. "/init.lua")
|
||||||
|
if intllib.make_gettext_pair then
|
||||||
|
gettext, ngettext = intllib.make_gettext_pair() -- new gettext method
|
||||||
|
else
|
||||||
|
gettext = intllib.Getter() -- old text file method
|
||||||
|
end
|
||||||
|
S = gettext
|
||||||
|
else -- boilerplate function
|
||||||
|
S = function(str, ...)
|
||||||
|
local args = {...}
|
||||||
|
return str:gsub("@%d+", function(match)
|
||||||
|
return args[tonumber(match:sub(2))]
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- 0.4.17 or 5.0 check
|
-- 0.4.17 or 5.0 check
|
||||||
@ -12,7 +33,7 @@ if minetest.features.object_independent_selectionbox then
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- horse shoes (speed, jump, break, overlay texture)
|
-- horse shoes (speed, jump, brake/reverse speed, overlay texture)
|
||||||
local shoes = {
|
local shoes = {
|
||||||
["mobs:horseshoe_steel"] = {7, 4, 2, "mobs_horseshoe_steelo.png"},
|
["mobs:horseshoe_steel"] = {7, 4, 2, "mobs_horseshoe_steelo.png"},
|
||||||
["mobs:horseshoe_bronze"] = {7, 4, 4, "mobs_horseshoe_bronzeo.png"},
|
["mobs:horseshoe_bronze"] = {7, 4, 4, "mobs_horseshoe_bronzeo.png"},
|
||||||
@ -63,7 +84,7 @@ mobs:register_mob("mob_horse:horse", {
|
|||||||
armor = 200,
|
armor = 200,
|
||||||
lava_damage = 5,
|
lava_damage = 5,
|
||||||
fall_damage = 5,
|
fall_damage = 5,
|
||||||
water_damage = 1,
|
water_damage = 0,
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:leather", chance = 1, min = 0, max = 2}
|
{name = "mobs:leather", chance = 1, min = 0, max = 2}
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
-- Support for the old multi-load method
|
|
||||||
dofile(minetest.get_modpath("intllib").."/init.lua")
|
|
||||||
|
|
Reference in New Issue
Block a user