Skip to content

Commit

Permalink
添加玩家没有绑定时占位符会显示的提示
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Josef committed May 22, 2020
1 parent 81174db commit dcd4f6e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>moe.feo</groupId>
<artifactId>BBSToper</artifactId>
<version>3.5.2</version>
<version>3.5.3</version>
<repositories>
<repository>
<id>spigot-repo</id>
Expand Down
2 changes: 1 addition & 1 deletion resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: BBSToper
main: moe.feo.bbstoper.BBSToper
version: 3.5.2
version: 3.5.3
author: Fengshuai(R_Josef)
website: https://www.mcbbs.net/thread-789082-1-1.html
softdepend: [PlaceholderAPI]
Expand Down
12 changes: 10 additions & 2 deletions src/moe/feo/bbstoper/PAPIExpansion.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,18 @@ public String onPlaceholderRequest(Player player, String identifier) {
if (player != null) {// 有玩家
poster = sql.getPoster(player.getUniqueId().toString());
if (identifier.equals("bbsid")) {// BBS用户名
return poster.getBbsname();
if (poster == null) {
return Message.GUI_NOTBOUND.getString();
} else {
return poster.getBbsname();
}
}
if (identifier.equals("posttimes")) {// 顶贴次数
return String.valueOf(poster.getTopStates().size());
if (poster == null) {
return Message.GUI_NOTBOUND.getString();
} else {
return String.valueOf(poster.getTopStates().size());
}
}
}
if (identifier.equals("pageid")) {// 宣传贴id
Expand Down

0 comments on commit dcd4f6e

Please sign in to comment.