AdvancedChat
一款 Fabric 模组,为游戏添加了许多有用的多人聊天功能。
功能
数据驱动的聊天频道
允许你添加不同的频道供玩家用于聊天(例如按维度、本地、工作人员等)。
这些频道完全可自定义。
使用 谓词,你可以精确控制哪些玩家会收到消息。
此外,你还可以使用 占位符 来自定义频道的发送前缀和操作栏文本。
玩家屏蔽
允许玩家屏蔽其他玩家。被屏蔽玩家的聊天消息将不会显示给屏蔽者。
屏蔽者也无法向已屏蔽他们的玩家发送私聊消息,系统会在聊天中显示错误提示。
社交监听 (Socialspy)
由于此模组增加了新的私聊方式,它还包含了一套面向工作人员的社交监听功能,支持多种模式。
这些模式允许你控制想要“监听”的消息类型,因为全部监听可能会造成干扰。
文本过滤器
允许过滤从客户端接收的特定文本,如聊天消息、命令、告示牌和书籍内容。
这是基于原版 Realms 过滤器实现的,因此它也能与使用该过滤器的其他模组兼容。
注意:除非安装了 styled-chat 模组,否则消息将在客户端进行过滤。这是为了进行验证所必需的。
在这种情况下,如果某个模组将聊天消息重定向为系统消息,它们将不会被过滤!
模组支持
此模组内置了对多个其他模组的支持。
例如,在发送消息和显示接收者时,会考虑隐身玩家的状态。
它为覆盖聊天功能的模组(如 styled-chat)添加了一个新的占位符:%advancedchat:channelprefix%
命令、权限和配置
命令
-
/advancedchat save | reload - 保存/重载配置文件以及所有聊天频道。
-
/chat <channel> - 让你在可用的聊天频道之间切换。
-
/chat <channel> <message> - 让你在不切换频道的情况下,在指定频道中发送消息。
-
/reply <message> | /r <message> - 向你最后发送过消息的玩家发送私聊消息。
-
/ignore <player> | /unignore <player> - 屏蔽/取消屏蔽指定的玩家。
-
/socialspy all | channel | private | none - 让你控制你想要接收的监听消息类型。
权限
-
advancedchat.command.reload - 使用重载命令的权限。
-
advancedchat.command.socialspy - 使用社交监听命令的权限。
-
advancedchat.bypass.ignore - 绕过屏蔽限制的权限。
-
由数据驱动聊天频道添加的任何权限。
配置
配置文件位于 /config/advancedchat.json
{
"comment": "在更改任何设置之前,请参阅 https://github.com/Wesley1808/AdvancedChat#configuration",
// 决定频道是否应显示操作栏。
"actionbar": true,
// 操作栏更新的间隔刻数。极高的值可能导致在某些情况下操作栏更新滞后。
"actionbarRefreshRate": 40,
// 如果设置为 false,当消息通过聊天频道发送时,AdvancedChat 将取消 ServerMessageEvents.CHAT_MESSAGE 事件。
// 这有助于防止某些模组(如 discord-bridges)将(私聊)频道消息发送到公共 Discord 频道。
"alwaysTriggerMessageEvent": false,
// 悬停在频道前缀上时显示的文本。默认情况下,它会显示所有收到聊天消息的玩家名称。
// 这不包括处于隐身状态或旁观者模式的玩家。
"hoverText": "<dark_aqua>接收者: <dark_gray>[${receivers}]</dark_gray>",
"receiver": "<green>${player}</green>",
"selfPrefix": "<dark_gray>[<aqua>自己</aqua>]</dark_gray> ",
// 命令反馈消息。
"messages": {
"switchedChannels": "<dark_aqua>聊天模式 -> <green>${channel}",
"switchedSocialSpy": "<dark_aqua>监听模式 -> <green>${mode}",
"ignored": "<red>${player} 正在屏蔽你。",
"ignoredPlayer": "<dark_aqua>你现在正在屏蔽 <green>${player}",
"unignoredPlayer": "<dark_aqua>你不再屏蔽 <green>${player}",
"cannotIgnoreSelf": "<red>你不能屏蔽自己!",
"alreadyIgnored": "<red>你已经在屏蔽 ${player} 了!",
"notAlreadyIgnored": "<red>你没有屏蔽 ${player}!",
"channelNotFound": "<red>找不到名为 '${name}' 的频道!"
},
// 社交监听相关配置。
"socialSpy": {
// 如果启用,将在服务器日志中记录私聊消息。
"logPrivateMessages": false,
// 决定社交监听消息的格式化方式。
"prefix": "<dark_gray>[<aqua>监听</aqua>]</dark_gray> ",
"privateMessage": "<dark_gray>[</dark_gray>${source} <gray>→</gray> ${target}<dark_gray>]</dark_gray> <gray>${message}",
"channelMessage": "${channel}${sender} <dark_gray>»</dark_gray> ${message}"
},
// 文本过滤器配置。
"filter": {
// 启用文本过滤器。
// 这是基于原版 Realms 过滤器实现的,因此除了消息外,它还将适用于告示牌、书籍等。
"enabled": false,
// 默认情况下,仅当客户端启用了文本过滤时,才会向客户端发送经过过滤的消息。
// 将其设置为 true 将使无论客户端设置如何都强制过滤消息。
"forceTextFiltering": false,
// 如果启用,每当消息被过滤时,都会在服务器日志中记录。
"logFilteredMessages": true,
// 所有需要被过滤的词汇。
"filteredWords": [
"bad-word",
"bad-word-2"
]
},
// 当玩家收到私聊消息时的音效配置。
// 当玩家收到来自频道的消息时,也有类似的配置。
"privateMessageSound": {
// 决定是否播放这些消息的音效。
"enabled": false,
// 声音事件的标识符。
"sound": "minecraft:block.note_block.bell",
// 声音事件的音量和音调。
"volume": 0.5,
"pitch": 0.6
},
// 聊天频道数组。
// 在这里可以添加、删除和修改玩家可用的聊天频道。
"channels": [
{
// 频道的名称。用于识别频道,因此请勿创建多个同名频道。
"name": "world",
// 允许禁用该频道而不将其完全移除。
"enabled": true,
// 标志位,用于确定该频道是否仅由工作人员使用。主要用于隐身支持。
"isStaff": false,
// 加入此频道所需的权限。如果没有此权限,你也无法查看此频道中的消息。
"permission": "advancedchat.channel.world",
// 可选的操作栏文本和频道前缀,供频道内的玩家显示。
// 两者都支持占位符。
"actionbar": "<dark_aqua>聊天模式: <green>%world:name%",
"prefix": "<dark_gray>[<aqua>%world:name%</aqua>] ",
// 可选的 Minecraft (JSON) 谓词,允许你精确控制谁可以查看每条消息。
// 支持通过 Predicate API 注册的任何谓词 ()。
"canSee": {
// 原版距离谓词,但它也会比较世界。
"type": "advancedchat:distance",
"value": {
// 排除水平距离发送者超过 256 格的玩家。
"horizontal": {
"min": 0.0,
"max": 256.0
}
}
}
}
]
}
AdvancedChat
A fabric mod that adds a bunch of useful multiplayer chat features to the game.
Features
Data-driven chat channels
Allows you to add different channels that players can use to chat in (e.g. per-dimension, local, staff).
These channels are completely customizable.
By using predicates you can control exactly which players receive a message.
Next to that, you can also use placeholders to customize the prefix and actionbar text from the channel.
Player ignoring
Allows players to ignore others. This will make it so that chat messages from ignored players aren't shown to them.
Players also won't be able to send private messages to others that have ignored them, showing an error in chat.
Socialspy
Since this mod adds new ways of private conversations, it also includes a socialspy for staff with different modes.
These modes allow you to control which type of messages you want to 'spy' on, as all of them could be too much.
Text Filter
Allows you to filter specific text received from the client, like chat messages, commands, signs and books.
This is based on the vanilla realms filter, so it will also work with any other mods that use it.
Note: unless styled-chat is installed, messages are filtered on the client. This is needed for validation.
In this case, if a mod redirects chat messages to system messages they will NOT be filtered!
Mod support
This mod has built-in added support for several other mods.
For example, vanished players will be taken into account when sending messages and showing receivers.
It adds a new placeholder that mods overriding chat like styled-chat can use: %advancedchat:channelprefix%
Commands, Permissions and Configuration
Commands
-
/advancedchat save | reload - Saves / Reloads the configuration file and all the chat channels.
-
/chat <channel> - Lets you switch between chat channels that are available to you.
-
/chat <channel> <message> - Lets you send a message in the specified channel, without switching.
-
/reply <message> | /r <message> - Sends a private message to the last player you messaged.
-
/ignore <player> | /unignore <player> - Ignores / Unignores the specified player.
-
/socialspy all | channel | private | none - Lets you control which spy messages you want to receive.
Permissions
-
advancedchat.command.reload - Permission to use the reload command.
-
advancedchat.command.socialspy - Permission to use the socialspy command.
-
advancedchat.bypass.ignore - Permission to bypass ignore.
-
Any permission added by the data-driven chat channels.
Configuration
The configuration file can be found at /config/advancedchat.json
{
"comment": "Before changing anything, see https://github.com/Wesley1808/AdvancedChat#configuration",
// Decides if channels should display action bars.
"actionbar": true,
// Ticks between action bar updates. Very high values may cause the actionbar to lag behind in certain situations.
"actionbarRefreshRate": 40,
// If set to false, advancedchat will cancel ServerMessageEvents.CHAT_MESSAGE if the message was sent through a chat channel.
// This may help prevent some mods like discord-bridges sending (private) channel messages in a public discord channel.
"alwaysTriggerMessageEvent": false,
// Text to display when hovering over a channel prefix. By default, it shows the names of everyone that received the chat message.
// This excludes players who are either vanished or in spectator.
"hoverText": "<dark_aqua>Receivers: <dark_gray>[${receivers}]</dark_gray>",
"receiver": "<green>${player}</green>",
"selfPrefix": "<dark_gray>[<aqua>Self</aqua>]</dark_gray> ",
// Command feedback messages.
"messages": {
"switchedChannels": "<dark_aqua>Chat Mode -> <green>${channel}",
"switchedSocialSpy": "<dark_aqua>Spy Mode -> <green>${mode}",
"ignored": "<red>${player} is ignoring you.",
"ignoredPlayer": "<dark_aqua>You are now ignoring <green>${player}",
"unignoredPlayer": "<dark_aqua>You are no longer ignoring <green>${player}",
"cannotIgnoreSelf": "<red>You cannot ignore yourself!",
"alreadyIgnored": "<red>You are already ignoring ${player}!",
"notAlreadyIgnored": "<red>You aren't ignoring ${player}!",
"channelNotFound": "<red>Unable to find a channel with name '${name}'!"
},
// Socialspy related configuration.
"socialSpy": {
// If enabled, logs private messages in the server logs.
"logPrivateMessages": false,
// Decides how socialspy messages should be formatted.
"prefix": "<dark_gray>[<aqua>Spy</aqua>]</dark_gray> ",
"privateMessage": "<dark_gray>[</dark_gray>${source} <gray>→</gray> ${target}<dark_gray>]</dark_gray> <gray>${message}",
"channelMessage": "${channel}${sender} <dark_gray>»</dark_gray> ${message}"
},
// Text filter configuration.
"filter": {
// Enables the text filter.
// This is based on the vanilla realms filter, so besides messages this will also work on signs, books, etc.
"enabled": false,
// By default, messages will only be sent as filtered to a client if they have text filtering enabled.
// Setting this to true will make it filter messages regardless of the client's settings.
"forceTextFiltering": false,
// If enabled, logs whenever a message gets filtered in the server logs.
"logFilteredMessages": true,
// All the words that should be filtered.
"filteredWords": [
"bad-word",
"bad-word-2"
]
},
// Sound configuration for when a player receives a private message.
// There is also one of these for when a player receives a message from a channel.
"privateMessageSound": {
// Decides if it should play sounds for these messages.
"enabled": false,
// The identifier of the sound event.
"sound": "minecraft:block.note_block.bell",
// The volume and pitch of the sound event.
"volume": 0.5,
"pitch": 0.6
},
// An array of chat channels.
// This is where you can add, remove and modify chat channels players can use.
"channels": [
{
// The name of the channel. This is used to identify them, so don't create multiple channels with the same name.
"name": "world",
// Allows you to disable the channel without removing it entirely.
"enabled": true,
// Flag to determine if a channel is only used by staff members. Mostly used for vanish support.
"isStaff": false,
// Permission required to join this channel. Without this permission, you also won't be able to see messages in this channel.
"permission": "advancedchat.channel.world",
// The optional actionbar text and channel prefixes to display to players inside the channel.
// Both of these support placeholders.
"actionbar": "<dark_aqua>Chat Mode: <green>%world:name%",
"prefix": "<dark_gray>[<aqua>%world:name%</aqua>] ",
// An optional minecraft (JSON) predicate, that allows you to control exactly who gets to view each message.
// Supports any predicate registered through the Predicate API (https://github.com/Patbox/PredicateAPI/blob/master/BUILTIN.md).
"canSee": {
// Vanilla distance predicate except it compares the worlds aswell.
"type": "advancedchat:distance",
"value": {
// Excludes players further than 256 blocks away from the sender horizontally.
"horizontal": {
"min": 0.0,
"max": 256.0
}
}
}
}
]
}
评论 0
登录后参与评分
还没有评论,来抢沙发吧