Remove 'default dependency

Make the 'default' dependency optional

This commit introduces compatibility functions needed by the
3d_armor mods to adapt to the game that is being used.

Added license information to LICENSE.md in the modpack folder.

Co-authored-by: Sheriff U3 <210896603+Sheriff-Unit-3@users.noreply.github.com>
This commit is contained in:
SmallJoker
2025-12-02 15:56:38 -06:00
parent 063505f9ea
commit baa16e28cb
15 changed files with 127 additions and 99 deletions

View File

@@ -8,6 +8,11 @@ local worldpath = minetest.get_worldpath()
local last_punch_time = {}
local timer = 0
armor = {
version = "0.4.13"
}
dofile(modpath.."/gamecompat.lua")
dofile(modpath.."/api.lua")
-- local functions
@@ -480,10 +485,12 @@ end)
if armor.config.fire_protect == true then
-- make torches hurt
minetest.override_item("default:torch", {damage_per_second = 1})
minetest.override_item("default:torch_wall", {damage_per_second = 1})
minetest.override_item("default:torch_ceiling", {damage_per_second = 1})
if core.get_modpath("default") then
-- make torches hurt
minetest.override_item("default:torch", {damage_per_second = 1})
minetest.override_item("default:torch_wall", {damage_per_second = 1})
minetest.override_item("default:torch_ceiling", {damage_per_second = 1})
end
-- check player damage for any hot nodes we may be protected against
minetest.register_on_player_hpchange(function(player, hp_change, reason)