stujones11 / minetest-3d_armor

Visible player armor & wielded items for minetest
Other
56 stars 98 forks source link

improve inventory_plus compatibility #134

Open bell07 opened 6 years ago

bell07 commented 6 years ago

Issue was reported in https://forum.minetest.net/viewtopic.php?t=4654&p=313023#p312975

To solve it on inventory_plus fails: https://github.com/tenplus1/inventory_plus/issues/4

Seems the inventory_plus requires sfinv for creative. Therefore if both mods are found (inventory_plus and sfinv), the 3d_armor_ip module only should be active.

My proposal is to add next lines to 3d_armor_sfinv:

if minetest.global_exists("inventory_plus") then
    minetest.log("warning", S("3d_armor_sfinv: Mod loaded but unused preferring inventory_plus"))
    return
end
tenplus1 commented 6 years ago

Why don't you just disable the 3d_armor_sfinv mod itself ? If it's not running then there is no issue.

bell07 commented 6 years ago

We guess the most players does enable the whole modpack and try to avoid errors depending on them. Therefore the inventory-compat modules does have already soft-dependencies instead of hard dependencies, and mods have at beginninc code like

if not minetest.global_exists("inventory_plus") then
    minetest.log("warning", S("3d_armor_ip: Mod loaded but unused."))
    return
end

Of course an experienced server admin can solve the issue without any change in mod just by disabling the mod.

stujones11 commented 6 years ago

This seems like a reasonable fix, I can see no good reason for the sfinv module to load if either of the other modules are in use, so this should perhaps include ui too?

It shouldn't be a big deal for someone to just disable the module manually but if we can make it a bit more user-friendly then, why not? At the very least, I guess this should be documented.

@bell07 Thank you once more for your assistance with this.