I can build the paperweight-test-plugin from PaperMC github. But I can't build my project written in kotlin.
The project was initialy created with Intellij minecraft development plugin
build.gradle.kts:
everything else is the same. I have read other posts but I can't figure it out.
If I change the version of paperweight to
What files? Where are they?
Sorry, I am trying to make my first plugin.
If you can't help me fix this, how can I access the nms without paperweight? In the docs it is said about reflection but I don't understand how to use that?
Thank you
The project was initialy created with Intellij minecraft development plugin
build.gradle.kts:
Java:
plugins {
kotlin("jvm") version "2.1.20"
id("io.papermc.paperweight.userdev") version "2.0.0-beta.16"
id("com.gradleup.shadow") version "8.3.0"
id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.2.0"
}
group = "me.RecReo.dedbodies"
version = "0.1"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/") {
name = "papermc-repo"
}
maven("https://oss.sonatype.org/content/groups/public/") {
name = "sonatype"
}
// gradlePluginPortal()
// maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
paperweight.paperDevBundle("1.21.5-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.21.5")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
}
val targetJavaVersion = 21
kotlin {
jvmToolchain(targetJavaVersion)
}
tasks.build {
dependsOn("shadowJar")
}
tasks.processResources {
val props = mapOf("version" to version)
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("plugin.yml") {
expand(props)
}
}
tasks {
compileKotlin {
kotlinOptions {
jvmTarget = "21"
}
}
compileJava {
options.release.set(21)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
}
}
tasks.shadowJar {
destinationDirectory.set(file("outpath"))
archiveBaseName.set("plugin")
archiveVersion.set("")
archiveClassifier.set("")
dependencies {
include(dependency("org.jetbrains.kotlin:kotlin-stdlib"))
}
}
everything else is the same. I have read other posts but I can't figure it out.
If I change the version of paperweight to
1.7.7
another error message appears:
Code:
Expected configuration ':paperweightDevelopmentBundle' to contain exactly one file, however, it contains more than one file.
Sorry, I am trying to make my first plugin.
If you can't help me fix this, how can I access the nms without paperweight? In the docs it is said about reflection but I don't understand how to use that?
Thank you