1
0
Fork 0

mcl_death_drop: allow mods to overide default behaviour

chat-command-builder-2
AFCMS 2021-07-02 18:07:29 +02:00
parent 19745cafbc
commit 3718bb6f80
1 changed files with 14 additions and 9 deletions

View File

@ -6,15 +6,8 @@ mcl_death_drop = {}
mcl_death_drop.registered_dropped_lists = {}
function mcl_death_drop.register_dropped_list(inv, listname, drop)
table.insert(mcl_death_drop.registered_dropped_lists, {inv = inv, listname = listname, drop = drop})
end
mcl_death_drop.register_dropped_list("PLAYER", "main", true)
mcl_death_drop.register_dropped_list("PLAYER", "craft", true)
mcl_death_drop.register_dropped_list("PLAYER", "armor", true)
minetest.register_on_dieplayer(function(player)
--This function can be overiden by mods
function mcl_death_drop.handler(player)
local keep = minetest.settings:get_bool("mcl_keepInventory", false)
if keep == false then
-- Drop inventory, crafting grid and armor
@ -53,4 +46,16 @@ minetest.register_on_dieplayer(function(player)
end
mcl_armor.update(player)
end
end
function mcl_death_drop.register_dropped_list(inv, listname, drop)
table.insert(mcl_death_drop.registered_dropped_lists, {inv = inv, listname = listname, drop = drop})
end
mcl_death_drop.register_dropped_list("PLAYER", "main", true)
mcl_death_drop.register_dropped_list("PLAYER", "craft", true)
mcl_death_drop.register_dropped_list("PLAYER", "armor", true)
minetest.register_on_dieplayer(function(player)
mcl_death_drop.handler(player)
end)