mirror of
https://codeberg.org/AntumLuanti/mod-cleaner.git
synced 2025-03-15 04:41:22 +00:00
Support updating 3d_armor inventory lists via chat command...
https://content.minetest.net/packages/stu/3d_armor/
This commit is contained in:
parent
5fcc824d0e
commit
7a482de659
2 changed files with 9 additions and 3 deletions
6
TODO.txt
6
TODO.txt
|
@ -1,8 +1,8 @@
|
|||
|
||||
TODO:
|
||||
- update world file when chat commands are used
|
||||
- update player inventories when items are replaced:
|
||||
- 3d_armor
|
||||
- update storage inventories when items are replaced
|
||||
- update inventories when items are replaced:
|
||||
- creative
|
||||
- storage (chests, etc.)
|
||||
- update player inventories on login
|
||||
- fix top nodes disappearing with /replace_node command
|
||||
|
|
6
chat.lua
6
chat.lua
|
@ -213,6 +213,7 @@ local function replace_item(src, tgt)
|
|||
core.register_alias(src, tgt)
|
||||
|
||||
local bags = core.get_modpath("bags") ~= nil
|
||||
local armor = core.get_modpath("3d_armor") ~= nil
|
||||
|
||||
-- update player inventories
|
||||
for _, player in ipairs(core.get_connected_players()) do
|
||||
|
@ -224,6 +225,11 @@ local function replace_item(src, tgt)
|
|||
update_list(pinv, "bag" .. i .. "contents", src, tgt)
|
||||
end
|
||||
end
|
||||
|
||||
if armor then
|
||||
local armor_inv = core.get_inventory({type="detached", name=player:get_player_name() .. "_armor"})
|
||||
update_list(armor_inv, "armor", src, tgt)
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
|
|
Loading…
Add table
Reference in a new issue