add mod identifier

dev
Tai @ Flex 2017-03-03 17:55:12 +00:00
parent e2de5399f6
commit 2493a2df5c
6 changed files with 7 additions and 7 deletions

4
API.md
View File

@ -41,7 +41,7 @@ The following (fairly pointless) module will send a mesasge to some players, dep
local probplayers = {}
chat_modes.register_mode("maybesay", {
chat_modes.register_mode("mymod:maybesay", {
help = "<prob> -- send a message to all, with a probability <prob> of sending the message at all.",
register = function(playername, params)
@ -82,7 +82,7 @@ Otherwise, the handler must return a list of players - even if that is just the
For example, this (pointless) interceptor can decline to send messages from players with "corpse" in their name (by returning false to prevent sending the message at all), or prevent delivery of messages to players with "corpse" in their name (by returning a subset of the originally received targets)
chat_modes.register_interceptor("no corpses", function(sender, message, targets)
chat_modes.register_interceptor("mymod:no_corpses", function(sender, message, targets)
if string.match(sender, "corpse") then
minetest.chat_send_player("corpses cannot talk!")
return false

View File

@ -31,7 +31,7 @@ local function needstarget(targetset, target)
end
end
chat_modes.register_interceptor("atreply", function(sender, message, targets)
chat_modes.register_interceptor("chat_modes:atreply", function(sender, message, targets)
if minetest.setting_getbool("chat_modes.no_at_replies") == false then
return targets
end

View File

@ -19,7 +19,7 @@ local function channelcheck(playername, params)
end
end
chat_modes.register_mode("channel", {
chat_modes.register_mode("chat_modes:channel", {
help = "Send messages to a specific channel only.",
can_register = function(playername, params)

View File

@ -5,7 +5,7 @@ function chat_modes.isdeaf(playername)
return deafplayers[playername]
end
minetest.register_chatcommand("deaf", {
minetest.register_chatcommand("chat_modes:deaf", {
description = "Toggle deaf status. If you are deaf (Deaf mode 'on'), you do not receive any chat messages.",
privs = {shout = true},
func = function(playername, args)

View File

@ -4,7 +4,7 @@ local playerproximitypref = {} -- playername --> (int) max message distance
local maxproximity = tonumber(minetest.setting_get("chat_modes.maxproximity") ) or 50
chat_modes.register_mode("proximity", {
chat_modes.register_mode("chat_modes:proximity", {
help = "Send messages to players within a certain distance",
register = function(playername, params)

View File

@ -1,6 +1,6 @@
-- The default-default mode - just get all connected players
chat_modes.register_mode("shout", {
chat_modes.register_mode("chat_modes:shout", {
help = "Send all messages to all non-deaf players",
getPlayers = function()