Skip to content

Commit e69d967

Browse files
committed
1.2.1 添加指令/plc clearBossBar 清理全部bossbar消息
1 parent 77ed866 commit e69d967

File tree

6 files changed

+50
-8
lines changed

6 files changed

+50
-8
lines changed

pom.xml

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

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

1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<spigot-api.vesion>1.21.4-R0.1-SNAPSHOT</spigot-api.vesion>
1515
<lombok.version>1.18.36</lombok.version>
16-
<HandyLib.version>3.15.5</HandyLib.version>
16+
<HandyLib.version>3.15.6</HandyLib.version>
1717
<placeholderapi.version>2.11.6</placeholderapi.version>
1818
<annotations.version>24.1.0</annotations.version>
1919
</properties>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package cn.handyplus.chat.command.admin;
2+
3+
import cn.handyplus.lib.command.IHandyCommandEvent;
4+
import cn.handyplus.lib.util.BossBarUtil;
5+
import org.bukkit.command.Command;
6+
import org.bukkit.command.CommandSender;
7+
8+
/**
9+
* 移除全部BossBar消息
10+
*
11+
* @author handy
12+
* @since 1.2.1
13+
*/
14+
public class ClearBossBarCommand implements IHandyCommandEvent {
15+
16+
@Override
17+
public String command() {
18+
return "clearBossBar";
19+
}
20+
21+
@Override
22+
public String permission() {
23+
return "playerChat.clearBossBar";
24+
}
25+
26+
@Override
27+
public boolean isAsync() {
28+
return true;
29+
}
30+
31+
@Override
32+
public void onCommand(CommandSender sender, Command cmd, String label, String[] args) {
33+
BossBarUtil.removeAllBossBar();
34+
}
35+
36+
}

src/main/java/cn/handyplus/chat/constants/TabListEnum.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public enum TabListEnum {
2525
/**
2626
* 第一层提醒
2727
*/
28-
FIRST(Arrays.asList("reload", "send", "give", "take", "set", "look", "channel", "tell"), 0, null, 1),
28+
FIRST(Arrays.asList("reload", "send", "give", "take", "set", "look", "channel", "tell", "clearBossBar"), 0, null, 1),
2929

3030
LOOK_TWO(null, 1, "look", 2),
3131

src/main/java/cn/handyplus/chat/hook/PlaceholderUtil.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import cn.handyplus.lib.core.StrUtil;
1111
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
1212
import org.bukkit.OfflinePlayer;
13+
import org.jetbrains.annotations.NotNull;
1314

1415
import java.util.Optional;
1516

@@ -31,7 +32,7 @@ public PlaceholderUtil(PlayerChat plugin) {
3132
* @return 结果
3233
*/
3334
@Override
34-
public String getIdentifier() {
35+
public @NotNull String getIdentifier() {
3536
return "playerChat";
3637
}
3738

@@ -43,7 +44,7 @@ public String getIdentifier() {
4344
* @return 变量
4445
*/
4546
@Override
46-
public String onRequest(OfflinePlayer player, String placeholder) {
47+
public String onRequest(OfflinePlayer player, @NotNull String placeholder) {
4748
if (player == null) {
4849
return null;
4950
}
@@ -89,7 +90,7 @@ public boolean canRegister() {
8990
* @return 结果
9091
*/
9192
@Override
92-
public String getAuthor() {
93+
public @NotNull String getAuthor() {
9394
return plugin.getDescription().getAuthors().toString();
9495
}
9596

@@ -99,7 +100,7 @@ public String getAuthor() {
99100
* @return 结果
100101
*/
101102
@Override
102-
public String getVersion() {
103+
public @NotNull String getVersion() {
103104
return plugin.getDescription().getVersion();
104105
}
105106
}

src/main/resources/languages/zh_CN.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ helps:
1717
- " &8&l- &f channel [频道名] &7切换聊天频道"
1818
- " &8&l- &f lb [喇叭类型] [消息] &7玩家使用喇叭"
1919
- " &8&l- &f tell [玩家] [消息] &7私信玩家消息"
20+
- " &8&l- &f clearBossBar &7移除全部BossBar消息"
2021

2122
noPermission: "&c你没有权限执行此命令..."
2223
noPlayerFailureMsg: "&c该命令只能玩家执行."

src/main/resources/plugin.yml

Lines changed: 5 additions & 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.2.0
3+
version: 1.2.1
44
author: handy
55
api-version: 1.13
66
softdepend: [ PlaceholderAPI ]
@@ -27,6 +27,7 @@ permissions:
2727
playerChat.channel: true
2828
playerChat.item: true
2929
playerChat.tell: true
30+
playerChat.clearBossBar: true
3031
playerChat.reload:
3132
description: 重新加载配置
3233
default: op
@@ -65,4 +66,7 @@ permissions:
6566
default: true
6667
playerChat.use.tell:
6768
description: 私信频道使用权限
69+
default: op
70+
playerChat.clearBossBar:
71+
description: 移除全部BossBar消息
6872
default: op

0 commit comments

Comments
 (0)