mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 05:43:43 +01:00
Implement showDeathMessages gamerule
This commit is contained in:
parent
4c0bc279af
commit
882e00b819
@ -1,6 +1,10 @@
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local ASSIST_TIMEOUT_SEC = 5
|
||||
local gamerule_showDeathMessages = vl_tuning.setting("gamerule:showDeathMessages", "bool", {
|
||||
description = S("Whether death messages are put into chat when a player dies. Also affects whether a message is sent to the pet's owner when the pet dies."),
|
||||
default = minetest.settings:get_bool("mcl_showDeathMessages", true),
|
||||
})
|
||||
|
||||
mcl_death_messages = {
|
||||
assist = {},
|
||||
@ -204,9 +208,7 @@ local function fallback_translator(s)
|
||||
end
|
||||
|
||||
mcl_damage.register_on_death(function(obj, reason)
|
||||
if not minetest.settings:get_bool("mcl_showDeathMessages", true) then
|
||||
return
|
||||
end
|
||||
if not gamerule_showDeathMessages[1] then return end
|
||||
|
||||
local send_to
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
name = mcl_death_messages
|
||||
author = 4Evergreen4
|
||||
description = Shows messages in chat when a player dies.
|
||||
depends = mcl_colors, mcl_damage
|
||||
depends = mcl_colors, mcl_damage, vl_tuning
|
||||
|
Loading…
Reference in New Issue
Block a user