diff options
author | Dico Karssiens <dico.karssiens@gmail.com> | 2018-09-30 17:05:42 +0100 |
---|---|---|
committer | Dico Karssiens <dico.karssiens@gmail.com> | 2018-09-30 17:05:42 +0100 |
commit | c4801757a2fda147e1cee65f70f80fb215047525 (patch) | |
tree | cc19a113ede79396b56b0adb0ebdb12d63613e2f /src/main/kotlin/io/dico/parcels2/command/ParcelParameterTypes.kt | |
parent | 7f36b6f561e17fa76c184053d46254faff69142b (diff) |
Some changes
Diffstat (limited to 'src/main/kotlin/io/dico/parcels2/command/ParcelParameterTypes.kt')
-rw-r--r-- | src/main/kotlin/io/dico/parcels2/command/ParcelParameterTypes.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/kotlin/io/dico/parcels2/command/ParcelParameterTypes.kt b/src/main/kotlin/io/dico/parcels2/command/ParcelParameterTypes.kt index 736e568..a9f5498 100644 --- a/src/main/kotlin/io/dico/parcels2/command/ParcelParameterTypes.kt +++ b/src/main/kotlin/io/dico/parcels2/command/ParcelParameterTypes.kt @@ -30,7 +30,7 @@ class ParcelParameterType(val parcelProvider: ParcelProvider) : ParameterType<Pa val regex = Regex.fromLiteral("((.+)->)?([0-9]+):([0-9]+)") override fun parse(parameter: Parameter<Parcel, Void>, sender: CommandSender, buffer: ArgumentBuffer): Parcel { - val matchResult = regex.matchEntire(buffer.next()) + val matchResult = regex.matchEntire(buffer.next()!!) ?: invalidInput(parameter, "must match (w->)?a:b (/${regex.pattern}/)") val world = parcelProvider.getTargetWorld(matchResult.groupValues[2], sender, parameter) @@ -66,7 +66,7 @@ class ProfileParameterType : ParameterType<PlayerProfile, Int>(PlayerProfile::cl val allowReal = (info and REAL) != 0 val allowFake = (info and FAKE) != 0 - val input = buffer.next() + val input = buffer.next()!! return PlayerProfile.byName(input, allowReal, allowFake) } |