use group:leather in recipe if mobs mod found

This commit is contained in:
tenplus1 2023-10-20 07:46:48 +01:00
parent 01720dd39e
commit 0abf6cbb19
3 changed files with 10 additions and 28 deletions

View File

@ -11,19 +11,8 @@ Tweaked by TenPlus1 and Security improvements by Krock
]]--
-- translator check for backwards compatibility
local S
if minetest.get_translator then
S = minetest.get_translator("sfinv_bags")
else
S = function(str, ...)
local args = {...}
return str:gsub("@%d+", function(match)
return args[tonumber(match:sub(2))]
end)
end
end
-- translation
local S = minetest.get_translator("sfinv_bags")
local function get_player_bag_stack(player, i)
@ -68,8 +57,7 @@ local get_formspec = function(player, page)
if page == "bag" .. i then
local image = get_player_bag_stack(player, i)
:get_definition().inventory_image
local image = get_player_bag_stack(player, i):get_definition().inventory_image
return "size[8,9]"
.. "list[current_player;bag" .. i .. "contents;0,0;8,4;]"
@ -288,13 +276,11 @@ minetest.register_tool(":bags:trolley", {
local item1 = "group:wood"
local item2 = "group:stick"
-- use leather if mobs redo found
if minetest.get_modpath("mobs") then
item1 = "mobs:leather"
-- use leather if petz found
elseif minetest.get_modpath("petz") then
item1 = "petz:leather"
-- use leather if a mobs mod is found
if minetest.get_modpath("mobs")
or minetest.get_modpath("petz")
or minetest.get_modpath("mesecraft_mobs") then
item1 = "group:leather"
end
-- use string if farming found

View File

@ -1,8 +1,4 @@
# textdomain: sfinv_bags
# author: NathanielFreeman
### init.lua ###
Bag=Bolsa
Main=Bolsas
Bags=Bolsas

View File

@ -1,4 +1,4 @@
name = sfinv_bags
description = Add a Bags tab to your inventory with craftable bags for additional inventory space.
depends = sfinv
optional_depends =
description = Adds a BAGS tab to your inventory and lets you craft different sized bags to place into each slot for additional inventory space.
min_minetest_version = 5.0