diff --git a/.gitignore b/.gitignore index 3a55b6c..c1b77f3 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,6 @@ bin/ protected -.idea \ No newline at end of file +.idea +secret/gradle.properties +secret/secret.txt diff --git a/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/dsl/ExecutorContext.kt b/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/dsl/ExecutorContext.kt index 756e31f..ed76bf0 100644 --- a/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/dsl/ExecutorContext.kt +++ b/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/dsl/ExecutorContext.kt @@ -36,19 +36,19 @@ class ExecutorContext(var sender: CommandSender, val args: Array) { MessagesService.byTag("#no-such-material")(sender) 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 = worldOrNull(index) ?: run { MessagesService.byTag("#no-such-world")(sender) 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 = worldOrNull(index) ?: run { MessagesService.byTag("#no-such-player")(sender) throw TypeParseException() } - fun offlinePlayer(index: Int): OfflinePlayer = Bukkit.getOfflinePlayer(string(index)) + fun offlinePlayer(index: Int): OfflinePlayer = Bukkit.getOfflinePlayer(argument(index) ?: "") } \ No newline at end of file