diff --git a/mods/mobs/init.lua b/mods/mobs/init.lua new file mode 100644 index 00000000..f63fb164 --- /dev/null +++ b/mods/mobs/init.lua @@ -0,0 +1,19 @@ + +local path = minetest.get_modpath("mobs") + +-- Mob API +dofile(path .. "/api.lua") + +-- Rideable Mobs +dofile(path .. "/mount.lua") + +-- Mob Items +dofile(path .. "/crafts.lua") + +-- Mob Spawner +dofile(path .. "/spawner.lua") + +-- Lucky Blocks +dofile(path .. "/lucky_block.lua") + +minetest.log("action", "[MOD] Mobs Redo loaded") diff --git a/mods/mobs/intllib.lua b/mods/mobs/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/mobs/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/mobs/license.txt b/mods/mobs/license.txt new file mode 100644 index 00000000..fec6f6aa --- /dev/null +++ b/mods/mobs/license.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 TenPlus1 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/mods/mobs/lucky_block.lua b/mods/mobs/lucky_block.lua new file mode 100644 index 00000000..b823e832 --- /dev/null +++ b/mods/mobs/lucky_block.lua @@ -0,0 +1,18 @@ + +if minetest.get_modpath("lucky_block") then + + lucky_block:add_blocks({ + {"dro", {"mobs:meat_raw"}, 5}, + {"dro", {"mobs:meat"}, 5}, + {"dro", {"mobs:nametag"}, 1}, + {"dro", {"mobs:leather"}, 5}, + {"dro", {"default:stick"}, 10}, + {"dro", {"mobs:net"}, 1}, + {"dro", {"mobs:lasso"}, 1}, + {"dro", {"mobs:shears"}, 1}, + {"dro", {"mobs:protector"}, 1}, + {"dro", {"mobs:fence_wood"}, 10}, + {"dro", {"mobs:fence_top"}, 12}, + {"lig"} + }) +end diff --git a/mods/mobs/mod.conf b/mods/mobs/mod.conf new file mode 100644 index 00000000..f3a3ad74 --- /dev/null +++ b/mods/mobs/mod.conf @@ -0,0 +1 @@ +name = mobs