call irc function directly, no idea why it wasn't detected anymore

This commit is contained in:
Milan 2021-09-03 23:40:25 +02:00
parent 45825690f3
commit d6f359ed0c

View File

@ -53,12 +53,6 @@ local base = minetest.settings:get("color_boring")
local success = minetest.settings:get("color_success")
local failure = minetest.settings:get("color_failure")
if minetest.get_modpath("irc") then
bridge = 'irc'
elseif minetest.get_modpath('matrix_chat') then
bridge = 'matrix'
end
core.register_on_dieplayer(function(player)
local player_name = player:get_player_name()
local node = core.registered_nodes[core.get_node(player:get_pos()).name]
@ -68,24 +62,24 @@ core.register_on_dieplayer(function(player)
-- Death by lava
if node.groups.lava ~= nil then
core.chat_send_all(core.colorize(failure, "- ") .. string.format(core.colorize(base, messages.lava[math.random(1,#messages.lava)]), player_name))
bridge.say(string.format('*** %s died.', player_name))
irc.say(string.format('*** %s died.', player_name))
-- Death by drowning
elseif player:get_breath() == 0 then
core.chat_send_all(core.colorize(failure, "- ") .. string.format(core.colorize(base, messages.water[math.random(1,#messages.water)]), player_name))
bridge.say(string.format('*** %s died.', player_name))
irc.say(string.format('*** %s died.', player_name))
-- Death by fire
elseif node.name == 'fire:basic_flame' then
core.chat_send_all(core.colorize(failure, "* ") .. string.format(core.colorize(base, messages.fire[math.random(1,#messages.fire)]), player_name))
bridge.say(string.format('*** %s died.', player_name))
irc.say(string.format('*** %s died.', player_name))
-- Death by something else
else
core.chat_send_all(core.colorize(failure, "- ") .. string.format(core.colorize(base, messages.other[math.random(1,#messages.other)]), player_name))
bridge.say(string.format('*** %s died.', player_name))
irc.say(string.format('*** %s died.', player_name))
end
end)
minetest.register_on_respawnplayer( function(player)
local player_name = player:get_player_name()
core.chat_send_all(core.colorize(success, "* ") .. string.format(core.colorize(base, messages.respawn[math.random(1,#messages.respawn)]), player_name))
bridge.say(string.format('*** %s returns.', player_name))
irc.say(string.format('*** %s returns.', player_name))
end)