Skip to content

Commit 85e37f3

Browse files
committed
1.3.1 @优化
1 parent d553f5a commit 85e37f3

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66

77
<groupId>cn.handyplus.chat</groupId>
88
<artifactId>PlayerChat</artifactId>
9-
<version>1.3.0</version>
9+
<version>1.3.1</version>
1010
<description>一款有点好用的聊天插件</description>
1111

1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14-
<spigot-api.vesion>1.21.5-R0.1-SNAPSHOT</spigot-api.vesion>
15-
<lombok.version>1.18.36</lombok.version>
16-
<HandyLib.version>3.20.5</HandyLib.version>
14+
<spigot-api.vesion>1.21.6-R0.1-SNAPSHOT</spigot-api.vesion>
15+
<HandyLib.version>3.21.5</HandyLib.version>
16+
<lombok.version>1.18.38</lombok.version>
17+
<annotations.version>26.0.2</annotations.version>
1718
<placeholderapi.version>2.11.6</placeholderapi.version>
18-
<annotations.version>24.1.0</annotations.version>
1919
</properties>
2020

2121
<dependencies>
@@ -56,7 +56,7 @@
5656
<plugin>
5757
<groupId>org.apache.maven.plugins</groupId>
5858
<artifactId>maven-compiler-plugin</artifactId>
59-
<version>3.8.1</version>
59+
<version>3.14.0</version>
6060
<configuration>
6161
<source>1.8</source>
6262
<target>1.8</target>
@@ -69,7 +69,7 @@
6969
<plugin>
7070
<groupId>org.apache.maven.plugins</groupId>
7171
<artifactId>maven-shade-plugin</artifactId>
72-
<version>3.2.4</version>
72+
<version>3.6.0</version>
7373
<configuration>
7474
<createDependencyReducedPom>false</createDependencyReducedPom>
7575
<artifactSet>

src/main/java/cn/handyplus/chat/core/ChatUtil.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,11 @@ public static String at(List<String> mentionedPlayers, String message) {
259259
if (!enable) {
260260
return message;
261261
}
262-
// 如何存在玩家自动添加@
263-
boolean contains = Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList()).contains(message);
264-
if (contains) {
265-
message = "@" + message;
262+
List<String> messageList = StrUtil.strToStrList(message, " ");
263+
for (String name : messageList) {
264+
if (CollUtil.contains(ChatConstants.PLAYER_LIST, name)) {
265+
message = message.replaceFirst(name, "@" + name);
266+
}
266267
}
267268
// 提取@的玩家名
268269
mentionedPlayers.addAll(PatternUtil.extractAtTags(message));

src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: PlayerChat
22
main: cn.handyplus.chat.PlayerChat
3-
version: 1.3.0
3+
version: 1.3.1
44
author: handy
55
api-version: 1.13
66
softdepend: [ PlaceholderAPI ]

0 commit comments

Comments
 (0)