#build-tooling-help
1 messages · Page 13 of 1
I’ve heard mixed things about 2.0 so far but
if it’s working for u then it’s good
yeah, did a little bit of investigation as well - you can see here:
https://repo.onarandombox.com/content/groups/public/com/onarandombox/multiverseCore/Multiverse-Core/4.3.12/Multiverse-Core-4.3.12.pom
there it's defined with all lowercase in its pom-file
you can browse the maven repo manually to see its structure:
https://repo.onarandombox.com/content/groups/public/com/onarandombox/multiverseCore/Multiverse-Core/4.3.12/
end of the day, pom-file is what matters
could it perhaps be some cache or something?
what's your project structure like? is it a multi-module setup?
what does your settings.gradle.kts and gradle.properties look like?
https://github.com/mcbrawls/api, but have already fixed it by upgrading to kotlin 2.0
yeah, saw - Gradle likes to break from time to time 😛 can be very annoying
I see.. thank you!
forgive my misunderstandings, but I've been trying to get the following to work with no avail.
I have a utility plugin built using paperweight, and I'm trying to depend on it with a plugin using maven.
the utility dependency is published on github packages, but including it as a dependency on the latter plugin results in this error:
Could not find artifact co.killionrevival:killioncommons:jar:1.1.6-SNAPSHOT in killioncommonsgithub (https://maven.pkg.github.com/KillionRevival/*)
my .m2 settings xml is correct, I can definitely reach the github repository. I want to bring in killioncommons-1.1.6-20240802.173526-1-dev-all.jar, is maven not picking up on that with my dependency of
<dependency>
<groupId>co.killionrevival</groupId>
<artifactId>killioncommons</artifactId>
<version>1.1.6-SNAPSHOT</version>
</dependency>
(is it looking for killioncommons-1.1.6-SNAPSHOT.jar?)
what else is needed to bring in that dependency? I felt like it was some combination of how I set up the gradle buildscript for the utility plugin, but I can't figure out how to get it to resolve.
does the link it send work in your browser
but you probably need to change the jar it’s publishing
mvn.pkg.github.com?
that specific link doesn't work but it's from settings.xml:
<repository>
<id>killioncommonsgithub</id>
<url>https://maven.pkg.github.com/KillionRevival/*</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
I am publishing that jar
https://github.com/KillionRevival/KillionCommons/packages/2214410
did you add your GitHub api key to maven too
yes, that's also in the settings.xml
also, depending on this works fine for gradle projects. I'm only having an issue bringing it down with Maven
this is what the GitHub docs have
I have
other than that tho idk you’ll have to wait for someone else
I haven’t used maven in 8 years
maven and github packages... two things I don't want to touch lol
yeah kinda regretting it atm
Hello, I posted a library on jitpack with a both compile and runtime dependency in it. But when I use this Jitpack library in my plugin with implementation its dependency is only in runtime. Using setTransitive didnt help. What should I do?
do you have an example build script of your library? my guess is that you're not using the api* configurations that expose the dependencies for consumers
👍
repositories {
mavenCentral()
maven {
url "https://repo.opencollab.dev/maven-releases/"
}
maven {
url "https://repo.opencollab.dev/maven-snapshots/"
}
maven {
url "https://jitpack.io"
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
publishing {
publications {
maven(MavenPublication) {
groupId = group
artifactId = project.name
version = version
from components.java
}
}
}
dependencies {
compileOnly "org.jetbrains:annotations:24.1.0"
compileOnly "org.projectlombok:lombok:1.18.32"
annotationProcessor "org.projectlombok:lombok:1.18.32"
implementation "com.github.AlexProgrammerDE:MCProtocolLib:576b311" /* THE dependency */
}
yea you have to use the api configuration there if you want to use MCPL from the plugin
Ill try now
do note that you need the java-library and not the base java plugin in gradle for those
yes and thank you
just waiting now for jitpack to finish its work
yes it worked thank you very much you are a life saver 👍
its quite strange that jitpack didnt mention this in the doc though
jitpack just deals with the publishing side of things, this is a gradle module metadata thing
haha, looks like I was searching in the wrong place
Hello, I need help compiling my plugin. As it supports 1.18-1.21, I'd like to compile it using Java 17. However, I also use NMS (paperweight plugin) and the 1.21 module is build using Java 21.
v1_21_R1 build.gradle.kts:
plugins {
id("io.papermc.paperweight.userdev") version "1.7.1"
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
dependencies {
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT")
}
plugin build.gradle.kts:
plugins {
id("com.github.johnrengelman.shadow") version("8.1.1")
}
repositories {
maven("https://repo.oraxen.com/releases")
}
dependencies {
implementation(project(":nms:v1_21_R1"))
// More NMS versions and other dependencies...
}
tasks {
shadowJar {
minimize()
// Shade adventure to support Spigot
relocate("net.kyori", "net.kyori")
archiveFileName.set("${project.parent?.name}-${project.version}.jar")
}
}
I am migrating from maven to Gradle, and the maven toolchain plugin worked. How can I compile the v1_21_R1 module with Java 21 and the plugin module with Java 17?
I am trying to build the plugin using the task "jar" but I get the error Unsupported class file major version 65
Note that, for example, in a 1.18 server using Java 17, the v1_21_R1 module would never be used so it wouldn't matter that it's compiled using Java 21
Hence why it worked in maven
Now I need to figure out how to do the same thing using Gradle
relocate("net.kyori", "net.kyori")
mmm I have noticed this
I’m not sure of a good solution other than making the whole project Java 21 and then the 17 modules specifically 17 with toolchain and options.release
That would be kinda useless since if the "plugin" module uses Java 21, the serve will need to run java 21
Yeah, it wouldn't let me access some API methods that returned adventure components otherwise
But plugin would need to be Java 21 to implement v1_21_R1 right?
there’s a thing
it’s like uhhh disable auto target jvm
might help
I’m sleepy
if u don’t figure it out by tmrw I’ll take another look
iirc it’s on the java extension
I'm trying to make a gradle script for my NMS implementations using userdev
apply plugin: 'java'
apply plugin: 'io.papermc.paperweight.userdev'
ext {
minecraftVersion = project.hasProperty('minecraftVersion') ? project.minecraftVersion : '1.17.1-R0.1-SNAPSHOT'
}
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
maven {
url = "https://repo.papermc.io/repository/maven-public/"
}
}
dependencies {
paperweight.paperDevBundle(minecraftVersion)
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
options.encoding = 'UTF-8'
}
but it ends up failing to build
https://paste.itsme.to/ipirawutix.yaml
here is my script implementation:
plugins {
id 'io.papermc.paperweight.userdev' version '1.7.1'
}
ext {
minecraftVersion = '1.17.1-R0.1-SNAPSHOT'
}
apply from: rootProject.file("version/script/remapped.gradle")
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.Companion.REOBF_PRODUCTION```
Hmm I wasn't able to figure it out... I tried adding this in the root build.gradle.kts
// Tried "subprojects" too
allprojects {
apply(plugin = "java")
java {
disableAutoTargetJvm()
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
}
I tried setting that java block in the plugin build.gradle.kts block too, I've tried all combinations of setting disableAutoTargetJvm() in only specific modules or everywhere and I keep getting the Unsupported class file major version 65 error no matter what I do
why are you disabling auto-targeting
if you want a specific module to generate some specific bytecode, you can just set the release flag in its compileJava task
plugins {
id("io.papermc.paperweight.userdev") version "1.7.1"
}
dependencies {
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT")
}
tasks {
compileJava {
options.release = 21
}
}
That makes the task fail and throw an error:Cause: error: release version 21 not supported
you need to do the inverse, set the toolchain to 21 and the release flag to 17 in all your java 17 modules, as javac wouldn't be able to release/generate bytecode for a version that it doesn't yet know about
you could make that work by setting the toolchain to 21 there as well though, if you only want a single module with java 21 and the rest with 17
So basically I set the project's java version to 21 but compile everything but 1.20.5-1.21 NMS with 17?
sure, whichever way works best for you
in reality one shouldn't have to care about this kind of bs since the JVM is supposed to be backwards compatible but welp, the ecosystem is kinda fucked in that regard lol
For some reason shadowJar keeps throwing errors... Execution failed for task ':plugin:shadowJar'. > Unsupported class file major version 65
parent build.gradle.kts:
allprojects {
apply(plugin = "java")
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
targetCompatibility = JavaVersion.VERSION_17
}
}
tasks {
compileJava {
options.release = 17
}
}
}
plugin:
plugins {
id("com.github.johnrengelman.shadow") version("8.1.1")
}
// Repos and dependencies.
tasks {
shadowJar {
minimize()
relocate("net.kyori", "net.kyori")
archiveFileName.set("${project.parent?.name}-${project.version}.jar")
destinationDirectory.set(file("../build/libs"))
}
}
v1_21_R1
plugins {
id("io.papermc.paperweight.userdev") version "1.7.1"
}
dependencies {
implementation(project(":nms:nms_common"))
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT")
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
targetCompatibility = JavaVersion.VERSION_21
}
}
tasks {
compileJava {
options.release = 21
}
}
and then switch back to another fork later when they finally publish that
it is published but to sonatype snapshots lol
It finally compiled
Thank you
New issue because I'm stupid
How do I make minimize only minimize adventure? My NMS classes are not being shaded because they are not used at compile time. If I remove the minimize method it works but everything is fully shaded and the final JAR is much heavier
I've tried:
minimize {
include("me/abcdef/myplugin/**")
}
But that only shades the contents inside the "plugin" module
adventure isn't that big?
make sure that you're not shading shit like paper or something in
Yeah but not minimizing makes the Jar go from 3MB tops to like 6MB
Which isn't that much but I'd like to prevent it if possible
are you also supporting spigot? Because if not, then there's no reason to shade adventure
also, you do not need to set targetCompatibility if you set the release flag
Yeah, it's my plan
Even though I don't think many servers use it nowadays
you do not want to minimize adventure then
Doesn't minimizing just not include the classes you don't use?
it can't detect it properly in all cases
yes, however I don't believe the minification algorithm is that smart to follow the transitive dependencies of your classpath
I mean if your plugin works completely without issues after minimizing then it's fine
are you IRC phoenix or just a nicknamed person
click the profile
The adventure part does
Mi issue is that minimizing also removes my NMS modules
Since I access them using Reflection at runtime
minimize the module that you shade adventure in, not the full plugin
It's used in multiple modules including the plugin module
"plugin" in this case being the module that builds your full jar, not the module that contains your code
sorry that wasn't clear
there might be ways to exclude specific classes from the minimization via some setting I guess
but I personally think modules are easier to handle
ah, that's pretty straight forward, I don't really know gradle all that much xD
don't worry, nobody really does lol
lol
Thanks
And lastly
How can I publish my javadoc jar using maven publish?
tasks {
register<Jar>("javadocJar") {
dependsOn(javadoc)
archiveClassifier.set("javadoc")
description = "Creates a Javadoc Jar"
from(javadoc.get().destinationDir)
}
jar {
dependsOn("javadocJar")
finalizedBy(publishToMavenLocal)
}
}
publishing {
publications {
val mavenJava by creating(MavenPublication::class) {
groupId = "me.abcdef"
artifactId = "myplugin-api"
version = "1.2"
from(components["java"])
artifact(tasks.named("javadocJar"))
}
}
}
But for some reason the javadoc jar isn't published
fyi you can just do
java {
withSourcesJar()
withJavadocJar()
} iirc instead of manually creating the tasks
and that finalizedBy shoulnd't be needed
Perfect, thank you
I need it because jitpack runs the jar task
Hello,
Have you got paperspigot 1.20.1 Build 197 ? Or 196 is last version ?
it’s no longer called “paperspigot”and we do not support 1.20.1
nor is this the right channel for that
This is probably more an IDE stuff but is it possible to disable this folders from generating? (resources & test module). I tried removing them but every time I add a submodule they are regenerated
I'm using Intellij
IJ just wants you to write tests ^^
What build tool do you use? Prolly need to disable the source set or something
who writes test for a bukkit plugin lol
Gradle
you need to configure the template generator for it to stop doing that, since creating a module includes it
And there's no setting to do that
Oh, from Live Templates?
nvm that, apparently it depends on the source sets defined as Mini said
Eh where do I disable that then
it's kinda annoying, I would honestly just ignore them
otherwise, just click create directory instead and then it'll ask which source set to gen
#paper-dev message
How can I make sure it uses the right JAR? (non -dev)
My v1_19_R3 module:
plugins {
id("io.papermc.paperweight.userdev") version "1.7.1"
}
dependencies {
paperweight.paperDevBundle("1.19.4-R0.1-SNAPSHOT")
}
tasks {
assemble {
dependsOn(reobfJar)
}
}
My plugin module:
dependencies {
implementation(project(":nms:v1_19_R3"))
// + Other dependencies and NMS modules
}
tasks {
shadowJar {
minimize {
exclude(project(":nms:v1_19_R3"))
// + Other NMS modules
}
relocate("net.kyori", "net.kyori")
archiveFileName.set("${project.parent?.name}-${project.version}.jar")
}
assemble {
dependsOn(shadowJar)
}
}
It generates both a v1_19_R3.jar and a v1_19_R3-dev.jar. How can I guarantee it uses the non-dev one?
you'd want to depend on the reobfuscated configuration of the respective nms modules.
that impl(project()) will just use the non reobfed source code
How can I do that? Or would I have to depend on the generated jar directly?
project("...", "reobf")
Thank you very much!
I have to do the same for 1.20.5-1.21 if I want to maintain Spigot support, right?
yea, but side node, paper's internals can look different in places to spigots
there is little to no guarantee your paper internal code will work on spigot
I'll keep that in mind an test my plugin thoroughly
archiveFileName.set("${project.parent?.name}-${project.version}.jar") is also kind of a no no, renaming the output is generally not a smart idea
you can look into a gradle copy task to copy the output file to a more appropriate name
Hmm why? I never heard it was bad
gradle isn't smart enough in some cases to track that rename
Okay I'll also look into this
Thank you very much
By the way, where does this "reobf" come from? It works but I want to understand why 😂
paperweight configures it as a gradle configuration
how those work exactly would be quite the deep dive 😅
I understand
I'm more interested in knowing how you knew I had to use "reobf". Where does it say it?
So that next time I'm not this annoying 😅
oh, well I knew you had to use it because I know paperweight xD
I dont think we have that specifically documented anywhere
maybe worth to expand our docs page for a multi-module setup
¯_(ツ)_/¯
but also we aren't that big on supporting legacy versions here so, maybe overkill 
I expect a docs PR from you in the next hour cat
i'm dizzy, i'm fighting the urge to go bed
Well it'd affect up to 1.20.4 which right now isn't that old, maybe adding a small section in the paperweight-userdev page is enough
But that's up to you
jmp left a issue open saying how to do it
Yea, maybe one of our trusted docs team members is feeling creative
Yea but these days it would have to be even more annoying with java version missmatch etc
I have import this
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.17.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.17.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bungeecord</artifactId>
<version>4.3.3</version>
</dependency>
but I get an error
in the Bungeecord
share the error
can anyone help me why i'm getting this error
upgrade your gradle wrapper or downgrade java version
upgrade the version of the maven shade plugin
hi, ive been struggling all night to buid a plugin but no luck so far
i am currently getting this error
* What went wrong:
Execution failed for task ':api:compileJava'.
> java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid'```
i guess more information is needed, what else do i need to provide?
do you use lombok?
no
i am using gradle
lombok is a library/annotation processor
this usually happens when it's too old of a version for the jdk you're using
sorry im new to all of this. i just found a nice plugin but it is not built and i have to do it on my own. I have gradle 8.9 and jdk22 and use the terminal to do it, havent downloaded anything else
you will have to bump lombok's version or try with an older jdk
Ok shorted this as well
Still doesn't work but it seems it is related to the plugin itself
Hi, I have a question. I have a library project, and then a plugin that shades that library into its jar file. However, I have an issue. My library plugin also uses stuff from another library, which means that instead of only shading my library project into my plugin, I have to shade in my library project and this other dependency. Is there a way to make it so that in my library project, it automatically will shade this other dependency into the jar file if the plugin depends on this library? I am using gradle.
generally boils down to how you declare it
"api" will generally expose it to consumers, iirc
Adding api gives me access to it in my project that is using the library, but I get exceptions like ClassNotFound exceptions because it is not shaded in
If I shade it in manually though, that stuff goes away
Hi, I am here once again. According to this documentation:
https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_separation
using the api configuration on a dependency of a library with the java-library plugin should put that dependency into the classpath of a consumer of the library. However, that simply just does not work for me. In my consumer project, I use the implementation configuration to include my library, whilst my library has the api configuration to include its dependencies. However, the dependencies are simply not inside of the consumer's shaded jar file that shades in the library. Does anyone know why this is? Do I have to take any additional steps to get this working?
Library Project:
dependencies {
api("my-library-dependency")
}
Consumer Project:
dependencies {
implementation("my-library")
}
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
dependencies {
include(dependency("my-library"))
}
}
you don't need to explicitly include it
but well, time to debug I guess
check the runtimeClasspath to see if the transitive dependency is listed there with .\gradlew dependencies --configuration runtimeClasspath or in your IDE's dependency tree
if it isn't there, then we can assume the library isn't being properly exposed
how to clear paperweight-userdev caches?
It is there underneath my library, which means that it is exposed, just not being shaded in for some reason. I do not want to manually have to shade in all my dependencies; just my library and it should shade all the dependencies in.
there's a task for it
thanks
can you share the output of the above command
all I can assume right now is that shadow is not taking all dependencies of the runtimeClasspath, but unless you provided a certain include/exclude pattern, that's quite unlikely
it makes even less sense considering you tried to explicitly include it, meaning it'd have been included no matter the classpath it was in
how does that even make sense
it doesnt lol
literally in a project with the same config rn
make sure your build file is valid
It works if I include it explicitly, but if I don't, then it does not work
how would I check that
I had a few deprecation warning for version 9
then your transitive dep is definitely in a different classpath
does it show errors?
safe to ignore for now
--- my-library:1.0.0
--- my-library-dependency:1.0.0
send your build file
plugins {
`java-library`
id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.papermc.paperweight.userdev") version "1.7.1"
}
repositories {
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.dmulloy2.net/repository/public/")
maven("https://repo.viaversion.com")
maven("https://repo1.maven.org/maven2/")
maven("https://repo.maven.apache.org/maven2/")
}
dependencies {
api("net.tectonic:tectonic-core:1.0.0")
api("com.zaxxer:HikariCP:5.1.0")
implementation("mysql:mysql-connector-java:8.0.28")
compileOnly("com.comphenix.protocol:ProtocolLib:5.1.0")
compileOnly("com.viaversion:viaversion-api:4.9.2")
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT")
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
}
}
group = "net.tectonic"
version = "2.1.4"
description = "Excavators"
java.sourceCompatibility = JavaVersion.VERSION_21
there is the problem
where
id("com.github.johnrengelman.shadow") version "8.1.1"
oh?
you need to use gradleup's shadow now
either drop it if you dont need it or use gradleup shadow
what do you mean
I mean I only reobfJar now
then you don't need the shadow plugin
alright thanks
unless you're shadowing artifacts, you don't need it
It says that it my library's dependency is underneath the library which is in my runtime classpath
yeah, math isn't mathing for me either
Getting unresolved reference for org.bukkit after migrating to gradle (build file: https://pastes.dev/kZTq38QH6b)
nowhere in the shadow documentation does it say that it excludes transitive dependencies of a direct dependency in the runtime classpath
I do shadow my core project named "tectonic-core" and HikariCP
then you need the shadow plugin
but I dont use the archive that the shadow task produces since it goes directly to reobfjar
paperweight won't bundle that for you
alright
it just automatically hooks the task if it detects it
Gradleup's docs still use the old dependancy?
Just to double check, this is the right shadow plugin, correct?
id("io.github.goooler.shadow") version "8.1.8"
search on the gradle plugins hub
It is and it isn't
Goooler's shadow was a temporary fork, the same maintainer is now officially working on the GradleUp organization which hosts various plugins but the GradleUp shadow is still not available in the plugin portal yet
Okay, so I stick with this for now?
sure, just remember to upgrade later when the gradleup version does land in the plugin portal
Sure, but if that's not the issue, I'm not sure what is
well, it wouldn't hurt to upgrade and see if it just magically works
Alright, one second
Am I and MC 1.20.1 just not meant to be?
plugins {
`java-library`
id("io.github.goooler.shadow") version "8.1.8"
id("io.papermc.paperweight.userdev") version "1.7.1"
}
repositories {
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.dmulloy2.net/repository/public/")
maven("https://repo.viaversion.com")
maven("https://repo1.maven.org/maven2/")
maven("https://repo.maven.apache.org/maven2/")
}
dependencies {
api("net.tectonic:tectonic-core:1.0.0")
api("com.zaxxer:HikariCP:5.1.0")
implementation("mysql:mysql-connector-java:8.0.28")
compileOnly("com.comphenix.protocol:ProtocolLib:5.1.0")
compileOnly("com.viaversion:viaversion-api:4.9.2")
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT")
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
}
}
group = "net.tectonic"
version = "2.1.4"
description = "Excavators"
java.sourceCompatibility = JavaVersion.VERSION_21
dont use 1.20.1
1.21 *
buildscript {
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'com.gradleup.shadow:shadow-gradle-plugin:8.3.0-SNAPSHOT'
}
}
apply plugin: 'com.gradleup.shadow'
this is how you have to use it right now
well, for userdev you wanna align the jdk version for that version
so, for 1.21, use java 21
that I do
still throwing errors tho
run a build manualy from the cli and see what it says
source compat is outdated
why are you setting source compatibility anyway
not sure
unless their publishing is broken you don't need to use the legacy buildscript application method
Gradle is a mess to me tbh, most docs are alien language to me
just add the repo to the plugin resolution repos
I know my way around Javadocs and such, but kotlin docs are just a mess
I just copied whatever was on their repo, and it doesn't matter anyway
you should consider using maven
WAY CLEARER
Gradle's guide is also just unorganized
not going back
good
the XML spanned above 100 lines
it is actually
for most projects anyway
I don't agree, it makes gradle seem more intimidating to new users than it needs to be
the simplified mechanism was added for a reason
used maven for 3 years
never understood shit
switched to grade suddenly everything made sense
I am using a build.gradle.kts file, there is only runtimeClasspath and compileClasspath, both of which throw an error when used. What do I use instead of classpath?
used maven, nothing made sense,
switched to gradle, nothing makes sense still
you have to use the kotlin style
classpath("")
url("")
there is nothing called classpath though
buildscript {
repositories {
maven {
url = uri("https://plugins.gradle.org/m2/](https://oss.sonatype.org/content/repositories/snapshots/")
}
}
dependencies {
classpath("com.gradleup.shadow:shadow-gradle-plugin:8.3.0-SNAPSHOT")
}
}
apply(plugin = "com.gradleup.shadow")
thats how gooler's shadow does it
I'm guessing just switch it around
no they are using groovy he needs kotlin tho
edited to match gradleup
this is kotlin
configure sonatype and gradlePluginPortal as your plugin resolution repos. then just apply the plugin normally
I don't know why shadow's docs are still pushing legacy application that hasn't been standard since like gradle 4
that mechanism is still useful for arbitrary libraries, but not for plugins with a properly published marker
Even after upgrading it still doesn't work.. I'm not sure there is much left to try
agreed
on top of that, paperweight-userdev is throwing erros that it can't apply patches
clone the paperweight-test-plugin and build it from the command line
it's likely going to work
then see what you have different
in settings.gradle.kts:
pluginManagement {
repositories {
gradlePluginPortal()
maven {
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
}
in build.gradle.kts:
plugins {
id("java")
id("com.gradleup.shadow") version "8.3.0-SNAPSHOT"
}
there then
I wish they would make maven('...') valid in groovy
is it allowed in the kotlin dsl?
yes
test plugin throws same error
nice
if you mean this error
thats from your ide
is that a fresh clone?
because it builds for me and in CI
indeed
clear the caches and try again
your other build may have populated the cache with garbage
paperweight?
yes
These are the things I replaced in my build.gradle.kts:
https://pastes.dev/67kB2j8mOl
Should this work?
cleanAllPaperweightUserdevCaches
thanks I was looking for that
It does not work
that dep won't be resolved when you request cleanAllPaperweightUserdevCaches
is this running from the ide?
stop using the ide gradle integration when you are debugging build issues
just a general piece of advice form someone with lots of experience
I am using the terminal
just invoke ./gradlew
same problem occurs
try deleting ~/.gradle/caches/paperweight-userdev manually
it looks like something broke with the logic to not resolve the bundle when cleaning
my global gradle folder?
yes by ~/.gradle I mean GRADLE_USER_HOME
could you also send me a paste of the output of ./gradlew cleanAllPaperweightUserdevCaches --stacktrace?
locally I reproduced it but it was due to run-paper trying to get the server jar
does git bash work?
I don't want to do it via IDE
but the command prompt sucks
maybe powershell?
are you on windows?
yes
its windows 10
windows terminal was released in windows 10
earlier I meant running through the IDE gradle integration is bad though, the ide terminal is ok
it has problems but not the same ones
git bash doesn't like me
I have so many terminals but none work
sometimes I hate windows
only reason I'm staying is because linux doesnt have good support for games
are you doing this inside your project directory
if not then that's the issue, you gotta cd to it
I am inside my dir yes
dw I'm installing windows terminal
maybe it'll work from there
I dont want my IDE to poison my cache again
there we go
message.txt by @fading vapor: https://pastes.dev/ZQvqUWZ9NJ
https://pastes.dev/ZQvqUWZ9NJ#L195 ok so you do have run-paper
https://github.com/jpenilla/run-task/pull/68 this should fix clear cache being broken by run paper
yeah I should probably remove that demo code
build successful nonetheless
it doesn't work anymore since the new brig api replaced it's purpose
the one bundled with paper?
yeah that demo code was a semi-supported way of using brig before we exposed it to api
thank you very much @smoky violet, you are the king 👑,
I'm keen to try out the brigadier
I have fixed this issue. I simply had to remove the dependencies block inside of the shadowJar task in order to make it automatically bundle everything from the runtime classpath provided in the dependencies block into the JAR. This will not work if you would like to exclude certain things from the runtime classpath, but this is the solution that I found. Otherwise, if you would like to customize what is included in your JAR, you must declare it explicitly.
hello!
build.gradle by @magic vortex: https://pastes.dev/LjKibqpnd7
adventure and minimessage are bundled with paper
you need java 21
Oh, there it goes, thanks!
getting NoClassFoundError for kotlin/jvm/internal/Intrinsics this is my build.gradle https://pastes.dev/i6S1KvAEX9
are you using the file with the -all suffix?
wdym
shadow produces a different JAR file
just get the -all suffixed file from the build directory?
i.e. build/libs/<project name>-<version>-all.jar
I dont think theres a file called that
you'll need to run the shadowJar task first
Hello, i'm using Velocity and in a previous version, i used a plugin which uses the class com.velocitypowered.proxy.protocol.packet.chat.ComponentHolder.
I was getting it with this line in my build.gradle :
compileOnly "com.velocitypowered:velocity-proxy:3.3.0-SNAPSHOT"
However, it seems that this dependency doesn't exist anymore :
Is there an other way to access this class ?
Hey ,I’m working with the paperweight-test-plugin, but since the provided version is for Minecraft 1.20.5 and I’m using 1.20.4, I edited the build.gradle.kts to make it compatible with my server.
However, I'm encountering an issue with the following code:
ServerPlayer serverPlayer = craftPlayer.getHandle();
When I call getHandle(), I receive an error. You can view the code here: (https://pastebin.com/G3bDzQMM)
Code and Error Details:
(https://pastebin.com/G3bDzQMM)
thanks in advance!
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
What could be the issue here? Trying to compile a plugin https://mclo.gs/OKNJPMz
generally down to using the wrong version of java for that version of the dev bundle
make sure to use whatever version of java was the standard version back then
you may need to delete the cache folder manually
what if project uses multiple paper versions?
already did that
Hey, I just pushed out an update for my fork but I don't actually understand how I can update my plugin to use my fork. I ran gradle cleanAllPaperweightUserdevCaches but I'm still getting the error that the constructor I just made public is private. How do I do this?
send your build config
thanks
why is this happening? just trying to build my fork (happening while building the server) ```
Caused by: io.papermc.paperweight.PaperweightException: Failed to read upstream data.
at io.papermc.paperweight.util.data.UpstreamDataKt.readUpstreamData(UpstreamData.kt:61)
...
Caused by: io.papermc.paperweight.PaperweightException: Upstream data file does not exist.
> Could not resolve io.papermc.paper:paper-api:1.20.5-R0.1-SNAPSHOT.
> Could not parse POM https://repo.papermc.io/repository/maven-public/io/papermc/paper/paper-api/1.20.5-R0.1-SNAPSHOT/paper-api-1.20.5-R0.1-20240429.035133-20.pom
> Could not find net.kyori:adventure-bom:4.17.0-SNAPSHOT.
using userdev... After checking 4.17.0-SNAPSHOT doesn't exist anymore
ok
we dont keep old snapshots of 3rd party projects around forever
is there a way to point gradle to use the resources folder when debugging?
what does that mean
there is no code in the resources folder, so there's nothing to debug
i have a bunch of property files
but when running debug, the application doesnt read them properly
I have to build the jar and move them into specific folders in order for it to run
debug button in intellij
trying to run a jda bot inside paper
(not the jar itself, just a plugin)
did you setup the debugger properly? You have to attach the debugger to the minecraft server for it to work properly, since your plugin doesn't own the process
Since my plugin is not even started yet, I just figured I could debug a main method until its done
nvm, now I just get finished with non-zero exit value 1
if i build the jar and manually move the files, it works
Is it possible to make userdev pin on a specific version of paper for reproducible builds?
just specify a concret snapshot id
not just 1.21-R0.1-SNAPSHOT
Nexus Repository Manager
this file will always list the latest one https://repo.papermc.io/repository/maven-snapshots/io/papermc/paper/dev-bundle/1.21-R0.1-SNAPSHOT/maven-metadata.xml
thanks
yo i have a spigot Linux server on ubuntu and i want to turn it into a paper server i couldnt find build tools for version 1.20.2 also
paper doesn't use buildtools
To download old versions of Paper, go to the build explorer: https://papermc.io/downloads/all. Note that old versions are completely unsupported and contain numerous bugs/exploits.
how does it work then?
you download the jar from our website and run it
alright tysm
is there a way to uninstall a whole server with like a command or somthing?
it was not in 1 forlder i got it to work anyway i jud didnt read cause im braindead tysm anyway
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
}
processResources {
filesMatching("plugin.yml") {
expand(mapOf("version" to version))
}
}
}
shouldn't this set my project version to the same one as plugin.yml?
I would honestly just use the https://github.com/jpenilla/resource-factory to generate the plugin.yml from the build.gradle.kts
I dont use brigadier
all commands are registered with plugin.yml
first glance of this tells me it doesn't suppor the old way
plugin.yml pr paper-plugin
plugin.yml
it does support all of the plugin.yml format
taking the version from plugin.yml and setting the same version to the gradle project
why not the other way around
Generally the other way around, setting "version" in plugin.yml to whatever version you have set in your project
Not sure if it's even possible the otherway around with that task like that
it doesnt do that tho
I've opened up the jar and its a differnt version than the project
expand will replace the word ${version} with the version variable defined in your build.gradle.kts
it doesnt do that
version: ${version} should work
I give up
again, just use resource-factory
2 hours of reading docs for nothing
no thanks, docs suck ass and there is literally no good way to learn Gradle Kotlin DSL
lol
I mean, literally the gradle documentation
I'll do it the caveman way until someone decides to whip up an actual guide
people try to cheat their way out of it
I mean, literally unreadable for beginners
https://github.com/jpenilla/resource-factory?tab=readme-ov-file#convention-plugins what more do you need
Kotlin DSL is far from close to Java
it really isn't, but it does take one to sit and actually interpret what's written
the tutorial covers pretty much all the bases
my good man, I've spent all together about 30 hours reading trough their docs and still don't understand a damn thing, I understand more from the decompiled Mojang mappings
i've already read all that
i know enough to distungiush between dependancy configurations
I mean, it has a very clear diagram about the architecture, and a page for each file in it, it doesn't get more clear than that
yes, I understand how the base gradle system works, i'm reffering to more advanced stuff like understanding miscelanious tasks and such, google doesn't help me since most is deprecated because its groovy or nothing useful shows except the gradle docs
what bothers me is the 10 different ways to achieve the same thing
well, that's more of an issue with the fact that there is no tailored documentation on gradle for Minecraft plugin development
now you get it
this is what makes it so hard for me
I'm keen to learn but there really aren't many Minecraft gradle guides out there if there are any
there aren't many since very few people go out of the standard build configuration, which is declaring dependencies and maybe shading some
paperweight is already a huge hurdle for most, but there's a guide specifically for that one so it isn't as painful
true that
the issue with that is that the one time people try to make use of gradle's features, they just shit all over their build configuration and never try again
ye, cause there is no room for error
you have to do it in a very specific way
i've been trying for months to do anything custom
no success so far
the general gist is to have a good understanding of the build lifecycle, once you know when things run where, you can take advantage of the task dependency mechanism to write your own tasks. For everything else, you can pretty much just use standard Java/Kotlin features within your tasks and you're fine, eventually you'll learn how to take advantage of the various Gradle APIs
it should , why?
use your IDE it has suggestions
I'm looking trough the available properties and functions and none seem to have anything to do with commands
bukkitPluginYaml {
commands {
"commandName" {
description = "This is a description of the command."
aliases.addAll("alias1", "alias2")
permission = "myplugin.command.permission"
permissionMessage = "You don't have permission to execute this command!"
usage = "/commandName [args]"
}
"anotherCommand" {
description = "Description for another command."
}
}
}
something like that I believe
what the heck
how big is build settings file going to be
I've got about 150 commands
and you are still using the plugin.yml to register things? Lol
I'd have switched to a command framework when I got over 10
didn't know about Cloud back then, nor was Briagdier a thing
never used it
I use LLMs a lot, but just because I know when it starts hallucinating
is teh AI even capable of doing sush tasks, I thought they suck at doing aynthing with libraries
just feed the whole plugin/src/main/kotlin/xyz/jpenilla/resourcefactory/bukkit/BukkitPluginYaml.kt into it and your whole plugin.yml and tell it to convert lol
if given enough context, it's capable of doing it properly
hopefully it won't go over token limit for free users
How can ı fix this?
Please tag me
do you have the paperweight plugin in your plugins block?
What is the recommended way to pre-remap plugins for container setups? Is there any flag to cleanly pre-populate the .paper-remapped directory?
when using mojang mappings for paperweight, which artifact to use? -all or -reobf
all
I just switched from bukkitPluginYaml to paperPluginYaml, and i'm getting this error while building
show the paperPluginYaml block
from what i can understand it says i don't have the main fifeld set
but i have
and here's the entire thing if yuou need it
LearnSpigot provides a free web-based pastebin service for storing and sharing code snippets with anyone. Powered by hastebin.
how?
i never understood how kotlin build scripts work
just change xyz.jpenilla.resource-factory-bukkit-convention to xyz.jpenilla.resource-factory-paper-convention in the plugins block
oh
also, last version is 1.1.2
alr ty i'll test
same error
do i need to reload gradle or something
to install the new plugin
k
oh
i think that's done it
why does that fix it
because that's the import for the factory, which is to be used within the sourceSet
you want to use the convention and that doesn't need to be imported
you just didn't import the right thing
yeah but now im importing nothing at all
yeah because the convention implicitly imports it
oh
you can explicitly import it if you want, it is xyz.jpenilla.resourcefactory.paper.PaperConvention
I'm trying to use some nms packages in a "utils" plugin, so I am using the paperweight plugin, and everything is working fine on my end but when I sent it to jitpack it doesn't generate the obfuscated jar, it only generates the dev, sources, and javadocs jars (and just to reiterate, it generates the reobfuscated jar when I run ./gradlew clean assemble publishToMavenLocal on my local machine). Anyone know what might be going on?
how do i create a custom maven repo on a own server to have private access on it?
use something like reposilite if you want to host a mvn repo, but first ask yourself if you actually need it + the burden of maintaining a mvn repo
I mean, a private repo is barely a burden
sonatype nexus is the go-to
it's available as an OCI image, super easy to host
reposlite is pretty nice too, they got a docker image and their documentation is pretty complete
Anyone know if using one of these platforms would help out my issue? I thought jitpack was the goto for this kinda thing but I guess there's other options
can i upload my files to reposilite without deploying it directly from my project? just upload files? if yes what files do i have to upload?
you can, there's a upload file button. You'll probably need the maven metadata files and possibly the .pom files too. (not 100% sure if these are needed to locate artifacts)
but you need to generate these files, so atp you might as well just publish directly from your project
Hmm alright but i got a error while trying to deploy. It says that it cannot Connect. I didnt saw through the "tutorial" to Set everything up i also dont have a settings.xml so idk what i have to do
with maven you can see which repo a dependency gets pulled from but gradle doesn't seem to log that (as far as I can tell), is there a way to turn that on?
Hey! I have this copy task that depends on a final task defined by the subproject, by default it's shadowJar but it can also be reobfJar etc.
assemble {
dependsOn(named("copyToBin"))
}
register<Copy>("copyToBin") {
from(project.getFinalTask()) // How could the final task be defined?
into(rootProject.layout.buildDirectory.dir("libs"))
rename {
"${rootProject.name}-${project.name.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault())
else it.toString()
}}-${project.version}.jar"
}
}
what is your question? and can you describe what you mean by final task?
im not aware of any such terminology in gradle
Basically I want to copy the "final" jar from all subprojects to the root build/libs. The issue is determining the final jar in the root project, as it might be built by shadowJar, reobfJar or something entirely different, so it doesn't know what to depend on. I want to basically provide what task will build the jar in the subproject
this "final" jar concept doesn't exist
i dont know what you mean
I know, basically just the task that builds the jar, for example shadowjar or reobfjar
So the copy task depends on that specific task
it doesnt work like that, you have to pick one
or both
or make two tasks that each depend on a different sub project task
This worked #paper-dev message
But it made a shadowJar and reobfJar in the subproject as you can use from() multiple times
So it cannot be generic?
The root project won't be able to depend on reobfjar though as it's only a plugin in 1 sub project
im not really sure what you want
you want a task in the root project that builds everything?
and copies all the binares somewhere?
No, the root project should just have the copy task that collects all the subprojects build outputs and inserts it into root build/libs
well the way tasks work, is with dependencies
so if you run the task in the root project that depends on a task in a subproject, you add a dependency on the subproject's task in the root project's task
Ehhhh what, I don't understand
you run the task in the root project
and then it checks whether the sub proejct tasks need to be run
if yes, it does that
then you can use the output of that task in the first one
Yeah, but how would I define which tasks need to run in the subproject?
Before I need to make sure reobfjar runs before it tries to copy
you add dependsOn(...) in the root project's task
The root script does not have the reobfjar task
okay so dependsOn(":sub-project:reobfjar")
you add a dependency on the task of the subproject
Ohhh you're saying make this a task in the root project and not in the root subprojects {} section? That's where it is rn
uh
you were saying root project the whole time
subprojects {} is not the root project, its configuring every sub project
Right now it's basically
subprojects {
assemble {
dependsOn(named("copyToBin"))
}
register<Copy>("copyToBin") {
from(named("getFinalTask"))
into(rootProject.layout.buildDirectory.dir("libs"))
rename {
"${rootProject.name}-${project.name.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault())
else it.toString()
}}-${project.version}.jar"
}
}
}
Yeah, the main idea was to just have it all in one script, that's what I meant
get rid of your assemble {} block
not necessary
and then depend on reobf or shadow jar in your copy task
Yeah I just had it for when I used dependsOn(reobfJar)
But I can't depend on reobfjar in the root as it's not a task there? The main idea by doing this is making it as generic as possible
the stuff in your subprojects {} block has nothing to do with the root project
literally
its basically copy-pasted to the subproject scripts
So dependsOn(subproject:reobfJar) does probably work but I want to avoid it and define it in the subproject itself if that makes sense
you are also missing the tasks {} block
I have that, just forgot to add in paste
subprojects {
tasks {
register<Copy>("copyToBin") {
from(project.task("reobfJar"))
into(rootProject.layout.buildDirectory.dir("libs"))
How about the tasks that wont have reobfjar?
Then I want to copy it from shadowJar
Would this work?
var task = named("reobfJar")
if(!task.isPresent) task = named("shadowJar")
from(task)
subprojects {
tasks {
project.tasks.findByName("reobfJar")?.let { reobfJar ->
register<Copy>("copyToBin") {
from(reobfJar)
into(rootProject.layout.buildDirectory.dir("libs"))
rename {
"${rootProject.name}-${project.name.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault())
else it.toString()
}}-${project.version}.jar"
}
}
}
}
}
you can try this
or yeah something like that
That only runs if reobfJar exists tho
subprojects {
tasks {
(project.tasks.findByName("reobfJar")
?: project.tasks.findByName("shadowJar"))
?.let { reobfJar ->
register<Copy>("copyToBin") {
from(reobfJar)
into(rootProject.layout.buildDirectory.dir("libs"))
rename {
"${rootProject.name}-${project.name.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault())
else it.toString()
}}-${project.version}.jar"
}
}
}
}
}
uh
brackets sec
Doesn't copy anything
This didn't either
try from(reobfJar.outputs)
Same thing
subprojects section:
build {
dependsOn(shadowJar)
}
(project.tasks.findByName("reobfJar") ?: project.tasks.findByName("shadowJar"))
?.let { task ->
register<Copy>("copyToBin") {
from(task)
into(rootProject.layout.buildDirectory.dir("libs"))
rename {
"${rootProject.name}-${project.name.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault())
else it.toString()
}}-${project.version}.jar"
}
}
}
Sub project script:
assemble {
dependsOn(reobfJar)
}
Doesn't copy anything
the build or assemble blocks are irrelevant
can you try adding the dependsOn in the register copyToBin block?
i forgot how to write the copy task exactly
theres something missing
and if you do from(task.outputs)?
with the depends the way it is
from(reobfJar.flatMap { it.outputFile })
or this
Doesn't working, trying other thing now
Can't use flatMap
do you see a jar in the default location?
lmfao
on root
you need to run the task you are registering
./gradlew :sub-project:copyToBin
give that a go
The dependsOn should run that tho no?
no
Since the jars are built in sub build libs
dependsOn means that the task in the backets is run when you run copyToBin
not the other way around
This ./gradlew ;bukkit;copyToBin (I used : not ; but it makes emojies lol) only built the shadowjar and not the reobfjar
But it did copy the shadowjar correctly
Yeah so this works, except it uses shadowJar and not reobfjar
which means it cant find it
It's there tho
try the task :bukkit:reobfJar in the console
okay I think it's grabbing the project symbol from the root project
the subprojects block should provide a lambda argument right?
can you try using that
you can print out the project to see which one it's grabbing
Use it for what? Not sure what you mean
Like this? subprojects.let { sub ->
Still new to kotlin
then try with .configureEach
on subprojects?
yeah
It might be yeah, I made this debug
println("Name: " + project.name)
println("Tasks: " + project.tasks.names)
Output:
Name: bukkit
Tasks: [assemble, build, buildDependents, buildNeeded, check, classes, clean, compileJava, compileTestJava, jar, javadoc, knows, processResources, processTestResources, shadowJar, test, testClasses]
Doesn't contain reobfjar for some reason
It's listed here tho https://paste.helpch.at/okalipugah.sql
I'm baffled
@cinder ember
but you can also use https://github.com/jpenilla/run-task
tasks.register("copyJars", Copy::class) {
// Include the jar(s) we want to copy
// from(tasks.shadowJar) // If using shadow (and not paperweight-userdev)
// from(tasks.reobfJar) // If using paperweight-userdev
from(tasks.jar) // Not using shadow or paperweight-userdev
// If you want to rename a jar in the destination dir:
from(tasks.jar) {
rename { "TestPlugin.jar" } // Rename the jar in the destination directory
}
// Pick a destination directory -
// into(layout.projectDirectory.dir("directory/relative/to/projectDirectory"))
into(file("C:/Users/User/Desktop"))
}
doesnt work
use symlinks instead of copying to directories
symlinks are better for this imo, because it doesn't polute your build script with computer-specific information
whats symlinks?
actually no clue if windows has an equivalent
i just want something easy and simple
windows has symlinks
this is just for myself
Does anyone know what's the difference between project.tasks.names in a subprojects section and running ./gradlew :sub-project:tasks in console? The console command lists way more tasks
mklink \D 
why doesn't this work?
How???
I think the reobf jar is only available later
as in: not during configuration
you can hack around this by putting the whole damn thing in a doLast {} block
the thing that starts with (project.tasks
doLast?
This maybe?
AYEEE
It works!
Finally
Thank you so much for the help and patience lol @verbal skiff
ah yes that's the one
and no problem
now I remember: doFirst and doLast are only within the task block
Yeah, found the after thing on stackoverflow
afterEvaluate is for in the project scope
gg
https://pastes.dev/QU3UuN2Q8d why am I getting this error? ```
Execution failed for task ':compileKotlin'.
Could not resolve all files for configuration ':compileClasspath'.
Could not download palm-api-1.21.1-R0.1-SNAPSHOT.jar (net.mire.palm:palm-api:1.21.1-R0.1-SNAPSHOT:20240814.114411-1)
Could not get resource 'https://maven.radsteve.net/palm/net/mire/palm/palm-api/1.21.1-R0.1-SNAPSHOT/palm-api-1.21.1-R0.1-20240814.114411-1.jar'.
Could not GET 'https://maven.radsteve.net/palm/net/mire/palm/palm-api/1.21.1-R0.1-SNAPSHOT/palm-api-1.21.1-R0.1-20240814.114411-1.jar'. Received status code 401 from server: Unauthorized
huh
I mean, are you sure the env variables are correctly passed to gradle by whatever you use to set them up
yup, tried printing them
does reposilite use username and password auth?
yeah
very
does reposilite use header or basic auth?

gonna try a build -U
still nope, i don't get this
looks like gradle is fucking with me
because reposilite just says that there's no token provided
no idea then, sorry. If you printed the creds out from a gradle task, and they are there, its rough
oh you already linked lol
literally what lynx just sent
send your updated file
do you even need to create the basic authentication?
I've never done that and it worked just fine
doesn't work with or without it kek
thing is, i can do that in the browser with those creds and it works, the reposilite console says that the token is null
then the environment variable is null
what happens if you pass them as properties instead
it's not it's printing correctly
did you give permissions to the token?
to the specific route?
yea
have done three times
works just fine, as well as in my browser
so it has to be gradle
run with -d and check what the output says
or just send it here and remove any sensitive info
https://pastes.dev/OHywPJKOph pastes.dev is not having fun
2024-08-14T16:19:14.728+0200 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.ResolvedArtifactCaches] Reusing in-memory cache for repo 'rad-palm' [842af58dc1cc817bf04bb3efdba4723d]. wonder if cache is fucking with you
have tried deleting .gradle, build and running gradle clean
omw to delete ~/.gradle/caches 
yo i got a paper 1.21 server i wnna downgrade it to 1.20.4 need help
wrong channel, and also, downgrading is not supported
looking good, paperweight is running

such a fucking gradle moment
don't celebrate too early 
ffs
enjoy the free room heating 

create a different project and try from there, without any other dependencies
and just to be on the safe side, don't use the environment variables, do it wit the gradle.properties from the gradle user home
the weirdest thing is that it worked before updating my fork to 1.21.1 and this is the full diff from that commit: https://pastes.dev/eOk1XJ6VhE
i'll try to revert that for now and try again from there
Yea would be interesting to know if the old "working" commit still actually builds

it fucking breaks now ??????

i also tried removing and re-pushing the artifact from the repo so it's not cached, but it's still the same fucking thing -.-
Did something with the update process change between 1.21 and 1.21.1?
My usual process was deleting caches and -server/-api, changing the hash and version in gradle.properties and then running applyPatches. When issues with a patch appear, run the apatch script and then, git add ., git commit --amend and git am --continue.
However now suddenly apatch always seems to be on one commit to early. e.g. if applyPatches fails at 0003, apatch will try to fix 0002, which already was applied successfully.
I am a bit confused, especially because that worked fine in 1.21 and nothing seems to have changed, and I am just running the same commands in the same order from my console history, lol
log: https://pastes.dev/CuSGs8DV9i. Note how the "misc qol" patch fails, but after apatch we are suddenly at "branding changes", one patch too early
No
hmm
You’re just in a standard git am session
yeah, but why is that suddenly on the wrong commit lol
Because the commit failed to be created from the patch
And, append applies to the last commit
Git tells you what command to run once you fix it
yes, but how do I fix it? I tried what MM suggested here and rebuilding without filtering before updating: #paper-dev message
same issue though
Do I just have to apply the patch with IJ? lol
yeah that doesn't help, patch is applied but I am still getting a "No changes - did you forget to use 'git add'?" when trying to continue with am
did you forget to git add 
no, I did
nothing to commit, working tree clean
and the only conflicts that patch even has are two literally two lines, I am confused
oh well
I am stupid. I committed too early while in am 
yeah it works now, ty
paperweight-core v1.7.1 (running on 'Windows 11')
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<==-----------> 16% EXECUT─░NG [53s]
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> Task :paper:patchCraftBukkit FAILED
> Task :getPaperUpstreamData FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':paper:patchCraftBukkit'.
While compiling how can ı fix?
its folia
scroll up
> ./gradlew.bat applyPatches
<---<-<-<-<-<-<-<-<-<-<-
> Configure project :oot project
paperweight-patcher v1.7.1 (running on 'Windows 11')
<=<<<<<<<<<<<<<<<<<<
> Configure project :paper
paperweight-core v1.7.1 (running on 'Windows 11')
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<==-----------> 16% EXECUT─░NG [53s]
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> Task :paper:patchCraftBukkit FAILED
> Task :getPaperUpstreamData FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':paper:patchCraftBukkit'.
> io.papermc.paperweight.PaperweightException: Command finished with 128 exit code: git -c commit.gpgsign=false -c core.safecrlf=false apply --ignore-whitespace --directory=src/main/java C:\Users\tuna2\Desktop\PhantomiaServer\Folia\.gradle\caches\paperweight\upstreams\paper\.gradle\caches\paperweight\taskCache\patchCraftBukkitPatches.zip--1911188698\net\minecraft\world\level\storage\loot\predicates\LootItemConditionRandomChanceWithLooting.patch
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BU─░LD FAILED in 1m 26s
2 actionable tasks: 2 executed
try a shorter path
how
clone folia directly in C:
thanks
is there any nice way to speed up paperweight downloading minecraft in github actions? It's adding about a minute to my build action and if there's any way to cache it or somehow skip that step, please let me know and mention me!
github action does have caching for gradle, see the setup-java action
gradle/actions/setup-gradle also iirc does caching
hmm i'm using setup-java but i'll see about setup-gradle
setup-java you need to configure to cache
setup-gradle iirc does it with default config
ah adding setup-gradle worked like a charm! thank you very much
What is the recommended way to prepare plugin remapping for container setups? Is there any flag to cleanly pre-populate the .paper-remapped directory?
Both plugins should relocate kotlin
the build file not your jar
build.gradle.kts or build.gradle or whatever you are using
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
Well
on the surface, all one can guess is that your relocations are setup improperly
can't really say too much with the info provided
are you sure that you shaded koin?
if so, inspect the class that it's upset about the relocation on with javap
Not sure what you mean by that
.
No idea what you mean by everything is fine with the files
as I said, you'd need to use javap to look at the class that is blowing up
The thing thinks a method is missing
now, that would generally either down to shading the wrong version of koin or kotlin, or, the relocation wasn't handled properly
you can use javap to inspect the methods of the class that apparently doesn't have said method
So I've got an issue when testing runReobfBundler vs runDevServer. Currently its missing a class on the runReobfBundler but it isn't missing it in runDevServer. Any reason why this would be the case? I am using the test plugin to check using Class.forName as well. Additionally, it works on mojmap but not on reobf.
Should gradle.properties generally be in gitignore? If so, where should project version be defined?
no dont ignore it
just dont store sensitive information in it
thats what env vars are for
Ah yeah makes sense, ty!
When I clone the Paper repo, run applyPatches and then rebuildPatches, it changes a bunch of patches, this can't be right surely? https://mclo.gs/mguODN1 What am I doing wrong?
scuffed git version maybe?
or something broke during a PR merge yesterday
lemme check, nah, rebuilds without changes for me
using git 2.42.0
What does the diff to the patches look like?
A bunch of random stuff like this
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
+
+ }
}
+
+ // Paper start
+ /**
@@ -3502,7 +3502,7 @@ index 5bcec42a91859002409cab9756999e5adc4c867f..3594b0eb4068c83c93efe948a8ef4ba2
+ @Deprecated
+ public int getPing() {
+ throw new UnsupportedOperationException( "Not supported yet." );
}
+ }
+ // Paper end
}
@@ -3708,7 +3708,8 @@ index 44badfedcc3fdc26bdc293b85d8c781d6f659faa..12946bd55fcf7c40d39081779a7fa300
public CustomTimingsHandler(@NotNull String name) {
- this(name, null);
- }
-
+ Timing timing;
- public CustomTimingsHandler(@NotNull String name, @Nullable CustomTimingsHandler parent) {
- this.name = name;
- this.parent = parent;
@@ -3731,7 +3732,16 @@ index 44badfedcc3fdc26bdc293b85d8c781d6f659faa..12946bd55fcf7c40d39081779a7fa300
- long avg = time / count;
-
- printStream.println(" " + timings.name + " Time: " + time + " Count: " + count + " Avg: " + avg + " Violations: " + timings.violations);
- }
+ new AuthorNagException("Deprecated use of CustomTimingsHandler. Please Switch to Timings.of ASAP").printStackTrace();
+ try {
+ final Method ofSafe = TimingsManager.class.getDeclaredMethod("getHandler", String.class, String.class, Timing.class);
+ ofSafe.setAccessible(true);
+ timing = (Timing) ofSafe.invoke(null,"Minecraft", "(Deprecated API) " + name, null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Bukkit.getLogger().log(Level.SEVERE, "This handler could not be registered");
+ timing = Timings.NULL_HANDLER;
}
Another in patches/api/0315-Extend-VehicleCollisionEvent-move-HandlerList-up.patch
index 316f625aa595d2ada16529b16d09f013fc4daeac..d0a437bd8aeec18f800893f51ece06deb0c8972c 100644
--- a/src/main/java/org/bukkit/event/vehicle/VehicleBlockCollisionEvent.java
+++ b/src/main/java/org/bukkit/event/vehicle/VehicleBlockCollisionEvent.java
@@ -9,13 +9,31 @@ import org.jetbrains.annotations.NotNull;
@@ -9,14 +9,32 @@ import org.jetbrains.annotations.NotNull;
* Raised when a vehicle collides with a block.
*/
public class VehicleBlockCollisionEvent extends VehicleCollisionEvent {
@@ -27,8 +27,8 @@ index 316f625aa595d2ada16529b16d09f013fc4daeac..d0a437bd8aeec18f800893f51ece06de
super(vehicle);
this.block = block;
+ this.velocity = velocity;
+ }
+
}
+ /**
+ * Gets velocity at which the vehicle collided with the block
+ *
@@ -37,11 +37,12 @@ index 316f625aa595d2ada16529b16d09f013fc4daeac..d0a437bd8aeec18f800893f51ece06de
+ @NotNull
+ public org.bukkit.util.Vector getVelocity() {
+ return velocity;
}
+ }
+ // Paper end
+
/**
* Gets the block the vehicle collided with
*
@@ -26,15 +44,4 @@ public class VehicleBlockCollisionEvent extends VehicleCollisionEvent {
public Block getBlock() {
return block;
I would have to do a full system upgrade for that... will take a bit of time
ah
I mean, try in a docker container or something
any fun git config changes on your end?
[user]
email = okx@okx.sh
name = okx-code
[core]
autocrlf = input
editor = nvim
excludesFile = ~/.gitignore
[rebase]
autosquash = true
updateRefs = true
[merge]
conflictstyle = zdiff3
[diff]
algorithm = histogram
[push]
autoSetupRemote = true
[rerere]
enabled = true
oh
it might be the diff algorithm

It is indeed diff.algorithm that breaks
interesting
setting it to default gets 0 patches
nice, I must have not set my local quick test in the right repo then 
glad ya figured that out
Can I make a PR to add a warning for this in CONTRIBUTING.md in case someone else runs into a similar issue
Yea sure, go ahead and throw a [ci skip] pr at our CONTRIBUTING
Alright
I changed it in paperweight instead https://github.com/PaperMC/paperweight/pull/252
or that 👍 yea
have you checked that these are the only two areas where this applies?
might be worth searching other usages of diff and format patches maybe
Yes I searched for other usages and couldn't find any, also tested this with the bad git config, and it was all fine
actually you're right I missed one
ah well
Hey, I'm trying to use Paperweight in my project which has 2 subprojects. I need to index paperweight for 1.20.4 on that 2 subprojects. I've included in my build logic the following code:
dependencies {
implementation("io.papermc.paperweight:paperweight-userdev:1.7.2")
}
Then in my subprojects I added this configuration (their names are api & plugin):
plugins {
id("project.common-conventions") // this is on my custom build logic
id("io.papermc.paperweight.userdev")
}
dependencies {
paperweight.devBundle("org.fenixteam", "1.20.4-R0.1-SNAPSHOT", "paper-dev-bundle")
}
tasks {
assemble {
dependsOn(reobfJar)
}
}
And I got this error in the api subproject:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/pixeldev/Workspace/fenix-team/world-bossbar/api/build.gradle.kts' line: 1
* What went wrong:
Plugin [id: 'io.papermc.paperweight.userdev'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (No included builds contain this plugin)
- Plugin Repositories (plugin dependency must include a version number for this source)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
CONFIGURE FAILED in 728ms
NOTE: I'm using gradle wrapper 8.10 and Java 17
share a build scan (make sure to activate it, also may need to remove the userdev usage temporarily to get it to create one, not certain)
it's basically going to come down to figuring out why it's not on the classpath for that project; probably would want to work backwards from what's different than the source-remap branch of the test-plugin's setup
hard to say much without seeing the repo
I cannot make a build scan since the whole project is broken now
This is my root settings.gradle.kts file
pluginManagement {
includeBuild("build-logic")
}
rootProject.name = "world-bossbar"
sequenceOf("api", "plugin").forEach {
include("${rootProject.name}-$it")
project(":${rootProject.name}-$it").projectDir = file(it)
}
sequenceOf("gson").forEach {
include("${rootProject.name}-infrastructure-$it")
project(":${rootProject.name}-infrastructure-$it").projectDir = file("infrastructure/$it")
}
This is the build.gradle.kts file into build-logic
plugins {
`kotlin-dsl`
}
dependencies {
implementation(libs.build.indra)
implementation(libs.build.spotless)
implementation("io.papermc.paperweight:paperweight-userdev:1.7.2")
compileOnly(files(libs::class.java.protectionDomain.codeSource.location))
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
repositories {
maven(url = "https://repo.stellardrift.ca/repository/internal/") {
name = "stellardriftReleases"
mavenContent { releasesOnly() }
}
maven(url = "https://repo.stellardrift.ca/repository/snapshots/") {
name = "stellardriftSnapshots"
mavenContent { snapshotsOnly() }
}
mavenCentral()
gradlePluginPortal()
}
kotlin {
target {
compilations.configureEach {
kotlinOptions {
jvmTarget = "17"
}
}
}
}
This is the settings.gradle.kts file into build-logic
rootProject.name = "world-bossbar-build-logic"
dependencyResolutionManagement {
versionCatalogs {
register("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
My subprojects have this build.gradle.kts file
plugins {
id("project.common-conventions") // this is on my custom build logic
id("io.papermc.paperweight.userdev")
}
dependencies {
paperweight.devBundle("org.fenixteam", "1.20.4-R0.1-SNAPSHOT", "paper-dev-bundle")
}
tasks {
assemble {
dependsOn(reobfJar)
}
}
I don't know what else is needed for this, I thought I've sent it all
you should be able to get a scan once you remove the erroring userdev references
Which is the exact command for it?
you add --scan to a run
shouldn't need to specify a task to get the info you are looking for about the dependency relationships in your build
2:30:01 PM: Executing '--scan'...
> Task :build-logic:checkKotlinGradlePluginConfigurationErrors
> Task :build-logic:generateExternalPluginSpecBuilders UP-TO-DATE
> Task :build-logic:extractPrecompiledScriptPluginPlugins UP-TO-DATE
> Task :build-logic:compilePluginsBlocks UP-TO-DATE
> Task :build-logic:generatePrecompiledScriptPluginAccessors UP-TO-DATE
> Task :build-logic:generateScriptPluginAdapters UP-TO-DATE
> Task :build-logic:compileKotlin UP-TO-DATE
> Task :build-logic:compileJava NO-SOURCE
> Task :build-logic:pluginDescriptors UP-TO-DATE
> Task :build-logic:processResources UP-TO-DATE
> Task :build-logic:classes UP-TO-DATE
> Task :build-logic:jar UP-TO-DATE
> Task :help
Welcome to Gradle 8.10.
To run a build, run gradle <task> ...
To see a list of available tasks, run gradle tasks
To see more detail about a task, run gradle help --task <task>
To see a list of command-line options, run gradle --help
For more detail on using Gradle, see https://docs.gradle.org/8.10/userguide/command_line_interface.html
For troubleshooting, visit https://help.gradle.org
BUILD SUCCESSFUL in 439ms
11 actionable tasks: 2 executed, 9 up-to-date
Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Use defined at https://gradle.com/help/legal-terms-of-use. Do you accept these terms? [yes, no]
Y ran gradlew --scan
Oh, I've read it
Do you want me to share the link?
@raw vessel try creating an empty tester-plugin.gradle.kts in your build logic and applying it to the root project
There you go

