Skip to content

Commit

Permalink
fix: add invalid name msg
Browse files Browse the repository at this point in the history
  • Loading branch information
MC-XiaoHei committed Mar 17, 2024
1 parent 6458ef1 commit 7f44b93
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/cn/xor7/iseeyou/ISeeYou.kt
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,21 @@ class ISeeYou : JavaPlugin(), CommandExecutor {
playerExecutor { player, args ->
val location = player.location
val name = args["name"] as String
if (name.length !in 4..16) {
player.sendMessage("§4摄像机名称长度必须在4-16之间!")
return@playerExecutor
}
createPhotographer(name, location)
player.sendMessage("§a成功创建摄像机:$name")
}
locationArgument("location") {
anyExecutor { sender, args ->
val location = args["location"] as Location
val name = args["name"] as String
if (name.length !in 4..16) {
sender.sendMessage("§4摄像机名称长度必须在4-16之间!")
return@anyExecutor
}
createPhotographer(name, location)
sender.sendMessage("§a成功创建摄像机:$name")
}
Expand Down

0 comments on commit 7f44b93

Please sign in to comment.