Skip to content

Commit

Permalink
1.1.3 修复没权限也可以发颜色代码问题
Browse files Browse the repository at this point in the history
  • Loading branch information
handy-git committed Jun 17, 2024
1 parent 340675a commit 5947af4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

<groupId>cn.handyplus.chat</groupId>
<artifactId>PlayerChat</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
<description>一款有点好用的聊天插件</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spigot-api.vesion>1.20.2-R0.1-SNAPSHOT</spigot-api.vesion>
<lombok.version>1.18.30</lombok.version>
<HandyLib.version>3.8.7</HandyLib.version>
<spigot-api.vesion>1.21-R0.1-SNAPSHOT</spigot-api.vesion>
<lombok.version>1.18.32</lombok.version>
<HandyLib.version>3.9.8</HandyLib.version>
<placeholderapi.version>2.10.5</placeholderapi.version>
<annotations.version>24.1.0</annotations.version>
</properties>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/cn/handyplus/chat/core/ChatUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ public static String at(String message) {
if (!enable) {
return message;
}
message = BaseUtil.replaceChatColor(message);
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
if (message.contains("@" + onlinePlayer.getName())) {
message = message.replace("@" + onlinePlayer.getName(), ChatColor.BLUE + onlinePlayer.getName() + ChatColor.WHITE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ public void onChat(AsyncPlayerChatEvent event) {

// 内容黑名单处理
String message = this.blackListCheck(event);
// 有权限进行颜色代码处理
// 消息内容
chatParam.setMessage(ChatUtil.at(message));
chatParam.setHasColor(event.getPlayer().hasPermission("playerChat.color"));
// 有权限进行颜色代码处理
chatParam.setHasColor(player.hasPermission("playerChat.color"));
chatParam.setChannel(channel);
param.setType(ChatConstants.CHAT_TYPE);
param.setMessage(JsonUtil.toJson(chatParam));
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: PlayerChat
main: cn.handyplus.chat.PlayerChat
version: 1.1.2
version: 1.1.3
author: handy
api-version: 1.13
softdepend: [ PlaceholderAPI ]
Expand Down

0 comments on commit 5947af4

Please sign in to comment.