From bade4c581f6dff9230a655809f41e52ff5dace43 Mon Sep 17 00:00:00 2001 From: thunderdog1138 <58536412+thunderdog1138@users.noreply.github.com> Date: Sun, 15 Dec 2019 18:30:49 -0500 Subject: [PATCH] Add files via upload --- .../3d_armor_sfinv/LICENSE.txt | 18 ++++++++++++++++ .../3d_armor_sfinv/description.txt | 1 + .../minetest-3d_armor/3d_armor_sfinv/init.lua | 21 +++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 mods/minetest-3d_armor/3d_armor_sfinv/LICENSE.txt create mode 100644 mods/minetest-3d_armor/3d_armor_sfinv/description.txt create mode 100644 mods/minetest-3d_armor/3d_armor_sfinv/init.lua diff --git a/mods/minetest-3d_armor/3d_armor_sfinv/LICENSE.txt b/mods/minetest-3d_armor/3d_armor_sfinv/LICENSE.txt new file mode 100644 index 00000000..2b2a9f64 --- /dev/null +++ b/mods/minetest-3d_armor/3d_armor_sfinv/LICENSE.txt @@ -0,0 +1,18 @@ +[mod] 3d Armor sfinv integration [3d_armor_sfinv] +================================================= + +Copyright (C) 2012-2019 stujones11, Stuart Jones + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/mods/minetest-3d_armor/3d_armor_sfinv/description.txt b/mods/minetest-3d_armor/3d_armor_sfinv/description.txt new file mode 100644 index 00000000..0ef2ae93 --- /dev/null +++ b/mods/minetest-3d_armor/3d_armor_sfinv/description.txt @@ -0,0 +1 @@ +Adds 3d_armor page to the sfinv inventory diff --git a/mods/minetest-3d_armor/3d_armor_sfinv/init.lua b/mods/minetest-3d_armor/3d_armor_sfinv/init.lua new file mode 100644 index 00000000..a9371278 --- /dev/null +++ b/mods/minetest-3d_armor/3d_armor_sfinv/init.lua @@ -0,0 +1,21 @@ +-- support for i18n +local S = armor_i18n.gettext + +if not minetest.global_exists("sfinv") then + minetest.log("warning", S("3d_armor_sfinv: Mod loaded but unused.")) + return +end + +sfinv.register_page("3d_armor:armor", { + title = S("Armor"), + get = function(self, player, context) + local name = player:get_player_name() + local formspec = armor:get_armor_formspec(name, true) + return sfinv.make_formspec(player, context, formspec, false) + end +}) +armor:register_on_update(function(player) + if sfinv.enabled then + sfinv.set_player_inventory_formspec(player) + end +end)