diff --git a/build.gradle.kts b/build.gradle.kts index 23fec17..8db472d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,6 +14,9 @@ val subProjectPlugins = listOf( ) subprojects { + group = extra["project.group"].toString() + version = extra["project.version"].toString() + subProjectPlugins.forEach { pluginManager.apply(it.get().pluginId) } diff --git a/gradle.properties b/gradle.properties index 16c22e0..1c69237 100755 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ kotlin.code.style=official project.group=kr.summitsystems -project.version=0.0.8-beta3 +project.version=0.0.8-beta4 project.name=spring-bukkit project.url=https://github.com/summit-systems/spring-bukkit project.url.scm=https://github.com/summit-systems/spring-bukkit.git @@ -18,6 +18,7 @@ project.developer.email=park@junhyung.kr # Spigot spigot.version=1.20.2-R0.1-SNAPSHOT mock.bukkit.version=3.58.0 +protocollib.version=5.1.0 # Jakarta EE jakarta.annotation.version=2.1.1 diff --git a/settings.gradle.kts b/settings.gradle.kts index 16c725c..13d6aa5 100755 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -27,6 +27,7 @@ dependencyResolutionManagement { repositories { mavenCentral() maven("https://repo.papermc.io/repository/maven-public/") + maven("https://repo.dmulloy2.net/repository/public/") } versionCatalogs { @@ -39,6 +40,7 @@ dependencyResolutionManagement { library("spigot", "org.spigotmc:spigot-api:${extra["spigot.version"]}") library("paper", "io.papermc.paper:paper-api:${extra["spigot.version"]}") library("mockbukkit", "com.github.seeseemelk:MockBukkit-v1.20:${extra["mock.bukkit.version"]}") + library("protocollib", "com.comphenix.protocol:ProtocolLib:${extra["protocollib.version"]}") library("kotlin-stdlib", "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${extra["kotlin.version"]}") library("kotlin-reflect", "org.jetbrains.kotlin:kotlin-reflect:${extra["kotlin.version"]}") diff --git a/spring-bukkit-support/build.gradle.kts b/spring-bukkit-support/build.gradle.kts index ba099cb..4084960 100755 --- a/spring-bukkit-support/build.gradle.kts +++ b/spring-bukkit-support/build.gradle.kts @@ -1,6 +1,7 @@ dependencies { compileOnly(libs.spigot) compileOnly(libs.paper) + implementation(libs.protocollib) api(projects.core) implementation(projects.command) diff --git a/spring-bukkit-support/src/main/kotlin/kr/summitsystems/springbukkit/support/paper/PaperConfiguration.kt b/spring-bukkit-support/src/main/kotlin/kr/summitsystems/springbukkit/support/paper/PaperConfiguration.kt new file mode 100644 index 0000000..12d2b90 --- /dev/null +++ b/spring-bukkit-support/src/main/kotlin/kr/summitsystems/springbukkit/support/paper/PaperConfiguration.kt @@ -0,0 +1,17 @@ +package kr.summitsystems.springbukkit.support.paper + +import kr.summitsystems.springbukkit.command.CommandTabCompletionProvider +import org.springframework.beans.factory.config.BeanDefinition +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass +import org.springframework.context.annotation.* + +@Role(BeanDefinition.ROLE_INFRASTRUCTURE) +@Configuration +class PaperConfiguration { + @ConditionalOnClass(name = ["com.destroystokyo.paper.event.server.AsyncTabCompleteEvent"]) + @Bean + @Role(BeanDefinition.ROLE_INFRASTRUCTURE) + fun paperTabCompleter(commandTabCompletionProvider: CommandTabCompletionProvider): PaperTabCompleter { + return PaperTabCompleter(commandTabCompletionProvider) + } +} \ No newline at end of file diff --git a/spring-bukkit-support/src/main/kotlin/kr/summitsystems/springbukkit/support/paper/PaperTabCompleter.kt b/spring-bukkit-support/src/main/kotlin/kr/summitsystems/springbukkit/support/paper/PaperTabCompleter.kt index 2106d49..943fd00 100644 --- a/spring-bukkit-support/src/main/kotlin/kr/summitsystems/springbukkit/support/paper/PaperTabCompleter.kt +++ b/spring-bukkit-support/src/main/kotlin/kr/summitsystems/springbukkit/support/paper/PaperTabCompleter.kt @@ -3,17 +3,7 @@ package kr.summitsystems.springbukkit.support.paper import com.destroystokyo.paper.event.server.AsyncTabCompleteEvent import kr.summitsystems.springbukkit.command.CommandTabCompletionProvider import org.bukkit.event.EventHandler -import org.springframework.beans.factory.config.BeanDefinition -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass -import org.springframework.context.annotation.Role -import org.springframework.context.annotation.Scope -import org.springframework.context.annotation.ScopedProxyMode -import org.springframework.stereotype.Component -@ConditionalOnClass(name = ["com.destroystokyo.paper.event.server.AsyncTabCompleteEvent"]) -@Scope(proxyMode = ScopedProxyMode.DEFAULT) -@Component -@Role(BeanDefinition.ROLE_INFRASTRUCTURE) class PaperTabCompleter( private val commandTabCompletionProvider: CommandTabCompletionProvider ) { diff --git a/spring-bukkit-support/src/main/kotlin/kr/summitsystems/springbukkit/support/protocollib/ProtocolLibConfiguration.kt b/spring-bukkit-support/src/main/kotlin/kr/summitsystems/springbukkit/support/protocollib/ProtocolLibConfiguration.kt new file mode 100644 index 0000000..986ea4e --- /dev/null +++ b/spring-bukkit-support/src/main/kotlin/kr/summitsystems/springbukkit/support/protocollib/ProtocolLibConfiguration.kt @@ -0,0 +1,16 @@ +package kr.summitsystems.springbukkit.support.protocollib + +import com.comphenix.protocol.ProtocolLibrary +import com.comphenix.protocol.ProtocolManager +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration + +@Configuration +class ProtocolLibConfiguration { + @ConditionalOnClass(name = ["com.comphenix.protocol.ProtocolManager"]) + @Bean + fun protocolManager(): ProtocolManager { + return ProtocolLibrary.getProtocolManager() + } +} \ No newline at end of file