import io.papermc.paperweight.tasks.RebuildGitPatches plugins { java `maven-publish` id("com.github.johnrengelman.shadow") version "8.1.1" apply false id("io.papermc.paperweight.patcher") version "1.5.11" } val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" repositories { mavenCentral() maven(paperMavenPublicUrl) { content { onlyForConfigurations(configurations.paperclip.name) } } } dependencies { remapper("net.fabricmc:tiny-remapper:0.8.10:fat") decompiler("net.minecraftforge:forgeflower:2.0.627.2") paperclip("io.papermc:paperclip:3.0.3") } allprojects { apply(plugin = "java") apply(plugin = "maven-publish") java { toolchain { languageVersion.set(JavaLanguageVersion.of(17)) } } } subprojects { tasks.withType { options.encoding = Charsets.UTF_8.name() options.release.set(17) } tasks.withType { options.encoding = Charsets.UTF_8.name() } tasks.withType { filteringCharset = Charsets.UTF_8.name() } repositories { mavenCentral() maven(paperMavenPublicUrl) } } paperweight { serverProject.set(project(":folia-server")) remapRepo.set(paperMavenPublicUrl) decompileRepo.set(paperMavenPublicUrl) usePaperUpstream(providers.gradleProperty("paperRef")) { withPaperPatcher { apiPatchDir.set(layout.projectDirectory.dir("patches/api")) apiOutputDir.set(layout.projectDirectory.dir("Folia-API")) serverPatchDir.set(layout.projectDirectory.dir("patches/server")) serverOutputDir.set(layout.projectDirectory.dir("Folia-Server")) } } } tasks.generateDevelopmentBundle { apiCoordinates.set("dev.folia:folia-api") mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi") libraryRepositories.addAll( "https://repo.maven.apache.org/maven2/", paperMavenPublicUrl, ) } allprojects { publishing { repositories { maven("https://repo.papermc.io/repository/maven-snapshots/") { name = "paperSnapshots" credentials(PasswordCredentials::class) } } } } publishing { if (project.hasProperty("publishDevBundle")) { publications.create("devBundle") { artifact(tasks.generateDevelopmentBundle) { artifactId = "dev-bundle" } } } } tasks.withType { filterPatches.set(false) } tasks.register("printMinecraftVersion") { doLast { println(providers.gradleProperty("mcVersion").get().trim()) } } tasks.register("printPaperVersion") { doLast { println(project.version) } }