Skip to content

Commit

Permalink
some
Browse files Browse the repository at this point in the history
  • Loading branch information
FiLKoNd committed Nov 13, 2024
1 parent cfb2626 commit 6ce7ec6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ subprojects {
apply(plugin = "maven-publish")

group = "com.filkond"
version = "1.0.9"
version = "1.1.0"

repositories {
mavenCentral()
Expand Down Expand Up @@ -63,7 +63,7 @@ subprojects {
}

kotlin {
jvmToolchain(21)
jvmToolchain(17)
}

tasks.test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ private val legacySerializer = LegacyComponentSerializer.legacyAmpersand()
fun String.deserialize(vararg resolvers: TagResolver, isLegacy: Boolean = false): Component =
if (isLegacy) legacySerializer.deserialize(this) else mmSerializer.deserialize(this, *resolvers)

fun Collection<String>.deserialize(vararg resolvers: TagResolver, isLegacy: Boolean = false): Collection<Component> =
fun <T : Collection<String>> T.deserialize(vararg resolvers: TagResolver, isLegacy: Boolean = false): List<Component> =
map { it.deserialize(*resolvers, isLegacy = isLegacy) }

fun Component.serialize(isLegacy: Boolean = false): String = let { if (isLegacy) legacySerializer else mmSerializer }.serialize(this)
fun Collection<Component>.serialize(isLegacy: Boolean = false): Collection<String> = map { it.serialize(isLegacy) }

infix fun String.with(value: Any): TagResolver = Placeholder.parsed(this, value.toString())
infix fun String.resolver(value: Any): TagResolver = Placeholder.parsed(this, value.toString())

0 comments on commit 6ce7ec6

Please sign in to comment.