Skip to content

Commit

Permalink
feat: add permission for back death location form
Browse files Browse the repository at this point in the history
  • Loading branch information
DongShaoNB committed Oct 12, 2024
1 parent 290d2ce commit e9b9367
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 25 deletions.
21 changes: 11 additions & 10 deletions docs/en-us/start/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
## Player command
Player default have all player command permission

Overview | Command | Permission | Picture
----- | ----- |------------------------------------| ---
Teleport form | /tpgui | bedrockplayersupport.command.tpgui | https://img.fastmirror.net/s/2024/06/11/6668173a6185b.png
Home form | /homegui | bedrockplayersupport.command.homegui | https://img.fastmirror.net/s/2024/06/11/6668011935ed8.png
Msg form | /msggui | bedrockplayersupport.command.msggui | https://img.fastmirror.net/s/2024/06/11/6668173b46e99.png
Warp form | /warpgui | bedrockplayersupport.command.warpgui | https://img.fastmirror.net/s/2024/07/30/66a8c986bf98f.png
| Overview | Command | Permission | Picture |
|--------------------------|----------|--------------------------------------|-----------------------------------------------------------|
| Teleport form | /tpgui | bedrockplayersupport.command.tpgui | https://img.fastmirror.net/s/2024/06/11/6668173a6185b.png |
| Home form | /homegui | bedrockplayersupport.command.homegui | https://img.fastmirror.net/s/2024/06/11/6668011935ed8.png |
| Msg form | /msggui | bedrockplayersupport.command.msggui | https://img.fastmirror.net/s/2024/06/11/6668173b46e99.png |
| Warp form | /warpgui | bedrockplayersupport.command.warpgui | https://img.fastmirror.net/s/2024/07/30/66a8c986bf98f.png |
| Back death location form | * | bedrockplayersupport.form.backdeath | https://img.fastmirror.net/s/2024/06/11/6668173a0ef47.png |

## Admin command
OP default have all admin command permission

Overview | Command | Permission
----- | ----- |------------------------------------
Check status | /bedrockplayersupport(bps) status | bedrockplayersupport.admin
Reload file | /bedrockplayersupport(bps) reload | bedrockplayersupport.admin
| Overview | Command | Permission |
|--------------|-----------------------------------|----------------------------|
| Check status | /bedrockplayersupport(bps) status | bedrockplayersupport.admin |
| Reload file | /bedrockplayersupport(bps) reload | bedrockplayersupport.admin |

**Last edit: {docsify-updated}**
21 changes: 11 additions & 10 deletions docs/zh-cn/start/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
## 玩家命令
玩家默认拥有全部玩家命令权限

简述 | 命令 | 权限 | 图片
----- | ----- |------------------------------------| ---
传送表单 | /tpgui | bedrockplayersupport.command.tpgui | https://img.fastmirror.net/s/2024/06/11/6668173a6185b.png
家表单 | /homegui | bedrockplayersupport.command.homegui | https://img.fastmirror.net/s/2024/06/11/6668011935ed8.png
消息表单 | /msggui | bedrockplayersupport.command.msggui | https://img.fastmirror.net/s/2024/06/11/6668173b46e99.png
传送点表单 | /warpgui | bedrockplayersupport.command.warpgui | https://img.fastmirror.net/s/2024/07/30/66a8c986bf98f.png
| 简述 | 命令 | 权限 | 图片 |
|---------|----------|--------------------------------------|-----------------------------------------------------------|
| 传送表单 | /tpgui | bedrockplayersupport.command.tpgui | https://img.fastmirror.net/s/2024/06/11/6668173a6185b.png |
| 家表单 | /homegui | bedrockplayersupport.command.homegui | https://img.fastmirror.net/s/2024/06/11/6668011935ed8.png |
| 消息表单 | /msggui | bedrockplayersupport.command.msggui | https://img.fastmirror.net/s/2024/06/11/6668173b46e99.png |
| 传送点表单 | /warpgui | bedrockplayersupport.command.warpgui | https://img.fastmirror.net/s/2024/07/30/66a8c986bf98f.png |
| 返回死亡点表单 | * | bedrockplayersupport.form.backdeath | https://img.fastmirror.net/s/2024/06/11/6668173a0ef47.png |

## 管理员命令
OP默认拥有全部管理员命令权限

简述 | 命令 | 权限
----- | ----- |------------------------------------
查看状态 | /bedrockplayersupport(bps) status | bedrockplayersupport.admin
重载文件 | /bedrockplayersupport(bps) reload | bedrockplayersupport.admin
| 简述 | 命令 | 权限 |
|------|-----------------------------------|----------------------------|
| 查看状态 | /bedrockplayersupport(bps) status | bedrockplayersupport.admin |
| 重载文件 | /bedrockplayersupport(bps) reload | bedrockplayersupport.admin |

**最后编辑: {docsify-updated}**
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ class PlayerRespawnListener : Listener {
if (BedrockPlayerSupport.floodgateApi.isFloodgatePlayer(uuid)) {
val mainConfig = BedrockPlayerSupport.mainConfigManager.getConfigData()
if (mainConfig.enableBackDeathLocForm()) {
BedrockPlayerSupport.scheduler
.runTaskLaterAsynchronously(
{ BedrockPlayerSupport.mainForm.openBedrockBackDeathLocForm(player) },
mainConfig.backDeathLocFormOpenDelayTick()
)
if (player.hasPermission("bedrockplayersupport.form.backdeath")) {
BedrockPlayerSupport.scheduler
.runTaskLaterAsynchronously(
{ BedrockPlayerSupport.mainForm.openBedrockBackDeathLocForm(player) },
mainConfig.backDeathLocFormOpenDelayTick()
)
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@ permissions:
default: true
bedrockplayersupport.command.kitgui:
description: "Bedrock player kit form permission"
default: true
bedrockplayersupport.form.backdeath:
description: "Bedrock player back death location form permission"
default: true

0 comments on commit e9b9367

Please sign in to comment.