mckaygerhard 93f17cd1f6 mods - 3darmor - upgraded, feature Added, nil checks, vulnerability checks
* Added the possibility to wear the armor on rightclick backported
  from https://github.com/minetest-mods/3d_armor/pull/16
* fix not being able to place armor on anvil due new right click
* fix armor equip/unequip initial implmentation
  that backports https://github.com/minetest-mods/3d_armor/pull/17
  solving a number of problems with the new right-click armor equipping
* fix callbacks not being called by armor.equip() and `armor.unequip()`
* fix player physics player_physics_locked attribute
* add feather falling
* prevents a crash when a pipeworks deployer tries to equip armor
* Fix typo in wieldview caused by skindb crash when player joins
* update and added nether lava and lava crust to fire protection list.
* fix bug Armor still damageable in (pvp) protected area
* Fix detached inventory vulnerability complete checks
* Fix count when armor is destroyed, option to prevent physics override
* update version to 0.4.15 that works with 0.4.X and 5.X engines
2023-07-24 14:36:56 -04:00

41 lines
1.2 KiB
Lua

-- support for i18n
local S = armor_i18n.gettext
local F = minetest.formspec_escape
if not minetest.global_exists("inventory_plus") then
minetest.log("warning", "[3d_armor_ip]: Mod loaded but unused.")
return
end
armor.formspec = "size[8,8.5]button[6,0;2,0.5;main;"..F(S("Back")).."]"..armor.formspec
armor:register_on_update(function(player)
local name = player:get_player_name()
local formspec = armor:get_armor_formspec(name, true)
local page = player:get_inventory_formspec()
if page:find("detached:"..name.."_armor") then
inventory_plus.set_inventory_formspec(player, formspec)
end
end)
if minetest.get_modpath("crafting") then
inventory_plus.get_formspec = function(player, page)
end
end
minetest.register_on_joinplayer(function(player)
inventory_plus.register_button(player,"armor", S("Armor"))
end)
minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields.armor then
local name = armor:get_valid_player(player, "[on_player_receive_fields]")
if not name then
return
end
local formspec = armor:get_armor_formspec(name, true)
inventory_plus.set_inventory_formspec(player, formspec)
end
end)
minetest.log("[3d_armor_ip]: Mod loaded successfully.")