Fix 1.0.0.1
Fix arguments of command
This commit is contained in:
1 parent
e6c7eeda34
commit
050b1a5344
2 files changed
+6
-4
No files matched your search
+3
-1
@@ -43,4 +43,6 @@ bin/
|
|||||||
|
|
||||||
|
|
||||||
protected
|
protected
|
||||||
.idea
|
.idea
|
||||||
|
secret/gradle.properties
|
||||||
|
secret/secret.txt
|
||||||
+3
-3
@@ -36,19 +36,19 @@ class ExecutorContext(var sender: CommandSender, val args: Array<String>) {
|
|||||||
MessagesService.byTag("#no-such-material")(sender)
|
MessagesService.byTag("#no-such-material")(sender)
|
||||||
throw TypeParseException()
|
throw TypeParseException()
|
||||||
}
|
}
|
||||||
fun worldOrNull(index: Int): World? = Bukkit.getWorld(string(index))
|
fun worldOrNull(index: Int): World? = Bukkit.getWorld(argument(index) ?: "")
|
||||||
fun world(index: Int): World =
|
fun world(index: Int): World =
|
||||||
worldOrNull(index) ?: run {
|
worldOrNull(index) ?: run {
|
||||||
MessagesService.byTag("#no-such-world")(sender)
|
MessagesService.byTag("#no-such-world")(sender)
|
||||||
throw TypeParseException()
|
throw TypeParseException()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun playerOrNull(index: Int): Player? = Bukkit.getPlayer(string(index))
|
fun playerOrNull(index: Int): Player? = Bukkit.getPlayer(argument(index) ?: "")
|
||||||
fun player(index: Int): World =
|
fun player(index: Int): World =
|
||||||
worldOrNull(index) ?: run {
|
worldOrNull(index) ?: run {
|
||||||
MessagesService.byTag("#no-such-player")(sender)
|
MessagesService.byTag("#no-such-player")(sender)
|
||||||
throw TypeParseException()
|
throw TypeParseException()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun offlinePlayer(index: Int): OfflinePlayer = Bukkit.getOfflinePlayer(string(index))
|
fun offlinePlayer(index: Int): OfflinePlayer = Bukkit.getOfflinePlayer(argument(index) ?: "")
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user