diff --git a/.github/workflows/gradle-ci.yml b/.github/workflows/gradle-ci.yml index ab7a97d..6e8b618 100644 --- a/.github/workflows/gradle-ci.yml +++ b/.github/workflows/gradle-ci.yml @@ -13,11 +13,11 @@ jobs: with: submodules: 'true' - - name: Set up JDK 16 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: distribution: adopt - java-version: 16 + java-version: 17 cache: gradle - name: Grant execute permission for gradlew diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index b2d9329..b64cd49 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -16,11 +16,11 @@ jobs: with: submodules: 'true' - - name: Set up JDK 16 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: distribution: adopt - java-version: 16 + java-version: 17 cache: gradle - name: Grant execute permission for gradlew @@ -43,5 +43,6 @@ jobs: prerelease: false automatic_release_tag: v${{ steps.extract_version.outputs.version }} files: | - protocolburrito-plugin/build/libs/ProtocolBurrito-*.jar + protocolburrito-plugin/build/libs/protocolburrito-plugin*.jar + !*-dev* diff --git a/build.gradle.kts b/build.gradle.kts index 9551da1..fd0c3cd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,9 @@ plugins { kotlin("jvm") - id("com.github.johnrengelman.shadow") version "7.0.0" - id("com.mineinabyss.conventions.publication") - id("de.undercouch.download") version "4.1.2" + id("com.mineinabyss.conventions.kotlin") id("com.mineinabyss.conventions.nms") - id("com.google.devtools.ksp") version "1.6.10-1.0.2" + id("com.mineinabyss.conventions.publication") + id("com.github.johnrengelman.shadow") version "7.0.0" } repositories { @@ -32,19 +31,18 @@ allprojects { dependencies { compileOnly("org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT") - implementation(project(":protocolburrito-api")) + api(project(":protocolburrito-api")) compileOnly(project(":protocolburrito-generator")) - ksp(project(":protocolburrito-generator")) } sourceSets["main"].java.srcDir(file("$rootDir/protocolburrito-generator/build/generated/burrito/main")) tasks { -// val downloadMappings by register("Download mappings") { -// src("https://launcher.mojang.com/v1/objects/f6cae1c5c1255f68ba4834b16a0da6a09621fe13/server.txt") -// dest(file("mappings/server.txt")) -// } + assemble { + dependsOn(reobfJar) + dependsOn(project(":protocolburrito-plugin").tasks.build) + } shadowJar { archiveClassifier.set("") } @@ -52,12 +50,4 @@ tasks { sourcesJar { from(sourceSets.main.get().allSource) } - -// publish { -// dependsOn(downloadMappings) -// } - - build { - dependsOn(/*downloadMappings,*/ project(":protocolburrito-plugin").tasks.build) - } } diff --git a/gradle.properties b/gradle.properties index aad0d58..e2d27fe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,6 @@ -version=0.2 +version=0.3 group=com.mineinabyss kotlinVersion=1.6.10 serverVersion=1.18.2-R0.1-SNAPSHOT -idofrontVersion=0.9.82 - -# Workaround for Kapt not working on jdk 16 -org.gradle.jvmargs=--illegal-access=permit -kapt.use.worker.api=false +idofrontVersion=0.9.83 +publishComponentName=java diff --git a/protocolburrito-api/build.gradle.kts b/protocolburrito-api/build.gradle.kts index f48ffac..46df546 100644 --- a/protocolburrito-api/build.gradle.kts +++ b/protocolburrito-api/build.gradle.kts @@ -1,11 +1,9 @@ plugins { - kotlin("jvm") -} - -repositories { - mavenCentral() + id("com.mineinabyss.conventions.kotlin") + id("com.mineinabyss.conventions.papermc") + id("com.mineinabyss.conventions.publication") } dependencies { - compileOnly("org.spigotmc:spigot-api:1.17-R0.1-SNAPSHOT") + compileOnly(libs.kotlin.reflect) } diff --git a/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/FieldHelpers.kt b/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/FieldHelpers.kt index 384a294..30d3d96 100644 --- a/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/FieldHelpers.kt +++ b/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/FieldHelpers.kt @@ -1,13 +1,24 @@ package com.mineinabyss.protocolburrito object FieldHelpers { - fun getField(forObject: Any, type: Class, index: Int): T { + inline fun getField(forObject: Any, index: Int): T = + getField(T::class.java, forObject, index) + + fun getField(type: Class, forObject: Any, index: Int): T { var id = 0 - return forObject::class.java.fields.first { it.type.kotlin == type && index == id++ }.get(forObject) as T + return forObject::class.java.declaredFields.first { it.type.kotlin.javaObjectType == type && index == id++ } + .also { + it.isAccessible = true + }.get(forObject) as T } - fun setField(forObject: Any, type: Class, index: Int, value: T) { + inline fun setField(forObject: Any, index: Int, value: T?) = + setField(T::class.java, forObject, index, value) + + fun setField(type: Class, forObject: Any, index: Int, value: T?) { var id = 0 - forObject::class.java.fields.first { it.type == type && index == id++ }.set(forObject, value) + forObject::class.java.declaredFields.first { it.type.kotlin.javaObjectType == type && index == id++ }.also { + it.isAccessible = true + }.set(forObject, value) } } diff --git a/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/WrappedCompanion.kt b/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/WrappedCompanion.kt new file mode 100644 index 0000000..35d69f1 --- /dev/null +++ b/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/WrappedCompanion.kt @@ -0,0 +1,10 @@ +package com.mineinabyss.protocolburrito + +import com.comphenix.protocol.PacketType +import com.comphenix.protocol.injector.packet.PacketRegistry + +interface WrappedCompanion { + val type: PacketType + + fun wrap(any: Any): Any +} diff --git a/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/WrappedPacket.kt b/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/WrappedPacket.kt index ddb3d51..9dc9823 100644 --- a/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/WrappedPacket.kt +++ b/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/WrappedPacket.kt @@ -1,13 +1,3 @@ package com.mineinabyss.protocolburrito -import com.comphenix.protocol.PacketType -import com.comphenix.protocol.events.PacketContainer - -abstract class WrappedPacket( - val handle: PacketContainer, - val packetType: PacketType? = null, -) { - init { - require(packetType == null || handle.type == packetType) { "${handle.handle} is not a packet of type $packetType" } - } -} +interface WrappedPacket diff --git a/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/dsl/ProtocolManagerBurrito.kt b/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/dsl/ProtocolManagerBurrito.kt index c393f33..1b08228 100644 --- a/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/dsl/ProtocolManagerBurrito.kt +++ b/protocolburrito-api/src/main/kotlin/com/mineinabyss/protocolburrito/dsl/ProtocolManagerBurrito.kt @@ -7,26 +7,31 @@ import com.comphenix.protocol.events.ListenerPriority import com.comphenix.protocol.events.PacketAdapter import com.comphenix.protocol.events.PacketContainer import com.comphenix.protocol.events.PacketEvent +import com.comphenix.protocol.injector.packet.PacketRegistry +import com.mineinabyss.protocolburrito.WrappedCompanion +import com.mineinabyss.protocolburrito.WrappedPacket import org.bukkit.Bukkit import org.bukkit.entity.Entity import org.bukkit.entity.Player import org.bukkit.plugin.Plugin import java.util.* +import kotlin.reflect.KFunction1 +import kotlin.reflect.full.companionObject +import kotlin.reflect.full.companionObjectInstance class ProtocolManagerBurrito( val protocolManager: ProtocolManager, val plugin: Plugin ) : ProtocolManager by protocolManager { - inline fun onSend( - crossinline instantiate: (PacketContainer) -> T, - vararg packets: PacketType, + inline fun onSend( priority: ListenerPriority = ListenerPriority.NORMAL, - crossinline onSend: T.(event: PacketEvent) -> Unit + crossinline onSend: PacketEvent.(wrapped: T) -> Unit ) { - onSend(*packets, priority = priority) { instantiate(packet).onSend(this) } + val companion = T::class.companionObjectInstance as WrappedCompanion + onSend(companion.type, priority = priority) { onSend(companion.wrap(packet.handle) as T) } } - inline fun ProtocolManager.onSend( + inline fun onSend( vararg packets: PacketType, priority: ListenerPriority = ListenerPriority.NORMAL, crossinline onSend: PacketEvent.() -> Unit @@ -38,16 +43,15 @@ class ProtocolManagerBurrito( }) } - inline fun onReceive( - crossinline instantiate: (PacketContainer) -> T, - vararg packets: PacketType, + inline fun onReceive( priority: ListenerPriority = ListenerPriority.NORMAL, - crossinline onReceive: T.(event: PacketEvent) -> Unit + crossinline onReceive: PacketEvent.(wrapped: T) -> Unit ) { - onReceive(*packets, priority = priority) { instantiate(packet).onReceive(this) } + val companion = T::class.companionObjectInstance as WrappedCompanion + onReceive(companion.type, priority = priority) { onReceive(companion.wrap(packet.handle) as T) } } - inline fun ProtocolManager.onReceive( + inline fun onReceive( vararg packets: PacketType, priority: ListenerPriority = ListenerPriority.NORMAL, crossinline onSend: PacketEvent.() -> Unit diff --git a/protocolburrito-generator/build.gradle.kts b/protocolburrito-generator/build.gradle.kts index e9d37e6..c4644c1 100644 --- a/protocolburrito-generator/build.gradle.kts +++ b/protocolburrito-generator/build.gradle.kts @@ -4,8 +4,6 @@ val serverVersion: String by project plugins { kotlin("jvm") -// kotlin("kapt") -// id("com.mineinabyss.conventions.nms") id("io.papermc.paperweight.userdev") } @@ -19,14 +17,13 @@ dependencies { paperDevBundle(serverVersion) implementation(kotlin("reflect")) implementation("io.papermc.paper:paper-server:userdev-1.18.2-R0.1-SNAPSHOT") -// implementation("com.comphenix.protocol:ProtocolLib:4.7.0") + implementation("com.comphenix.protocol:ProtocolLib:4.7.0") implementation("com.nfeld.jsonpathkt:jsonpathkt:2.0.0") implementation("com.squareup:kotlinpoet:1.10.1") implementation(project(":protocolburrito-api")) - implementation("com.google.devtools.ksp:symbol-processing-api:1.6.10-1.0.2") - compileOnly("com.google.auto.service:auto-service:1.0") -// kapt("com.google.auto.service:auto-service:1.0") +// implementation("com.google.devtools.ksp:symbol-processing-api:1.6.10-1.0.2") +// compileOnly("com.google.auto.service:auto-service:1.0") implementation("org.reflections:reflections:0.9.12") implementation(kotlin("reflect")) } diff --git a/protocolburrito-generator/gradle.properties b/protocolburrito-generator/gradle.properties deleted file mode 100644 index ee6f471..0000000 --- a/protocolburrito-generator/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -# Workaround for Kapt not working on jdk 16 -org.gradle.jvmargs=--illegal-access=permit -kapt.use.worker.api=false diff --git a/protocolburrito-generator/src/main/kotlin/com/mineinabyss/protocolburrito/generation/AnnotationProcessor.kt b/protocolburrito-generator/src/main/kotlin/com/mineinabyss/protocolburrito/generation/AnnotationProcessor.kt deleted file mode 100644 index a173a01..0000000 --- a/protocolburrito-generator/src/main/kotlin/com/mineinabyss/protocolburrito/generation/AnnotationProcessor.kt +++ /dev/null @@ -1,49 +0,0 @@ -package com.mineinabyss.protocolburrito.generation - -import com.google.auto.service.AutoService -import com.google.devtools.ksp.processing.Resolver -import com.google.devtools.ksp.processing.SymbolProcessor -import com.google.devtools.ksp.processing.SymbolProcessorEnvironment -import com.google.devtools.ksp.processing.SymbolProcessorProvider -import com.google.devtools.ksp.symbol.KSAnnotated -import javax.annotation.processing.* -import javax.lang.model.SourceVersion -import javax.lang.model.element.TypeElement - -/** - * Add this annotation to a class in another module to get codegen to actually run. Will be unnecessary once we switch - * to KSP instead of kapt. - */ -@Retention(AnnotationRetention.SOURCE) -annotation class RunGenerator - -@AutoService(Processor::class) -@SupportedSourceVersion(SourceVersion.RELEASE_16) -@SupportedOptions(AnnotationProcessor.KAPT_KOTLIN_GENERATED_OPTION_NAME) -class AnnotationProcessor( - val environment: SymbolProcessorEnvironment -) : SymbolProcessor { - companion object { - const val KAPT_KOTLIN_GENERATED_OPTION_NAME = "kapt.kotlin.generated" - var generatedDir: String = "build/generated/burrito/main/" - } - -// override fun getSupportedAnnotationTypes() = mutableSetOf(RunGenerator::class.java.name) - -// override fun process(annotations: MutableSet, roundEnv: RoundEnvironment): Boolean { -// generatedDir = processingEnv.options[KAPT_KOTLIN_GENERATED_OPTION_NAME]!! -// main() -// return false -// } - - override fun process(resolver: Resolver): List { - main() - return listOf() - } -} - -class ProtocolProcessorProvider: SymbolProcessorProvider { - override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor { - return AnnotationProcessor(environment) - } -} diff --git a/protocolburrito-generator/src/main/kotlin/com/mineinabyss/protocolburrito/generation/ProtocolWrapperGenerator.kt b/protocolburrito-generator/src/main/kotlin/com/mineinabyss/protocolburrito/generation/ProtocolWrapperGenerator.kt index 9ab1fe6..a230bf6 100644 --- a/protocolburrito-generator/src/main/kotlin/com/mineinabyss/protocolburrito/generation/ProtocolWrapperGenerator.kt +++ b/protocolburrito-generator/src/main/kotlin/com/mineinabyss/protocolburrito/generation/ProtocolWrapperGenerator.kt @@ -1,57 +1,48 @@ package com.mineinabyss.protocolburrito.generation -import com.comphenix.protocol.events.PacketContainer +import com.comphenix.protocol.PacketType +import com.comphenix.protocol.injector.packet.PacketRegistry import com.mineinabyss.protocolburrito.FieldHelpers +import com.mineinabyss.protocolburrito.WrappedCompanion import com.mineinabyss.protocolburrito.WrappedPacket import com.squareup.kotlinpoet.* import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy import net.minecraft.network.protocol.Packet -import net.minecraft.world.entity.Entity -import net.minecraft.world.entity.EntityType import org.reflections.Reflections import org.reflections.scanners.SubTypesScanner import java.io.File -import java.lang.reflect.Field -import java.lang.reflect.WildcardType import java.util.concurrent.atomic.AtomicInteger +import kotlin.reflect.KType import kotlin.reflect.KVisibility -import kotlin.reflect.javaType +import kotlin.reflect.full.declaredMemberProperties +import kotlin.reflect.jvm.jvmErasure import kotlin.reflect.typeOf //val SERVER_VERSION = "1.17" //val PROJECT_ROOT = File("")//File(AnnotationProcessor.generatedDir)//.parentFile.parentFile.parentFile.parentFile.parentFile //val SERVER_PATH = File(PROJECT_ROOT, "minecraft-data/data/pc/$SERVER_VERSION/") //val MAPPINGS = File(PROJECT_ROOT, "mappings/server.txt") +val OUTPUT_DIR = File("build/generated/burrito/main/") - -@OptIn(DelicateKotlinPoetApi::class, ExperimentalStdlibApi::class) fun generateProtocolExtensions() { - val classLoader = AnnotationProcessor::class.java.classLoader val reflections = Reflections("net.minecraft.network.protocol.game", SubTypesScanner(false)) - reflections.getSubTypesOf(Packet::class.java).forEach { packetClass -> - val indices = mutableMapOf, AtomicInteger>() - val props = packetClass.declaredFields.mapNotNull { field -> - if(field.type.kotlin.visibility != KVisibility.PUBLIC) return@mapNotNull null - val index = indices.getOrPut(field.type) { AtomicInteger(0) } - PropertySpec.builder(field.name, field.type.let { - if(field.type.typeParameters.isNotEmpty()) { - if(it != EntityType::class.java) return@mapNotNull null - it.asClassName().parameterizedBy( - WildcardTypeName.producerOf(Entity::class.java) - ) - } - else it.asTypeName() - }) - .receiver(packetClass) + reflections.getSubTypesOf(Packet::class.java).map { it.kotlin }.forEach { packetClass -> + val indices = mutableMapOf() + val props = packetClass.declaredMemberProperties.mapNotNull { field -> + val type = field.returnType + if (field.visibility == KVisibility.PUBLIC) return@mapNotNull null + if (field.returnType.jvmErasure.visibility != KVisibility.PUBLIC) return@mapNotNull null + val index = indices.getOrPut(type) { AtomicInteger(0) } + PropertySpec.builder(field.name, type.asTypeName().copy(annotations = listOf())) //.let { .getter( FunSpec.getterBuilder() - .addStatement("return %T.getField(this, %T::class.java, ${index.toInt()})", FieldHelpers::class, field.type) + .addStatement("return %T.getField(handle, ${index.toInt()})", FieldHelpers::class) .build() ) .setter( FunSpec.setterBuilder() - .addParameter(ParameterSpec.builder("value", field.type).build()) - .addCode("%T.setField(this, %T::class.java, ${index.toInt()}, value)", FieldHelpers::class, field.type) + .addParameter(ParameterSpec.builder("value", type.asTypeName()).build()) + .addCode("%T.setField(handle, ${index.toInt()}, value)", FieldHelpers::class) .build() ) .mutable(true) @@ -60,107 +51,67 @@ fun generateProtocolExtensions() { } } - val file = FileSpec.builder("com.mineinabyss.protocolburrito.packets", packetClass.simpleName + "Extensions") - .apply { - for(prop in props) { - addProperty(prop) - } - } + val className = packetClass.simpleName + "Wrap" + val file = FileSpec.builder("com.mineinabyss.protocolburrito.packets", className) + .addType( + TypeSpec + .classBuilder(className) + .addSuperinterface(WrappedPacket::class) + .primaryConstructor( + // We specify any type to avoid issues if class names change + // Instead we get a packet from ProtocolLib's PacketType which should be + // consistent across versions. + PropertySpec.builder("handle", Any::class/*packetClass*/).build() + ) +// .addProperty("handle", packetClass) + .addProperties(props) + .addType( + TypeSpec + .companionObjectBuilder() + .addSuperinterface(WrappedCompanion::class) + .addProperty( + PropertySpec.builder("type", PacketType::class) + .addModifiers(KModifier.OVERRIDE) + .getter( + FunSpec.getterBuilder() + .addStatement( + "return %T.getPacketType(%T::class.java)", PacketRegistry::class, packetClass + ).build() + ) + .build() + ) + .addFunction( + FunSpec.builder("wrap") + .addModifiers(KModifier.OVERRIDE) + .addParameter("any", Any::class) + .addStatement("return $className(any as %T)", packetClass) + .build() + ) + .build() + ) + .build() + ) + .addFunction( + FunSpec.builder("wrap") + .receiver(packetClass) + .addModifiers(KModifier.INLINE) + .addStatement("return $className(this)") + .build() + ) .build() - file.writeTo(File(AnnotationProcessor.generatedDir)) + file.writeTo(OUTPUT_DIR) } } -/* -data class Prop( - val typeInfo: TypeMap.TypeInfo<*>, - val name: String, -) - - -fun generateProtocolWrappers() { - var className: String? = null - var props: MutableList? = null - val mappings = MAPPINGS.forEachLine { line -> - when { - line.startsWith("net.minecraft.network.protocol.game") -> { - if (className != null && props?.isNotEmpty() == true) { - runCatching { - generateWrapper(className!!, props!!) - }.onFailure { - println("Skipping $className due to error") - it.printStackTrace() - } - } - className = - line.removePrefix("net.minecraft.network.protocol.game.").substringBefore(" ").substringBefore("$") - props = mutableListOf() - } - line.startsWith(" ") && props != null -> { - val (type, name, _, fieldName) = line.drop(4).split(" ") - Property.of(type, name)?.let { props!! += it } - } - } - } - -} +fun TypeSpec.Builder.primaryConstructor(vararg properties: PropertySpec): TypeSpec.Builder { + val propertySpecs = properties.map { p -> p.toBuilder().initializer(p.name).build() } + val parameters = propertySpecs.map { ParameterSpec.builder(it.name, it.type).build() } + val constructor = FunSpec.constructorBuilder() + .addParameters(parameters) + .build() -data class Property( - val typeInfo: TypeMap.TypeInfo<*>, - val name: String, -) { - companion object { - fun of(type: String, name: String): Property? { - return Property(TypeMap.types[type] ?: return null, name) - } - } -} - -fun generateWrapper(packetName: String, params: List) { - val className = packetName.split("_").joinToString("") { it.capitalize() } -// println("${this["name"]} ${this["type"]}") - -// val typeClasses: List> = params.toSet().mapNotNull { -// types[it["type"]] -// } - - val indices = mutableMapOf, AtomicInteger>() - val props: List = params.mapNotNull { (typeInfo, name) -> - val index = indices.getOrPut(typeInfo) { AtomicInteger(0) } - - PropertySpec.builder(name, typeInfo.kClass) - .getter( - FunSpec.getterBuilder() - .addStatement("return handle.${typeInfo.structureModified.name}().read(${index.toInt()})").build() - ) - .setter( - FunSpec.setterBuilder() - .addParameter(ParameterSpec.builder("value", typeInfo.kClass).build()) - .addCode("handle.${typeInfo.structureModified.name}().write(${index.toInt()}, value)").build() - ) - .mutable(true) - .build().also { - index.getAndAdd(1) - } - } - - val file = FileSpec.builder("com.mineinabyss.protocolburrito.packets", className) - .addType( - TypeSpec - .classBuilder(className) - .superclass(WrappedPacket::class) - .addSuperclassConstructorParameter("handle") - .primaryConstructor( - FunSpec - .constructorBuilder() - .addParameter("handle", PacketContainer::class) - .build() - ) - .addProperties(props) - .build() - ).build() - - file.writeTo(File(AnnotationProcessor.generatedDir)) + return this + .primaryConstructor(constructor) + .addProperties(propertySpecs) } -*/ diff --git a/protocolburrito-plugin/build.gradle.kts b/protocolburrito-plugin/build.gradle.kts index b261cdc..3293792 100644 --- a/protocolburrito-plugin/build.gradle.kts +++ b/protocolburrito-plugin/build.gradle.kts @@ -1,18 +1,16 @@ -import Com_mineinabyss_conventions_platform_gradle.Deps - val idofrontVersion: String by project plugins { id("com.mineinabyss.conventions.kotlin") id("com.mineinabyss.conventions.papermc") + id("com.mineinabyss.conventions.nms") id("com.mineinabyss.conventions.copyjar") - kotlin("kapt") - id("de.nycode.spigot-dependency-loader") version "1.0.3" +// id("de.nycode.spigot-dependency-loader") version "1.0.3" } dependencies { // MineInAbyss platform - spigot(Deps.kotlin.stdlib) +// spigot(libs.kotlin.stdlib) implementation(project(":")) implementation("com.mineinabyss:idofront:$idofrontVersion") @@ -20,8 +18,6 @@ dependencies { tasks { shadowJar { - archiveBaseName.set("ProtocolBurrito") - archiveClassifier.set("") minimize { include(dependency("com.mineinabyss:idofront.*:.*")) } diff --git a/protocolburrito-plugin/gradle.properties b/protocolburrito-plugin/gradle.properties deleted file mode 100644 index 60b871e..0000000 --- a/protocolburrito-plugin/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -useNMS=true diff --git a/protocolburrito-plugin/src/main/kotlin/com/mineinabyss/protocolburrito/ProtocolBurritoPlugin.kt b/protocolburrito-plugin/src/main/kotlin/com/mineinabyss/protocolburrito/ProtocolBurritoPlugin.kt index b272237..6891501 100644 --- a/protocolburrito-plugin/src/main/kotlin/com/mineinabyss/protocolburrito/ProtocolBurritoPlugin.kt +++ b/protocolburrito-plugin/src/main/kotlin/com/mineinabyss/protocolburrito/ProtocolBurritoPlugin.kt @@ -1,8 +1,12 @@ package com.mineinabyss.protocolburrito +import com.mineinabyss.idofront.platforms.IdofrontPlatforms import org.bukkit.plugin.java.JavaPlugin class ProtocolBurritoPlugin : JavaPlugin() { + override fun onLoad() { + IdofrontPlatforms.load(this, "mineinabyss") + } override fun onEnable() { logger.info("ProtocolBurrito is ready to start wrapping packets!") } diff --git a/settings.gradle.kts b/settings.gradle.kts index 8f299fe..9ac6cd2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -14,7 +14,6 @@ pluginManagement { plugins { val kotlinVersion: String by settings kotlin("jvm") version kotlinVersion - kotlin("kapt") version kotlinVersion kotlin("plugin.serialization") version kotlinVersion } diff --git a/src/main/kotlin/com/mineinabyss/protocolburrito/Generate.kt b/src/main/kotlin/com/mineinabyss/protocolburrito/Generate.kt deleted file mode 100644 index 7172a16..0000000 --- a/src/main/kotlin/com/mineinabyss/protocolburrito/Generate.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.mineinabyss.protocolburrito - -import com.mineinabyss.protocolburrito.generation.RunGenerator - -@RunGenerator -private class Generate