Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
cccgh5 committed Mar 30, 2024
2 parents 21e10fe + b0c2f5c commit 3ec8454
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.bukkit.Location
class DoubleCommandArgumentProvider : CommandArgumentProvider<Double> {
override suspend fun cast(context: CommandContext, argument: String?): Double {
argument ?: throw ArgumentFeedback.RequireArgument
return argument.toDouble()
return argument.toDoubleOrNull() ?: throw ArgumentFeedback.NotNumber
}

override suspend fun getTabComplete(context: CommandContext, location: Location?): List<String> {
Expand Down

0 comments on commit 3ec8454

Please sign in to comment.