-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(commands): Accidentally mark arguments as nullable after suggests call feat(commands): Add Args class for simplicity
- Loading branch information
Showing
3 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
idofront-commands/src/main/kotlin/com/mineinabyss/idofront/commands/brigadier/Args.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.mineinabyss.idofront.commands.brigadier | ||
|
||
import com.mojang.brigadier.arguments.* | ||
import io.papermc.paper.command.brigadier.argument.ArgumentTypes | ||
|
||
object Args { | ||
fun word() = StringArgumentType.word() | ||
fun string() = StringArgumentType.string() | ||
fun greedyString() = StringArgumentType.greedyString() | ||
|
||
fun bool() = BoolArgumentType.bool() | ||
|
||
fun double(min: Double = Double.MIN_VALUE, max: Double = Double.MAX_VALUE) = | ||
DoubleArgumentType.doubleArg(min, max) | ||
|
||
fun float(min: Float = Float.MIN_VALUE, max: Float = Float.MAX_VALUE) = | ||
FloatArgumentType.floatArg(min, max) | ||
|
||
fun integer(min: Int = Int.MIN_VALUE, max: Int = Int.MAX_VALUE) = | ||
IntegerArgumentType.integer(min, max) | ||
|
||
|
||
fun long(min: Long = Long.MIN_VALUE, max: Long = Long.MAX_VALUE) = | ||
LongArgumentType.longArg(min, max) | ||
} | ||
|
||
typealias ArgsMinecraft = ArgumentTypes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters