", server.numericalId.toString())
suspend fun getGroup(name: String): Group? {
val groupName = parse(name).first
return try {
this.cloudApi.group().getGroupByName(groupName).await()
- } catch (e: Exception) {
+ } catch (_: Exception) {
null
}
}
- fun getNumericalId(name: String): Int {
- return parse(name).second
- }
-
+ fun getNumericalId(name: String): Int = parse(name).second
}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/permission/PermissionChecker.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/permission/PermissionChecker.kt
index 216cb80..22a6787 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/permission/PermissionChecker.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/permission/PermissionChecker.kt
@@ -1,16 +1,12 @@
package app.simplecloud.plugin.api.shared.permission
-/**
- * @author Niklas Nieberler
- */
-
fun interface PermissionChecker {
/**
* Checks the permission by a player
+ *
* @param player to check the permission
* @param name of the permission
*/
fun checkPermission(player: P, name: String): Boolean
-
-}
\ No newline at end of file
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/PlaceholderProvider.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/PlaceholderProvider.kt
index 24205dd..2099df4 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/PlaceholderProvider.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/PlaceholderProvider.kt
@@ -4,10 +4,6 @@ import app.simplecloud.plugin.api.shared.placeholder.provider.GroupPlaceholderPr
import app.simplecloud.plugin.api.shared.placeholder.provider.PersistentServerPlaceholderProvider
import app.simplecloud.plugin.api.shared.placeholder.provider.ServerPlaceholderProvider
-/**
- * @author Niklas Nieberler
- */
-
object PlaceholderProvider {
val serverPlaceholderProvider = ServerPlaceholderProvider()
@@ -15,5 +11,4 @@ object PlaceholderProvider {
val groupPlaceholderProvider = GroupPlaceholderProvider()
val persistentServerPlaceholderProvider = PersistentServerPlaceholderProvider()
-
-}
\ No newline at end of file
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/ArgumentsResolver.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/ArgumentsResolver.kt
index 00957a4..5f785f6 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/ArgumentsResolver.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/ArgumentsResolver.kt
@@ -3,21 +3,15 @@ package app.simplecloud.plugin.api.shared.placeholder.argument
import net.kyori.adventure.text.minimessage.tag.Tag
import net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue
-/**
- * @author Niklas Nieberler
- */
-
interface ArgumentsResolver {
- /**
- * Gets the key for the placeholder
- */
+ /** Gets the key for the placeholder */
fun getKey(): String
/**
* Gets the resolved tag for the placeholder
+ *
* @param arguments of the placeholder key
*/
suspend fun resolve(arguments: ArgumentQueue): Tag?
-
-}
\ No newline at end of file
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/EnvironmentArgumentsResolver.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/EnvironmentArgumentsResolver.kt
index 5487e5f..a686d5b 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/EnvironmentArgumentsResolver.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/EnvironmentArgumentsResolver.kt
@@ -3,19 +3,14 @@ package app.simplecloud.plugin.api.shared.placeholder.argument
import net.kyori.adventure.text.minimessage.tag.Tag
import net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue
-/**
- * @author Niklas Nieberler
- */
-
class EnvironmentArgumentsResolver : ArgumentsResolver {
override fun getKey() = "env"
override suspend fun resolve(arguments: ArgumentQueue): Tag? {
val argumentName = arguments.popOr("environment expected").value()
- val defaultArgument = arguments.peek()?.value() ?: ""
+ val defaultArgument = arguments.peek()?.value().orEmpty()
val string = System.getenv(argumentName) ?: defaultArgument
return Tag.preProcessParsed(string)
}
-
-}
\ No newline at end of file
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/PropertiesArgumentsResolver.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/PropertiesArgumentsResolver.kt
index 44badb3..69e8609 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/PropertiesArgumentsResolver.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/PropertiesArgumentsResolver.kt
@@ -3,21 +3,14 @@ package app.simplecloud.plugin.api.shared.placeholder.argument
import net.kyori.adventure.text.minimessage.tag.Tag
import net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue
-/**
- * @author Niklas Nieberler
- */
-
-class PropertiesArgumentsResolver(
- private val properties: Map
-) : ArgumentsResolver {
+class PropertiesArgumentsResolver(private val properties: Map) : ArgumentsResolver {
override fun getKey() = "property"
override suspend fun resolve(arguments: ArgumentQueue): Tag? {
val argumentName = arguments.popOr("property expected").value()
- val defaultArgument = arguments.peek()?.value() ?: ""
+ val defaultArgument = arguments.peek()?.value().orEmpty()
val string = this.properties[argumentName] ?: defaultArgument
return Tag.preProcessParsed(string.toString())
}
-
-}
\ No newline at end of file
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/group/PlayerCountArgumentsResolver.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/group/PlayerCountArgumentsResolver.kt
index c319290..555bfbf 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/group/PlayerCountArgumentsResolver.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/group/PlayerCountArgumentsResolver.kt
@@ -8,10 +8,7 @@ import kotlinx.coroutines.future.await
import net.kyori.adventure.text.minimessage.tag.Tag
import net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue
-class PlayerCountArgumentsResolver(
- private val cloudApi: CloudApi,
- private val group: Group,
-) : ArgumentsResolver {
+class PlayerCountArgumentsResolver(private val cloudApi: CloudApi, private val group: Group) : ArgumentsResolver {
override fun getKey() = "player_count"
@@ -29,5 +26,4 @@ class PlayerCountArgumentsResolver(
servers.sumOf { it.playerCount }
}
}
-
}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/group/ServerCountArgumentsResolver.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/group/ServerCountArgumentsResolver.kt
index 2afedc6..8cb9286 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/group/ServerCountArgumentsResolver.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/argument/group/ServerCountArgumentsResolver.kt
@@ -8,10 +8,7 @@ import kotlinx.coroutines.future.await
import net.kyori.adventure.text.minimessage.tag.Tag
import net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue
-class ServerCountArgumentsResolver(
- private val cloudApi: CloudApi,
- private val group: Group,
-) : ArgumentsResolver {
+class ServerCountArgumentsResolver(private val cloudApi: CloudApi, private val group: Group) : ArgumentsResolver {
override fun getKey() = "server_count"
@@ -24,10 +21,9 @@ class ServerCountArgumentsResolver(
private suspend fun findServerCount(group: Group, state: ServerState?): Int {
val servers = this.cloudApi.server().getServersByGroup(group.name).await()
return if (state != null) {
- servers.filter { it.state == state }.size
+ servers.count { it.state == state }
} else {
servers.size
}
}
-
}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/async/AsyncPlaceholder.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/async/AsyncPlaceholder.kt
index 6f27fb2..6b98119 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/async/AsyncPlaceholder.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/async/AsyncPlaceholder.kt
@@ -3,36 +3,29 @@ package app.simplecloud.plugin.api.shared.placeholder.async
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver
-/**
- * @author Niklas Nieberler
- */
-
/**
* This creates a new placeholder that can also be used asynchronously
+ *
* @param key placeholder name
* @param handler value for this placeholder
*/
-data class AsyncPlaceholder(
- val key: String,
- private val handler: AsyncPlaceholderHandler
-) {
+data class AsyncPlaceholder(val key: String, private val handler: AsyncPlaceholderHandler) {
/**
* Executes the handler method to get the appropriate value for this placeholder
+ *
* @return placeholder value
*/
- suspend fun invoke(value: T): Any? {
- return this.handler.handle(value)
- }
+ suspend fun invoke(value: T): Any? = this.handler.handle(value)
/**
* Gets a matching [TagResolver] with matching key and value
+ *
* @param value for the placeholder
* @param prefix first name for the placeholder key
*/
suspend fun invokeTagResolver(value: T, prefix: String? = null): TagResolver {
- val resolvedKey = prefix?.let { "${it}_$key" } ?: this.key
+ val resolvedKey = if (prefix != null) "${prefix}_$key" else this.key
return Placeholder.unparsed(resolvedKey, invoke(value).toString())
}
-
-}
\ No newline at end of file
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/async/AsyncPlaceholderHandler.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/async/AsyncPlaceholderHandler.kt
index c060039..99a9bb3 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/async/AsyncPlaceholderHandler.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/async/AsyncPlaceholderHandler.kt
@@ -1,15 +1,11 @@
package app.simplecloud.plugin.api.shared.placeholder.async
-/**
- * @author Niklas Nieberler
- */
-
fun interface AsyncPlaceholderHandler {
/**
* Gets the return value for a placeholder
+ *
* @param value of the placeholder key method
*/
suspend fun handle(value: T): Any?
-
-}
\ No newline at end of file
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/AbstractPlaceholderProvider.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/AbstractPlaceholderProvider.kt
index a540a71..6acac30 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/AbstractPlaceholderProvider.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/AbstractPlaceholderProvider.kt
@@ -9,18 +9,13 @@ import net.kyori.adventure.text.Component
import net.kyori.adventure.text.minimessage.tag.Tag
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver
-/**
- * @author Niklas Nieberler
- */
-
-abstract class AbstractPlaceholderProvider(
- private val executor: SinglePlaceholderExecutor,
-) {
+abstract class AbstractPlaceholderProvider(private val executor: SinglePlaceholderExecutor) {
private val cloudApi = CloudApi.create()
/**
* Gets the list of all available [ArgumentsResolver]
+ *
* @param cloudApi the instance of [CloudApi]
* @param value for the placeholder
*/
@@ -31,6 +26,7 @@ abstract class AbstractPlaceholderProvider(
/**
* Gets the sum of all [TagResolver]
+ *
* @param values for the placeholder
* @param prefix of the placeholder key
*/
@@ -43,17 +39,17 @@ abstract class AbstractPlaceholderProvider(
addAll(values.flatMap { getArgumentsResolvers(cloudApi, it) })
addAll(argumentsResolver)
}
- val singleTagResolver = values.map { this.executor.getTagResolver(this.cloudApi, it, prefix) }
+ val singleTagResolver = values.map {
+ this.executor.getTagResolver(this.cloudApi, it, prefix)
+ }
return TagResolver.resolver(
- *singleTagResolver.toTypedArray(),
- *availableArgumentsResolver
- .map { convertArgumentsResolverToTagResolver(it, prefix) }
- .toTypedArray()
+ singleTagResolver + availableArgumentsResolver.map { convertArgumentsResolverToTagResolver(it, prefix) },
)
}
/**
* Serializes the string to a [Component]
+ *
* @param value for the placeholder
* @param string the message
* @param prefix of the placeholder key
@@ -63,15 +59,14 @@ abstract class AbstractPlaceholderProvider(
string: String,
prefix: String? = null,
vararg argumentsResolver: ArgumentsResolver,
- ): Component {
- return text(
- string,
- getTagResolver(listOf(value), prefix, *argumentsResolver),
- )
- }
+ ): Component = text(
+ string,
+ getTagResolver(listOf(value), prefix, *argumentsResolver),
+ )
/**
* Serializes the string to a [Component]
+ *
* @param values for the placeholder
* @param string the message
* @param prefix of the placeholder key
@@ -81,19 +76,19 @@ abstract class AbstractPlaceholderProvider(
string: String,
prefix: String? = null,
vararg argumentsResolver: ArgumentsResolver,
- ): Component {
- return text(
- string,
- getTagResolver(values, prefix, *argumentsResolver),
- )
- }
+ ): Component = text(
+ string,
+ getTagResolver(values, prefix, *argumentsResolver),
+ )
- private fun convertArgumentsResolverToTagResolver(resolver: ArgumentsResolver, prefix: String?): TagResolver {
+ private fun convertArgumentsResolverToTagResolver(
+ resolver: ArgumentsResolver,
+ prefix: String?,
+ ): TagResolver {
val key = resolver.getKey()
- val resolvedKey = prefix?.let { "${it}_$key" } ?: key
+ val resolvedKey = if (prefix != null) "${prefix}_$key" else key
return TagResolver.resolver(resolvedKey) { arguments, _ ->
return@resolver runBlocking { resolver.resolve(arguments) as Tag }
}
}
-
-}
\ No newline at end of file
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/GroupPlaceholderProvider.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/GroupPlaceholderProvider.kt
index 16e9726..0f55ed5 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/GroupPlaceholderProvider.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/GroupPlaceholderProvider.kt
@@ -7,14 +7,15 @@ import app.simplecloud.plugin.api.shared.placeholder.argument.group.PlayerCountA
import app.simplecloud.plugin.api.shared.placeholder.argument.group.ServerCountArgumentsResolver
import app.simplecloud.plugin.api.shared.placeholder.single.SingleGroupPlaceholderExecutor
-class GroupPlaceholderProvider : AbstractPlaceholderProvider(
- SingleGroupPlaceholderExecutor()
-) {
-
- override suspend fun getArgumentsResolvers(cloudApi: CloudApi, value: Group) = listOf(
- PropertiesArgumentsResolver(value.properties),
- PlayerCountArgumentsResolver(cloudApi, value),
- ServerCountArgumentsResolver(cloudApi, value)
- )
+class GroupPlaceholderProvider :
+ AbstractPlaceholderProvider(
+ SingleGroupPlaceholderExecutor(),
+ ) {
+ override suspend fun getArgumentsResolvers(cloudApi: CloudApi, value: Group) =
+ listOf(
+ PropertiesArgumentsResolver(value.properties),
+ PlayerCountArgumentsResolver(cloudApi, value),
+ ServerCountArgumentsResolver(cloudApi, value),
+ )
}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/PersistentServerPlaceholderProvider.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/PersistentServerPlaceholderProvider.kt
index 1ade4b9..9168b9c 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/PersistentServerPlaceholderProvider.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/PersistentServerPlaceholderProvider.kt
@@ -2,19 +2,16 @@ package app.simplecloud.plugin.api.shared.placeholder.provider
import app.simplecloud.api.CloudApi
import app.simplecloud.api.persistentserver.PersistentServer
-import app.simplecloud.plugin.api.shared.placeholder.argument.*
+import app.simplecloud.plugin.api.shared.placeholder.argument.PropertiesArgumentsResolver
import app.simplecloud.plugin.api.shared.placeholder.single.SinglePersistentServerPlaceholderExecutor
-/**
- * @author Niklas Nieberler
- */
+class PersistentServerPlaceholderProvider :
+ AbstractPlaceholderProvider(
+ SinglePersistentServerPlaceholderExecutor(),
+ ) {
-class PersistentServerPlaceholderProvider : AbstractPlaceholderProvider(
- SinglePersistentServerPlaceholderExecutor()
-) {
-
- override suspend fun getArgumentsResolvers(cloudApi: CloudApi, value: PersistentServer) = listOf(
- PropertiesArgumentsResolver(value.properties)
- )
-
-}
\ No newline at end of file
+ override suspend fun getArgumentsResolvers(cloudApi: CloudApi, value: PersistentServer) =
+ listOf(
+ PropertiesArgumentsResolver(value.properties),
+ )
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/ServerPlaceholderProvider.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/ServerPlaceholderProvider.kt
index 8a78b99..e4f9d9f 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/ServerPlaceholderProvider.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/provider/ServerPlaceholderProvider.kt
@@ -2,19 +2,16 @@ package app.simplecloud.plugin.api.shared.placeholder.provider
import app.simplecloud.api.CloudApi
import app.simplecloud.api.server.Server
-import app.simplecloud.plugin.api.shared.placeholder.argument.*
+import app.simplecloud.plugin.api.shared.placeholder.argument.PropertiesArgumentsResolver
import app.simplecloud.plugin.api.shared.placeholder.single.SingleServerPlaceholderExecutor
-/**
- * @author Niklas Nieberler
- */
+class ServerPlaceholderProvider :
+ AbstractPlaceholderProvider(
+ SingleServerPlaceholderExecutor(),
+ ) {
-class ServerPlaceholderProvider : AbstractPlaceholderProvider(
- SingleServerPlaceholderExecutor()
-) {
-
- override suspend fun getArgumentsResolvers(cloudApi: CloudApi, value: Server) = listOf(
- PropertiesArgumentsResolver(value.properties)
- )
-
-}
\ No newline at end of file
+ override suspend fun getArgumentsResolvers(cloudApi: CloudApi, value: Server) =
+ listOf(
+ PropertiesArgumentsResolver(value.properties),
+ )
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SingleGroupPlaceholderExecutor.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SingleGroupPlaceholderExecutor.kt
index 0eb254d..5487f24 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SingleGroupPlaceholderExecutor.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SingleGroupPlaceholderExecutor.kt
@@ -7,18 +7,16 @@ import kotlinx.coroutines.future.await
class SingleGroupPlaceholderExecutor : SinglePlaceholderExecutor {
- override fun getAsyncPlaceholders(cloudApi: CloudApi) = listOf>(
- AsyncPlaceholder("name") { it.name },
- AsyncPlaceholder("type") { it.type },
- AsyncPlaceholder("max_players") { it.maxPlayers },
- AsyncPlaceholder("min_memory") { it.minMemory },
- AsyncPlaceholder("max_memory") { it.maxMemory },
- AsyncPlaceholder("online_players") { getOnlinePlayersByGroup(cloudApi, it) },
- )
-
- private suspend fun getOnlinePlayersByGroup(cloudApi: CloudApi, group: Group): Int {
- return cloudApi.server().getServersByGroup(group.name).await()
- .sumOf { it.playerCount }
- }
+ override fun getAsyncPlaceholders(cloudApi: CloudApi) =
+ listOf>(
+ AsyncPlaceholder("name") { it.name },
+ AsyncPlaceholder("type") { it.type },
+ AsyncPlaceholder("max_players") { it.maxPlayers },
+ AsyncPlaceholder("min_memory") { it.minMemory },
+ AsyncPlaceholder("max_memory") { it.maxMemory },
+ AsyncPlaceholder("online_players") { getOnlinePlayersByGroup(cloudApi, it) },
+ )
+ private suspend fun getOnlinePlayersByGroup(cloudApi: CloudApi, group: Group): Int =
+ cloudApi.server().getServersByGroup(group.name).await().sumOf { it.playerCount }
}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SinglePersistentServerPlaceholderExecutor.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SinglePersistentServerPlaceholderExecutor.kt
index f0cb0ed..3bdb8a1 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SinglePersistentServerPlaceholderExecutor.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SinglePersistentServerPlaceholderExecutor.kt
@@ -5,24 +5,20 @@ import app.simplecloud.api.persistentserver.PersistentServer
import app.simplecloud.plugin.api.shared.placeholder.async.AsyncPlaceholder
import app.simplecloud.plugin.api.shared.pretty.StringPrettifier
-/**
- * @author Niklas Nieberler
- */
-
class SinglePersistentServerPlaceholderExecutor : SinglePlaceholderExecutor {
- override fun getAsyncPlaceholders(cloudApi: CloudApi) = listOf>(
- AsyncPlaceholder("id") { it.persistentServerId },
- AsyncPlaceholder("name") { it.name },
- AsyncPlaceholder("pretty_name") {
- it.properties["pretty-name"] ?: StringPrettifier.prettify(it.name)
- },
- AsyncPlaceholder("type") { it.type },
- AsyncPlaceholder("online_players") { it.playerCount },
- AsyncPlaceholder("max_players") { it.maxPlayers },
- AsyncPlaceholder("min_memory") { it.minMemory },
- AsyncPlaceholder("max_memory") { it.maxMemory },
- AsyncPlaceholder("motd") { it.properties["motd"] ?: "A Minecraft server" }
- )
-
-}
\ No newline at end of file
+ override fun getAsyncPlaceholders(cloudApi: CloudApi) =
+ listOf>(
+ AsyncPlaceholder("id") { it.persistentServerId },
+ AsyncPlaceholder("name") { it.name },
+ AsyncPlaceholder("pretty_name") {
+ it.properties["pretty-name"] ?: StringPrettifier.prettify(it.name)
+ },
+ AsyncPlaceholder("type") { it.type },
+ AsyncPlaceholder("online_players") { it.playerCount },
+ AsyncPlaceholder("max_players") { it.maxPlayers },
+ AsyncPlaceholder("min_memory") { it.minMemory },
+ AsyncPlaceholder("max_memory") { it.maxMemory },
+ AsyncPlaceholder("motd") { it.properties["motd"] ?: "A Minecraft server" },
+ )
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SinglePlaceholderExecutor.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SinglePlaceholderExecutor.kt
index bd80632..9a157ce 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SinglePlaceholderExecutor.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SinglePlaceholderExecutor.kt
@@ -4,20 +4,18 @@ import app.simplecloud.api.CloudApi
import app.simplecloud.plugin.api.shared.placeholder.async.AsyncPlaceholder
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver
-/**
- * @author Niklas Nieberler
- */
-
interface SinglePlaceholderExecutor {
/**
* Gets a list with all available [AsyncPlaceholder]
+ *
* @param cloudApi the instance of [app.simplecloud.api.CloudApi]
*/
fun getAsyncPlaceholders(cloudApi: CloudApi): List>
/**
* Gets a [TagResolver] with all available tag resolvers from the [getAsyncPlaceholders] method
+ *
* @param cloudApi the instance of [CloudApi]
* @param value for the placeholder
* @param prefix first name for the placeholder key
@@ -26,9 +24,7 @@ interface SinglePlaceholderExecutor {
cloudApi: CloudApi,
value: T,
prefix: String? = null,
- ): TagResolver {
- return TagResolver.resolver(getAsyncPlaceholders(cloudApi)
- .map { it.invokeTagResolver(value, prefix) })
- }
-
-}
\ No newline at end of file
+ ): TagResolver = TagResolver.resolver(
+ getAsyncPlaceholders(cloudApi).map { it.invokeTagResolver(value, prefix) },
+ )
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SingleServerPlaceholderExecutor.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SingleServerPlaceholderExecutor.kt
index d66bdc4..984e889 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SingleServerPlaceholderExecutor.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/placeholder/single/SingleServerPlaceholderExecutor.kt
@@ -5,28 +5,24 @@ import app.simplecloud.api.server.Server
import app.simplecloud.plugin.api.shared.placeholder.async.AsyncPlaceholder
import app.simplecloud.plugin.api.shared.pretty.StringPrettifier
-/**
- * @author Niklas Nieberler
- */
-
class SingleServerPlaceholderExecutor : SinglePlaceholderExecutor {
- override fun getAsyncPlaceholders(cloudApi: CloudApi) = listOf>(
- AsyncPlaceholder("id") { it.serverId },
- AsyncPlaceholder("numerical_id") { it.numericalId },
- AsyncPlaceholder("group_name") { it.serverBase.name },
- AsyncPlaceholder("group_pretty_name") {
- it.properties["pretty-name"] ?: StringPrettifier.prettify(it.serverBase.name)
- },
- AsyncPlaceholder("type") { it.serverBase.type },
- AsyncPlaceholder("state") { it.state },
- AsyncPlaceholder("ip") { it.ip },
- AsyncPlaceholder("port") { it.port },
- AsyncPlaceholder("online_players") { it.playerCount },
- AsyncPlaceholder("max_players") { it.maxPlayers },
- AsyncPlaceholder("min_memory") { it.minMemory },
- AsyncPlaceholder("max_memory") { it.maxMemory },
- AsyncPlaceholder("motd") { it.properties["motd"] ?: "A Minecraft server" }
- )
-
-}
\ No newline at end of file
+ override fun getAsyncPlaceholders(cloudApi: CloudApi) =
+ listOf>(
+ AsyncPlaceholder("id") { it.serverId },
+ AsyncPlaceholder("numerical_id") { it.numericalId },
+ AsyncPlaceholder("group_name") { it.serverBase.name },
+ AsyncPlaceholder("group_pretty_name") {
+ it.properties["pretty-name"] ?: StringPrettifier.prettify(it.serverBase.name)
+ },
+ AsyncPlaceholder("type") { it.serverBase.type },
+ AsyncPlaceholder("state") { it.state },
+ AsyncPlaceholder("ip") { it.ip },
+ AsyncPlaceholder("port") { it.port },
+ AsyncPlaceholder("online_players") { it.playerCount },
+ AsyncPlaceholder("max_players") { it.maxPlayers },
+ AsyncPlaceholder("min_memory") { it.minMemory },
+ AsyncPlaceholder("max_memory") { it.maxMemory },
+ AsyncPlaceholder("motd") { it.properties["motd"] ?: "A Minecraft server" },
+ )
+}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/pretty/PrettifyCase.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/pretty/PrettifyCase.kt
index 4ae7f66..8b47420 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/pretty/PrettifyCase.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/pretty/PrettifyCase.kt
@@ -6,5 +6,5 @@ enum class PrettifyCase {
PASCAL,
SENTENCE,
KEBAB,
- SNAKE
+ SNAKE,
}
diff --git a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/pretty/StringPrettifier.kt b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/pretty/StringPrettifier.kt
index e188366..dc5a2f6 100644
--- a/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/pretty/StringPrettifier.kt
+++ b/plugin-shared/src/main/kotlin/app/simplecloud/plugin/api/shared/pretty/StringPrettifier.kt
@@ -2,63 +2,55 @@ package app.simplecloud.plugin.api.shared.pretty
object StringPrettifier {
- /**
- * Converts various string formats to different cases
- */
- fun prettify(input: String, case: PrettifyCase = PrettifyCase.TITLE): String {
- return when (case) {
- PrettifyCase.TITLE -> toTitleCase(input)
- PrettifyCase.CAMEL -> toCamelCase(input)
- PrettifyCase.PASCAL -> toPascalCase(input)
- PrettifyCase.SENTENCE -> toSentenceCase(input)
- PrettifyCase.KEBAB -> toKebabCase(input)
- PrettifyCase.SNAKE -> toSnakeCase(input)
- }
- }
-
- private fun toTitleCase(input: String): String {
- return input.split(Regex("[\\s_-]"))
- .filter { it.isNotEmpty() }
- .joinToString(" ") { word ->
- word.lowercase().replaceFirstChar { it.uppercase() }
- }
+ /** Converts various string formats to different cases */
+ fun prettify(input: String, case: PrettifyCase = PrettifyCase.TITLE): String = when (case) {
+ PrettifyCase.TITLE -> toTitleCase(input)
+ PrettifyCase.CAMEL -> toCamelCase(input)
+ PrettifyCase.PASCAL -> toPascalCase(input)
+ PrettifyCase.SENTENCE -> toSentenceCase(input)
+ PrettifyCase.KEBAB -> toKebabCase(input)
+ PrettifyCase.SNAKE -> toSnakeCase(input)
}
- private fun toCamelCase(input: String): String {
- return input.split(Regex("[\\s_-]"))
- .filter { it.isNotEmpty() }
- .mapIndexed { index, word ->
- if (index == 0) word.lowercase()
- else word.lowercase().replaceFirstChar { it.uppercase() }
- }
- .joinToString("")
- }
+ private fun toTitleCase(input: String): String = input
+ .split(Regex("[\\s_-]"))
+ .filter { it.isNotEmpty() }
+ .joinToString(" ") { word ->
+ word.lowercase().replaceFirstChar { it.uppercase() }
+ }
- private fun toPascalCase(input: String): String {
- return input.split(Regex("[\\s_-]"))
- .filter { it.isNotEmpty() }
- .joinToString("") { word ->
+ private fun toCamelCase(input: String): String = input
+ .split(Regex("[\\s_-]"))
+ .filter { it.isNotEmpty() }
+ .mapIndexed { index, word ->
+ if (index == 0) {
+ word.lowercase()
+ } else {
word.lowercase().replaceFirstChar { it.uppercase() }
}
- }
-
- private fun toSentenceCase(input: String): String {
- return input.split(Regex("[\\s_-]"))
- .filter { it.isNotEmpty() }
- .joinToString(" ") { it.lowercase() }
- .replaceFirstChar { it.uppercase() }
- }
-
- private fun toKebabCase(input: String): String {
- return input.split(Regex("[\\s_]"))
- .filter { it.isNotEmpty() }
- .joinToString("-") { it.lowercase() }
- }
+ }
+ .joinToString("")
- private fun toSnakeCase(input: String): String {
- return input.split(Regex("[\\s-]"))
- .filter { it.isNotEmpty() }
- .joinToString("_") { it.lowercase() }
- }
+ private fun toPascalCase(input: String): String = input
+ .split(Regex("[\\s_-]"))
+ .filter { it.isNotEmpty() }
+ .joinToString("") { word ->
+ word.lowercase().replaceFirstChar { it.uppercase() }
+ }
-}
\ No newline at end of file
+ private fun toSentenceCase(input: String): String = input
+ .split(Regex("[\\s_-]"))
+ .filter { it.isNotEmpty() }
+ .joinToString(" ") { it.lowercase() }
+ .replaceFirstChar { it.uppercase() }
+
+ private fun toKebabCase(input: String): String = input
+ .split(Regex("[\\s_]"))
+ .filter { it.isNotEmpty() }
+ .joinToString("-") { it.lowercase() }
+
+ private fun toSnakeCase(input: String): String = input
+ .split(Regex("[\\s-]"))
+ .filter { it.isNotEmpty() }
+ .joinToString("_") { it.lowercase() }
+}
diff --git a/plugin-shared/src/test/kotlin/app/simplecloud/plugin/api/shared/config/ConfigurationMigrationTest.kt b/plugin-shared/src/test/kotlin/app/simplecloud/plugin/api/shared/config/ConfigurationMigrationTest.kt
index 1afbab7..1961d74 100644
--- a/plugin-shared/src/test/kotlin/app/simplecloud/plugin/api/shared/config/ConfigurationMigrationTest.kt
+++ b/plugin-shared/src/test/kotlin/app/simplecloud/plugin/api/shared/config/ConfigurationMigrationTest.kt
@@ -1,12 +1,12 @@
package app.simplecloud.plugin.api.shared.config
+import org.spongepowered.configurate.objectmapping.ConfigSerializable
import java.nio.file.Files
import java.nio.file.Path
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
-import org.spongepowered.configurate.objectmapping.ConfigSerializable
class ConfigurationMigrationTest {
@@ -17,14 +17,16 @@ class ConfigurationMigrationTest {
file.writeText(
"""
name: legacy-value
- """.trimIndent()
+ """
+ .trimIndent(),
)
- val configurationFactory = ConfigurationFactory(
- file = file,
- javaClass = TestVersionedConfig::class.java,
- configMigrator = testMigrator(),
- )
+ val configurationFactory =
+ ConfigurationFactory(
+ file = file,
+ javaClass = TestVersionedConfig::class.java,
+ configMigrator = testMigrator(),
+ )
val config = configurationFactory.loadOrCreate(TestVersionedConfig())
@@ -47,13 +49,15 @@ class ConfigurationMigrationTest {
"""
version: 1
message: repository-value
- """.trimIndent()
+ """
+ .trimIndent(),
)
- val repository = TestYamlDirectoryRepository(
- directory = tempDirectory,
- configMigrator = testMigrator(),
- )
+ val repository =
+ TestYamlDirectoryRepository(
+ directory = tempDirectory,
+ configMigrator = testMigrator(),
+ )
val loadedEntries = repository.load()
@@ -88,21 +92,17 @@ class ConfigurationMigrationTest {
var enabled: Boolean = true
}
- private class TestYamlDirectoryRepository(
- directory: Path,
- configMigrator: ConfigMigrator,
- ) : YamlDirectoryRepository(
- directory = directory,
- javaClass = TestVersionedConfig::class.java,
- configMigrator = configMigrator,
- ) {
+ private class TestYamlDirectoryRepository(directory: Path, configMigrator: ConfigMigrator) :
+ YamlDirectoryRepository(
+ directory = directory,
+ javaClass = TestVersionedConfig::class.java,
+ configMigrator = configMigrator,
+ ) {
override fun save(entity: TestVersionedConfig) {
save("${entity.message}.yml", entity)
}
- override fun find(identifier: String): TestVersionedConfig? {
- return findAll().firstOrNull { it.message == identifier }
- }
+ override fun find(identifier: String): TestVersionedConfig? = findAll().firstOrNull { it.message == identifier }
}
}
diff --git a/plugin-shared/src/test/kotlin/app/simplecloud/plugin/api/shared/pretty/StringPrettifierTest.kt b/plugin-shared/src/test/kotlin/app/simplecloud/plugin/api/shared/pretty/StringPrettifierTest.kt
index 28cca93..c6b1b98 100644
--- a/plugin-shared/src/test/kotlin/app/simplecloud/plugin/api/shared/pretty/StringPrettifierTest.kt
+++ b/plugin-shared/src/test/kotlin/app/simplecloud/plugin/api/shared/pretty/StringPrettifierTest.kt
@@ -16,37 +16,67 @@ class StringPrettifierTest {
fun testCamelCaseConversion() {
assertEquals("helloWorld", StringPrettifier.prettify("hello-world", PrettifyCase.CAMEL))
assertEquals("helloWorld", StringPrettifier.prettify("hello_world", PrettifyCase.CAMEL))
- assertEquals("helloBeautifulWorld", StringPrettifier.prettify("hello beautiful world", PrettifyCase.CAMEL))
- assertEquals("myVariableName", StringPrettifier.prettify("my-variable-name", PrettifyCase.CAMEL))
+ assertEquals(
+ "helloBeautifulWorld",
+ StringPrettifier.prettify("hello beautiful world", PrettifyCase.CAMEL),
+ )
+ assertEquals(
+ "myVariableName",
+ StringPrettifier.prettify("my-variable-name", PrettifyCase.CAMEL),
+ )
}
@Test
fun testPascalCaseConversion() {
assertEquals("HelloWorld", StringPrettifier.prettify("hello-world", PrettifyCase.PASCAL))
assertEquals("HelloWorld", StringPrettifier.prettify("hello_world", PrettifyCase.PASCAL))
- assertEquals("HelloBeautifulWorld", StringPrettifier.prettify("hello beautiful world", PrettifyCase.PASCAL))
- assertEquals("MyVariableName", StringPrettifier.prettify("my-variable-name", PrettifyCase.PASCAL))
+ assertEquals(
+ "HelloBeautifulWorld",
+ StringPrettifier.prettify("hello beautiful world", PrettifyCase.PASCAL),
+ )
+ assertEquals(
+ "MyVariableName",
+ StringPrettifier.prettify("my-variable-name", PrettifyCase.PASCAL),
+ )
}
@Test
fun testSentenceCaseConversion() {
assertEquals("Hello world", StringPrettifier.prettify("hello-world", PrettifyCase.SENTENCE))
- assertEquals("Hello beautiful world", StringPrettifier.prettify("hello_beautiful_world", PrettifyCase.SENTENCE))
- assertEquals("My variable name", StringPrettifier.prettify("my-variable-name", PrettifyCase.SENTENCE))
+ assertEquals(
+ "Hello beautiful world",
+ StringPrettifier.prettify("hello_beautiful_world", PrettifyCase.SENTENCE),
+ )
+ assertEquals(
+ "My variable name",
+ StringPrettifier.prettify("my-variable-name", PrettifyCase.SENTENCE),
+ )
}
@Test
fun testKebabCaseConversion() {
assertEquals("hello-world", StringPrettifier.prettify("hello world", PrettifyCase.KEBAB))
- assertEquals("hello-beautiful-world", StringPrettifier.prettify("hello_beautiful_world", PrettifyCase.KEBAB))
- assertEquals("my-variable-name", StringPrettifier.prettify("my variable name", PrettifyCase.KEBAB))
+ assertEquals(
+ "hello-beautiful-world",
+ StringPrettifier.prettify("hello_beautiful_world", PrettifyCase.KEBAB),
+ )
+ assertEquals(
+ "my-variable-name",
+ StringPrettifier.prettify("my variable name", PrettifyCase.KEBAB),
+ )
}
@Test
fun testSnakeCaseConversion() {
assertEquals("hello_world", StringPrettifier.prettify("hello-world", PrettifyCase.SNAKE))
- assertEquals("hello_beautiful_world", StringPrettifier.prettify("hello beautiful world", PrettifyCase.SNAKE))
- assertEquals("my_variable_name", StringPrettifier.prettify("my-variable-name", PrettifyCase.SNAKE))
+ assertEquals(
+ "hello_beautiful_world",
+ StringPrettifier.prettify("hello beautiful world", PrettifyCase.SNAKE),
+ )
+ assertEquals(
+ "my_variable_name",
+ StringPrettifier.prettify("my-variable-name", PrettifyCase.SNAKE),
+ )
}
@Test
@@ -59,7 +89,13 @@ class StringPrettifierTest {
@Test
fun testMultipleDelimiterHandling() {
assertEquals("Hello Beautiful World", StringPrettifier.prettify("hello-beautiful_world"))
- assertEquals("helloBeautifulWorld", StringPrettifier.prettify("hello-beautiful_world", PrettifyCase.CAMEL))
- assertEquals("HelloBeautifulWorld", StringPrettifier.prettify("hello-beautiful_world", PrettifyCase.PASCAL))
+ assertEquals(
+ "helloBeautifulWorld",
+ StringPrettifier.prettify("hello-beautiful_world", PrettifyCase.CAMEL),
+ )
+ assertEquals(
+ "HelloBeautifulWorld",
+ StringPrettifier.prettify("hello-beautiful_world", PrettifyCase.PASCAL),
+ )
}
}
diff --git a/plugin-velocity/build.gradle.kts b/plugin-velocity/build.gradle.kts
index 12b0664..e432564 100644
--- a/plugin-velocity/build.gradle.kts
+++ b/plugin-velocity/build.gradle.kts
@@ -7,4 +7,4 @@ dependencies {
compileOnly(libs.cloud.velocity)
compileOnly(libs.velocity.api)
kapt(libs.velocity.api)
-}
\ No newline at end of file
+}
diff --git a/plugin-velocity/src/main/kotlin/app/simplecloud/plugin/api/velocity/command/VelocityCloudSender.kt b/plugin-velocity/src/main/kotlin/app/simplecloud/plugin/api/velocity/command/VelocityCloudSender.kt
index 9527ac2..5f8369c 100644
--- a/plugin-velocity/src/main/kotlin/app/simplecloud/plugin/api/velocity/command/VelocityCloudSender.kt
+++ b/plugin-velocity/src/main/kotlin/app/simplecloud/plugin/api/velocity/command/VelocityCloudSender.kt
@@ -8,20 +8,13 @@ import java.util.UUID
class VelocityCloudSender(private val commandSource: CommandSource) : CloudSender {
- fun getCommandSource(): CommandSource {
- return commandSource
- }
+ fun getCommandSource(): CommandSource = commandSource
- override fun getUniqueId(): UUID? {
- return (commandSource as? Player)?.uniqueId
- }
+ override fun getUniqueId(): UUID? = (commandSource as? Player)?.uniqueId
- override fun hasPermission(permission: String): Boolean {
- return commandSource.hasPermission(permission)
- }
+ override fun hasPermission(permission: String): Boolean = commandSource.hasPermission(permission)
override fun sendMessage(message: Component) {
commandSource.sendMessage(message)
}
-
}
diff --git a/plugin-velocity/src/main/kotlin/app/simplecloud/plugin/api/velocity/command/VelocityCloudSenderMapper.kt b/plugin-velocity/src/main/kotlin/app/simplecloud/plugin/api/velocity/command/VelocityCloudSenderMapper.kt
index e8ef1e8..062f4f1 100644
--- a/plugin-velocity/src/main/kotlin/app/simplecloud/plugin/api/velocity/command/VelocityCloudSenderMapper.kt
+++ b/plugin-velocity/src/main/kotlin/app/simplecloud/plugin/api/velocity/command/VelocityCloudSenderMapper.kt
@@ -5,12 +5,7 @@ import org.incendo.cloud.SenderMapper
object VelocityCloudSenderMapper : SenderMapper {
- override fun map(base: CommandSource): VelocityCloudSender {
- return VelocityCloudSender(base)
- }
-
- override fun reverse(mapped: VelocityCloudSender): CommandSource {
- return mapped.getCommandSource()
- }
+ override fun map(base: CommandSource): VelocityCloudSender = VelocityCloudSender(base)
+ override fun reverse(mapped: VelocityCloudSender): CommandSource = mapped.getCommandSource()
}
diff --git a/plugin-velocity/src/main/kotlin/app/simplecloud/plugin/api/velocity/permission/VelocityPermissionChecker.kt b/plugin-velocity/src/main/kotlin/app/simplecloud/plugin/api/velocity/permission/VelocityPermissionChecker.kt
index a2bb7e7..8ff9048 100644
--- a/plugin-velocity/src/main/kotlin/app/simplecloud/plugin/api/velocity/permission/VelocityPermissionChecker.kt
+++ b/plugin-velocity/src/main/kotlin/app/simplecloud/plugin/api/velocity/permission/VelocityPermissionChecker.kt
@@ -3,14 +3,7 @@ package app.simplecloud.plugin.api.velocity.permission
import app.simplecloud.plugin.api.shared.permission.PermissionChecker
import com.velocitypowered.api.proxy.Player
-/**
- * @author Niklas Nieberler
- */
-
class VelocityPermissionChecker : PermissionChecker {
- override fun checkPermission(player: Player, name: String): Boolean {
- return player.hasPermission(name)
- }
-
-}
\ No newline at end of file
+ override fun checkPermission(player: Player, name: String): Boolean = player.hasPermission(name)
+}
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 7cabdca..ddaae11 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -1,3 +1,7 @@
+pluginManagement {
+ includeBuild("build-logic")
+}
+
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}
@@ -7,7 +11,7 @@ include(
"plugin-minestom",
"plugin-paper",
"plugin-shared",
- "plugin-velocity"
+ "plugin-velocity",
)
rootProject.name = "plugin-api"
\ No newline at end of file