Skip to content

Commit

Permalink
update: 添加check变量用于检测领取状态
Browse files Browse the repository at this point in the history
  • Loading branch information
BingZi-233 committed Jun 17, 2024
1 parent f3cd0bd commit b702925
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@
## 注意

1. 由于各种原因,我们目前无法完成对1.20.x版本的兼容计划。
2. 代码质量检测因为我把检测服务器~~~~坏了一直没修......所以现在只有在GitHub上面才能看到检测报告。

## Link

> 如果你在使用过程中有任何疑问,都推荐你先看看WIKI。虽然WIKI并没有覆盖插件所有功能,但是已经足够解决大部分问题。
- [WIki](https://www.yuque.com/sakuraziyou/bilibili_video)
- [Github](https://github.com/BingZi-233/BilibiliVideo)
- [CI/CD](https://ci-dev.bingzi.online/job/BilibiliVideo)

> 注:
> 1. 若插件启动时提示有新版本,在[Github](https://github.com/BingZi-233/BilibiliVideo)
上并没有看到。请移步到[CI/CD](https://ci-dev.bingzi.online/job/BilibiliVideo)上下载,更新检测是准确的。
> 2. 插件的信息前缀在lang/zh_CN.yml里面修改
> 3. 【注意】请在CI/CD或者Github上下载,其他地方(包括群文件)的文件均不受支持。
## 命令

Expand All @@ -34,6 +43,7 @@
- bilibilivideo receive [bv] - 领取奖励命令 - 默认为Show模式
- bilibilivideo receive [bv] show - 领取奖励命令(查看模式,并不会使用玩家账户三连视频)
- bilibilivideo receive [bv] auto - 领取奖励命令(自动模式,会使用玩家账户三连视频后根据结果决定是否发放奖励)
- bilibilivideo video [bv] - 生成视频传送门二维码,扫描自动跳转视频页面
- bilibilivideo version - 查看插件版本

## 权限
Expand All @@ -48,6 +58,15 @@
- BilibiliVideo.command.receive - 领取奖励命令的权限,默认全员可用
- BilibiliVideo.command.version - 查看插件版本命令的权限,默认仅OP可用

## 变量

- %BilibiliVideo_uid% - 绑定账户UID,若为绑定显示为 N/A
- 1.4.4之后可用
- %BilibiliVideo_uname% - 绑定账户名称,若为绑定显示为 N/A
- 1.4.4之后可用
- %BilibiliVideo_check_[bv]% - 是否领取对应BV视频奖励,若为未领取显示为 false,领取显示为 true
- 1.6.2之后可用

## 配置文件

```yaml
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=online.bingzi.bilibili.video
version=1.6.1
version=1.6.2
kotlin.experimental.tryK2=true
kapt.use.k2=true
kotlin.incremental=true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package online.bingzi.bilibili.video.internal.expand

import online.bingzi.bilibili.video.internal.cache.bvCache
import online.bingzi.bilibili.video.internal.cache.midCache
import online.bingzi.bilibili.video.internal.cache.unameCache
import org.bukkit.entity.Player
Expand All @@ -19,10 +20,22 @@ object PlaceholderExpand : PlaceholderExpansion {
if (player == null) {
return "N/A"
}
return when (args) {
"uid" -> midCache[player.uniqueId] ?: "N/A-缓存"
"uname" -> unameCache[player.uniqueId] ?: "N/A-缓存"
else -> "N/A-未知参数"
val argsList: List<String> = args.split("_")
return when (argsList.size) {
1 -> when (args) {
"uid" -> midCache[player.uniqueId] ?: "N/A-缓存"
"uname" -> unameCache[player.uniqueId] ?: "N/A-缓存"

else -> "N/A-未知参数"
}

2 -> when (argsList[0]) {
"check" -> (bvCache.get(Pair(player.uniqueId, argsList[1]))?.toString() ?: "false").lowercase()

else -> "N/A"
}

else -> "N/A"
}
}
}

0 comments on commit b702925

Please sign in to comment.