mirror of
https://github.com/jie65535/gc-openchat-plugin.git
synced 2025-07-31 18:39:56 +08:00
Update README
Fix permission issue Add repo url to onEnable log
This commit is contained in:
parent
435bcd1cb4
commit
86c2b9ae13
@ -16,7 +16,7 @@ Talking to the server account in the game is equivalent to sending to the world
|
||||
|
||||
## Install
|
||||
|
||||
1. Download the `jar` in Release.
|
||||
1. Download the `jar` in [Release](https://github.com/jie65535/gc-openchat-plugin/releases).
|
||||
2. Put it in the `plugins` folder.
|
||||
|
||||
## Commands
|
||||
@ -25,8 +25,8 @@ Player command:
|
||||
- `/chat off` block chat messages
|
||||
|
||||
Server command (requires `server.chat.others` permissions) :
|
||||
- `/serverchat on` Enable server chat (default) (do not save)
|
||||
- `/serverchat off` Disable server chat (without saving)
|
||||
- `/serverchat on` Enable server chat (default) (not save)
|
||||
- `/serverchat off` Disable server chat (not saving)
|
||||
- `/serverchat ban|mute @uid [time(Minutes)]` Mute the specified player for the specified time (minutes) (optional)
|
||||
- `/serverchat unban|unmute @uid` Unmute a specified player
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
## 安装
|
||||
|
||||
1. 在 Release 下载`jar`
|
||||
1. 在 [Release](https://github.com/jie65535/gc-openchat-plugin/releases) 下载`jar`
|
||||
2. 放入 `plugins` 文件夹即可
|
||||
|
||||
## 命令
|
||||
|
@ -8,14 +8,15 @@ public final class EventListeners {
|
||||
|
||||
public static void onJoin(PlayerJoinEvent event) {
|
||||
// 检查聊天系统是否被其它插件替换
|
||||
if (!(plugin.getServer().getChatSystem() instanceof OpenChatSystem)) {
|
||||
plugin.getLogger().warn("聊天系统已被其它插件更改,现已重置为 OpenChat !");
|
||||
plugin.getServer().setChatSystem(new OpenChatSystem(plugin));
|
||||
}
|
||||
// 不再检查
|
||||
// if (!(plugin.getServer().getChatSystem() instanceof OpenChatSystem)) {
|
||||
// plugin.getLogger().warn("聊天系统已被其它插件更改,现已重置为 OpenChat !");
|
||||
// plugin.getServer().setChatSystem(new OpenChatSystem(plugin));
|
||||
// }
|
||||
|
||||
if (!config.sendJoinMessage || config.joinMessage.isEmpty())
|
||||
return;
|
||||
plugin.getLogger().debug(String.format("玩家 %s(%d) 加入游戏,发送加入消息",
|
||||
plugin.getLogger().debug(String.format("Player %s(%d) joined the game, send join message.",
|
||||
event.getPlayer().getNickname(), event.getPlayer().getUid()));
|
||||
event.getPlayer().dropMessage(config.joinMessage);
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ public final class OpenChatPlugin extends Plugin {
|
||||
getServer().setChatSystem(new OpenChatSystem(this));
|
||||
|
||||
// Log a plugin status message.
|
||||
getLogger().info("[OpenChat] Enabled.");
|
||||
getLogger().info("[OpenChat] Enabled, see https://github.com/jie65535/gc-openchat-plugin");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,7 +7,7 @@ import emu.grasscutter.game.player.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Command(label = "chat", usage = { "<on|off>" })
|
||||
@Command(label = "chat", usage = { "<on|off>" }, permissionTargeted = "player.chat.others")
|
||||
public class ChatPlayerCommands implements CommandHandler {
|
||||
@Override
|
||||
public void execute(Player sender, Player targetPlayer, List<String> args) {
|
||||
|
Loading…
Reference in New Issue
Block a user