Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
javaVersion=25
mcVersion=1.21.11
group=dev.slne.surf
version=1.21.11-2.73.1
version=1.21.11-2.73.2
relocationPrefix=dev.slne.surf.surfapi.libs
snapshot=false
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ packetevents = "2.11.2"
packetevents-plugin = "2.11.2"

# Command API
commandapi = "11.1.0"
commandapi = "11.2.0"

# LuckPerms
luckperms = "v5.5.0-bukkit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import net.kyori.adventure.nbt.TagStringIO
@OptIn(NmsUseWithCaution::class)
class AdventureCompoundBinaryTagArgument(nodeName: String) :
SafeOverrideableArgument<CompoundBinaryTag, CompoundBinaryTag>(
nodeName, commandArgumentTypes.compoundTag(), { TagStringIO.tagStringIO().asString(it) }
nodeName, commandArgumentTypes::compoundTag, { TagStringIO.tagStringIO().asString(it) }
) {
override fun getPrimitiveType(): Class<CompoundBinaryTag> {
return CompoundBinaryTag::class.java
Expand All @@ -38,17 +38,20 @@ inline fun CommandTree.adventureCompoundBinaryTagArgument(
nodeName: String,
optional: Boolean = false,
block: Argument<*>.() -> Unit = {}
): CommandTree = then(AdventureCompoundBinaryTagArgument(nodeName).setOptional(optional).apply(block))
): CommandTree =
then(AdventureCompoundBinaryTagArgument(nodeName).setOptional(optional).apply(block))

inline fun Argument<*>.adventureCompoundBinaryTagArgument(
nodeName: String,
optional: Boolean = false,
block: Argument<*>.() -> Unit = {}
): Argument<*> = then(AdventureCompoundBinaryTagArgument(nodeName).setOptional(optional).apply(block))
): Argument<*> =
then(AdventureCompoundBinaryTagArgument(nodeName).setOptional(optional).apply(block))


inline fun CommandAPICommand.adventureCompoundBinaryTagArgument(
nodeName: String,
optional: Boolean = false,
block: Argument<*>.() -> Unit = {}
): CommandAPICommand = withArguments(AdventureCompoundBinaryTagArgument(nodeName).setOptional(optional).apply(block))
): CommandAPICommand =
withArguments(AdventureCompoundBinaryTagArgument(nodeName).setOptional(optional).apply(block))
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import net.kyori.adventure.text.minimessage.MiniMessage
import net.kyori.adventure.text.minimessage.ParsingException

open class MiniMessageArgument(nodeName: String) :
Argument<Component>(nodeName, StringArgumentType.string()) {
Argument<Component>(nodeName, StringArgumentType::string) {
override fun getPrimitiveType(): Class<Component> {
return Component::class.java
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ import java.util.concurrent.CompletableFuture
abstract class SuspendCustomArgument<T, B>(
private val base: Argument<B>,
private val scope: CoroutineScope = defaultScope
) : Argument<Deferred<T>>(base.nodeName, base.rawType) {
) : Argument<Deferred<T>>(base.nodeName, {
base.rawType
}) {
private val primitiveType by lazy { object : TypeToken<Deferred<T>>(javaClass) {} }

override fun instance() = this
Expand All @@ -42,7 +44,10 @@ abstract class SuspendCustomArgument<T, B>(

protected abstract inner class SuspendArgumentSuggestions : ArgumentSuggestions<CommandSource> {
@Throws(CommandSyntaxException::class)
abstract suspend fun CoroutineScope.suggest(info: SuggestionInfo<CommandSource>, builder: SuggestionsBuilder)
abstract suspend fun CoroutineScope.suggest(
info: SuggestionInfo<CommandSource>,
builder: SuggestionsBuilder
)

final override fun suggest(
info: SuggestionInfo<CommandSource>,
Expand Down