Compare commits
2
Commits
3835c9b9e2
...
2670443135
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2670443135 | ||
|
|
66e1f74b5c |
+1
-1
@@ -15,7 +15,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT")
|
compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT")
|
||||||
implementation("org.jetbrains.kotlin:kotlin-stdlib")
|
paperLibrary("org.jetbrains.kotlin:kotlin-stdlib")
|
||||||
implementation("net.hareworks:permits-lib:1.1")
|
implementation("net.hareworks:permits-lib:1.1")
|
||||||
}
|
}
|
||||||
tasks {
|
tasks {
|
||||||
|
|||||||
+1
-1
Submodule permits-lib updated: 90bad7f37c...72312a45e0
@@ -84,3 +84,12 @@ class EntityArgument : KommandArgument<List<Entity>> {
|
|||||||
class CoordinatesArgument : KommandArgument<io.papermc.paper.math.Position> {
|
class CoordinatesArgument : KommandArgument<io.papermc.paper.math.Position> {
|
||||||
override fun build(): ArgumentType<*> = ArgumentTypes.finePosition()
|
override fun build(): ArgumentType<*> = ArgumentTypes.finePosition()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Block position argument for integer coordinates.
|
||||||
|
* Supports relative coordinates like ~ ~1 ~-2.
|
||||||
|
* Returns a Position (io.papermc.paper.math.Position) after resolving (aligned to block).
|
||||||
|
*/
|
||||||
|
class BlockPositionArgument : KommandArgument<io.papermc.paper.math.Position> {
|
||||||
|
override fun build(): ArgumentType<*> = ArgumentTypes.blockPosition()
|
||||||
|
}
|
||||||
|
|||||||
@@ -173,6 +173,12 @@ abstract class BranchScope internal constructor(
|
|||||||
allowRelative: Boolean = true,
|
allowRelative: Boolean = true,
|
||||||
block: ValueBuilder<io.papermc.paper.math.Position>.() -> Unit = {}
|
block: ValueBuilder<io.papermc.paper.math.Position>.() -> Unit = {}
|
||||||
) = argument(name, CoordinatesArgument(), block)
|
) = argument(name, CoordinatesArgument(), block)
|
||||||
|
|
||||||
|
fun blockCoordinates(
|
||||||
|
name: String,
|
||||||
|
allowRelative: Boolean = true,
|
||||||
|
block: ValueBuilder<io.papermc.paper.math.Position>.() -> Unit = {}
|
||||||
|
) = argument(name, BlockPositionArgument(), block)
|
||||||
}
|
}
|
||||||
|
|
||||||
@KommandDsl
|
@KommandDsl
|
||||||
|
|||||||
Reference in New Issue
Block a user