#build-tooling-help

1 messages · Page 10 of 1

sharp trellis
#

unfortunately, now I have this error

> Task :roxypaper-server:runServer
OpenJDK 64-Bit Server VM warning: Option AllowRedefinitionToAddDeleteMethods was deprecated in version 13.0 and will likely be removed in a future release.
System Info: Java 21 (OpenJDK 64-Bit Server VM 21.0.3+13-b446.1) Host: Linux 5.15.146.1-microsoft-standard-WSL2 (amd64)
Loading libraries, please wait...
WARN StatusConsoleListener Advanced terminal features are not available in this environment
[21:08:23 ERROR]: You are using a headless JRE distribution.
[21:08:23 ERROR]: This distribution is missing certain graphic libraries that the Minecraft server needs to function.
[21:08:23 ERROR]: For instructions on how to install the non-headless JRE, see https://docs.papermc.io/misc/java-install
[21:08:23 ERROR]: 
[21:08:23 ERROR]: java.lang.UnsatisfiedLinkError: /home/glicz/.gradle/jdks/jetbrains_s_r_o_-21-amd64-linux/jbrsdk_jcef-21.0.3-linux-x64-b446.1/lib/libawt_xawt.so: libXrender.so.1: cannot open shared object file: No such file or directory
static urchin
#

headless environment?

sharp trellis
#

idk what that really means, I just run runServer task with a server build.gradle.kts patch similiar to paperweight-examples repo

static urchin
#

Well, you are running it in WSL presumably

#

you should be fine with just installing the deps (libXrender1 in this case)

#

surprised none of our windows peeps ran into this tho o.O

#

or does WSLG ship them? idk, windows/WSL magic PeepoMagic

sharp trellis
static urchin
#

Yea I mean, what distro are you running in WSL? Ubuntu?

sharp trellis
#

yes

static urchin
#

then apt install libxrender1 should do the job

sharp trellis
brave widgetBOT
static urchin
#

oh god

#

I mean, it might be easier for you to just drop jetbrains runtime

#

I doubt your fork needs it

#
diff --git a/build.gradle.kts b/build.gradle.kts
index 87bb3fd9b9..afb7b4d46d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -145,9 +145,7 @@ fun TaskContainer.registerRunTask(
         .asFile
     javaLauncher.set(project.javaToolchains.launcherFor {
         languageVersion.set(JavaLanguageVersion.of(21))
-        vendor.set(JvmVendorSpec.JETBRAINS)
     })
-    jvmArgs("-XX:+AllowEnhancedClassRedefinition", "-XX:+AllowRedefinitionToAddDeleteMethods")
 
     if (rootProject.childProjects["test-plugin"] != null) {
         val testPluginJar = rootProject.project(":test-plugin").tasks.jar.flatMap { it.archiveFile }
#

in your server directory

sharp trellis
#

unfortunately, it still doesn't work

System Info: Java 21 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS) Host: Linux 5.15.146.1-microsoft-standard-WSL2 (amd64)
Loading libraries, please wait...
WARN StatusConsoleListener Advanced terminal features are not available in this environment
[21:23:09 ERROR]: You are using a headless JRE distribution.
[21:23:09 ERROR]: This distribution is missing certain graphic libraries that the Minecraft server needs to function.
[21:23:09 ERROR]: For instructions on how to install the non-headless JRE, see https://docs.papermc.io/misc/java-install
[21:23:09 ERROR]: 
[21:23:09 ERROR]: java.lang.UnsatisfiedLinkError: /home/glicz/.jdks/corretto-21.0.3/lib/libawt_xawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
static urchin
#

Yea rip sorry, I am not deep enough into wtf wsl does

sharp trellis
#

yeah np

sharp trellis
#

ok, apt install libxrender1 now worked, I'll try running runServer now

#
> Task :roxypaper-server:runServer
System Info: Java 21 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS) Host: Linux 5.15.146.1-microsoft-standard-WSL2 (amd64)
Loading libraries, please wait...
WARN StatusConsoleListener Advanced terminal features are not available in this environment
[21:29:10 ERROR]: You are using a headless JRE distribution.
[21:29:10 ERROR]: This distribution is missing certain graphic libraries that the Minecraft server needs to function.
[21:29:10 ERROR]: For instructions on how to install the non-headless JRE, see https://docs.papermc.io/misc/java-install
[21:29:10 ERROR]: 
[21:29:10 ERROR]: java.lang.UnsatisfiedLinkError: /home/glicz/.jdks/corretto-21.0.3/lib/libawt_xawt.so: libXtst.so.6: cannot open shared object file: No such file or directory

it still didn't work :/

static urchin
#

yea you are off to install the next dependency OMEGALUL libxtst6 presumably

sharp trellis
#

ok, now I'm missing libXi.so.6?

> Task :roxypaper-server:runServer
System Info: Java 21 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS) Host: Linux 5.15.146.1-microsoft-standard-WSL2 (amd64)
Loading libraries, please wait...
WARN StatusConsoleListener Advanced terminal features are not available in this environment
[21:30:20 ERROR]: You are using a headless JRE distribution.
[21:30:20 ERROR]: This distribution is missing certain graphic libraries that the Minecraft server needs to function.
[21:30:20 ERROR]: For instructions on how to install the non-headless JRE, see https://docs.papermc.io/misc/java-install
[21:30:20 ERROR]:
[21:30:20 ERROR]: java.lang.UnsatisfiedLinkError: /home/glicz/.jdks/corretto-21.0.3/lib/libawt_xawt.so: libXi.so.6: cannot open shared object file: No such file or directory
static urchin
#

ye, idk if there is a nice ubuntu package that contains/depends on all packages needed for a non headless env

sharp trellis
#

ohh, it's all lowercase (libxi6)

#

I'll see how many of these packages I'm missing and maybe I'll try looking for something to install them all

lament scarab
#

generally you'd just install openjdk or whatever and it would pull all the needed stuff

sharp trellis
#

thanks 🙂

static urchin
#

🥳

slate salmon
brisk belfry
#

Do you have any uncommitted changes?

#

Because that’s what the error says

slate salmon
#

Well, I mean, I now deleted the work folder and that apparently fixed it but I wonder what caused it to fail since I didn't touch anything there..

crude kernel
#

(paperweight)

#

have tried removing the .gradle, caches, etc..

#

just happens again

static urchin
#

1.5.11 KEKW

#

nice paperweight version

crude kernel
#

i cloned PaperMC/paperweight-examples lmao

static urchin
#

Yea I mean, outdated stonks

crude kernel
#

then update the repo kekw

static urchin
#

// In general, keep this version in sync with upstream. Sometimes a newer version than upstream might work, but an older version is extremely likely to break.

#

idk, if you are starting a fork you should be competent enough to update some dependencies, but w/e

crude kernel
#

didn't check the newest version

static urchin
#

in general, that smells like something else is also running. Are you opening this in an IDE and running apply via CLI or something?

crude kernel
#

yeah, that error doesn't appear after updating now. just having the issue of updating everything else lol

static urchin
#

Yea I mean, the error isn't going to be version related 😅

#

you just seem to have two gradle instances running

crude kernel
#

okay yeah now it appears again after having it fixed lmao

#

i'll just try killall gradle or something

static urchin
#

might also be worth yanking the .gradle folder after you done so

crude kernel
#

yeah

#

works now lol

static urchin
crude kernel
#

it's tiny-remapper's fault

distant mango
#

pins

crude kernel
#

yeah i fixed it already

#

nvm it broke again

static urchin
#

Updated the repo for ya 👍

crude kernel
#

what does this mean? trying to use my fork in my plugin

bronze ember
#

Post your full file

#

Looks like you added two dev bundles

crude kernel
distant mango
#

try updating paperweight lol

bronze ember
#

Mmh, idk, try comparing the dev bundle artifacts

crude kernel
distant mango
#

what versio ndid you update to

crude kernel
#

1.7.1

distant mango
#

new log

crude kernel
#

wdym

#

the error hasn't changed

distant mango
#

also give a proper log

#

not a screenshot

crude kernel
distant mango
#

try with system prop paperweight.debug to true

crude kernel
#

you mean in the gradle.properties

#

?

distant mango
#

./gradlew -Dpaperweight.debug=true

#

iirc

static urchin
#

share your forks build.gradle.kts pls

#

not the consuming project, the fork's root build.gradle.kts

#

if it is anything like the one you had before, your artefactId is wrong and you are trying to interpret the api dependency as a paperweight userdev bundle

#

which obviously won't work

#

as a side fact, literally just don't specify the artefactId

#

paperweight.devBundle("groupIdHere", "1.20.4-R0.1-SNAPSHOT") also makes this whole thing a lot easier
You are using the paperDevBundle method for 0 gain

crude kernel
#

ah ty

crude kernel
#

as it's currently paper rn

distant mango
#

paperweight userdev has a command to run the server

static urchin
crude kernel
#

okay so i just move everything into the fork's run?

static urchin
#

run-paper iirc picks up on paperweight usedev

crude kernel
#

doesn't for me

static urchin
#

Ah, got replaced with mojangMappedServerRuntime

#

but that should also be setup by paperweight

#

I mean, not run

#

you'd runDevBundleServer

crude kernel
#

ty

eager wagon
#

is there any NMS docs available for 1.17

bronze ember
#

There are no docs for internals, they are internals

glass sable
#

mergh, why am I getting "Plugin [id: 'com.github.johnrengelman.shadow'] was not found in any of the following sources:" when trying to init/build Paper? :S

#

(current master)

prime cliff
glass sable
#

I didn't delete anything. is that necessary now? Oo

#

because it used to just work in the past whenever I pulled in changes to my local repo 👀

#

(I kinda would've expected gradle to handle the deletion if that is necessary xD)

static urchin
#

shadow plugin got yanked, paper no longer uses it

brisk belfry
#

Does it not have any more dependencies than the Minecraft server?

distant mango
#

it still does

#

just no shadow

lament scarab
hasty sigil
#

So i have a silly little monorepo like project structure that goes as follows

ROOT_PROJECT:
  commons-submodule
  minecraft:
    other-submodule:
        more-submodule:
    also-other-submodule:

where root project has my settings.gradle file, minecraft is just a directory that contains more submodules. Whenever i try to import the commons-submodule submodule from the other-submodule, it just doesnt error but also doesnt import in my ide. Ive tried everything

quaint raven
#

How do you import that other module?

hasty sigil
#

from other-submodule

#

but it just doesnt import it

quaint raven
hasty sigil
#

its a monorepo

#

Minecraft is a folder, commons is a submodule, the build.gradle.kts in it is in the image above, and how theyre imported inside of settings.gradle

#

but the commons inside minecraft doesnt add commons the top level one as a dependency

quaint raven
hasty sigil
#

hmmm

hasty sigil
#

;--;

verbal skiff
#

that issue ticks all the boxes:

  • lots of attention and upvotes
  • open for nearly a decade
  • no solution in sight
crude kernel
#

intellij isn't really picking up my paper fork, it's thinking Player#setRespawnLocation doesn't exist and some other stuff, how can I fix that?

lament scarab
#

No idea what you mean by fork, you mean a patcher fork? if so, make sure that you setup the modules properly

crude kernel
#

okay turns out intellij still had the 1.19.4 api in there for some reason even though i never used 1.19.4 lol

verbal skiff
#

I'm trying to relocate all of my dependencies, but getting an error because this service in META-INF isnt being adjusted to match the relocation. Whats the best way to solve this?

lament scarab
#

depends on your build system

#

chances are there is a transformer mechanism you can enable

verbal skiff
#

gradle

#

this is dying:

        private val connectionInstanceImpl: DatabaseConnectionAutoRegistration =
            ServiceLoader.load(DatabaseConnectionAutoRegistration::class.java, Database::class.java.classLoader).firstOrNull()
                ?: error("Can't load implementation for ${DatabaseConnectionAutoRegistration::class.simpleName}")
#
Caused by: java.lang.IllegalStateException: Can't load implementation for DatabaseConnectionAutoRegistration
2024-05-18T13:22:56.516035052Z     at org.anvilpowered.ontime.relocated.jetbrains.exposed.sql.Database.<clinit>(Database.kt:80) ~[?:?]
2024-05-18T13:22:56.516036052Z     ... 10 more
lament scarab
#

hmmm

#

I mean, the transformers I think should "just work" and modify that stuff

#

you'd need to make sure that your dependencies are being pulled into the tree with shade and not something else

verbal skiff
lament scarab
#

added the service merge transformer

#

So, maybe the mergeServices() whatever it was is all you need?

#

or, do you have to tell it what transformers to use manually?

#

I'm not 100% sure, but, I know that there is a way to do it

verbal skiff
#

giving that a go, didnt know about the service merge transformer

#

I hope just this will do it mergeServiceFiles()

#

seems to have modified the service files correctly

#

seems to work

#

at least no error so far

lament scarab
#

Sometimes

#

I get scared that somebody might see me as somebody who knows what I'm talking about

verbal skiff
#

lol, next one:

java.lang.ClassNotFoundException: org.jetbrains.exposed.dao.id.EntityID
2024-05-18T13:52:34.738640750Z     at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass0(PluginClassLoader.java:87) ~[velocity-3.3.0-SNAPSHOT-390.jar:3.3.0-SNAPSHOT (git-afd8b55f-b390)]
2024-05-18T13:52:34.738642417Z     at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass(PluginClassLoader.java:64) ~[velocity-3.3.0-SNAPSHOT-390.jar:3.3.0-SNAPSHOT (git-afd8b55f-b390)]
2024-05-18T13:52:34.738643750Z     at java.base/java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
lament scarab
#

I think you need more transformers

verbal skiff
#

same issue as me

lament scarab
#

I remember this one from eons ago, iirc exposed produces a bunch of extra files which I thiiink there was a transformer that covered it?

verbal skiff
#

ah good find

#

I remember a super old issue from proxymist about broken relocation

#

with the kotlin.Any class

#

was hoping thats fixed

verbal skiff
#

even with this:

tasks {
    shadowJar {
        archiveFileName = "ontime-${project.version}.jar"
        mergeServiceFiles()
        relocate("org.anvilpowered.anvil", "org.anvilpowered.ontime.relocated.anvil")
        relocate("org.anvilpowered.kbrig", "org.anvilpowered.ontime.relocated.kbrig")
        kotlinRelocate("org.jetbrains.exposed", "org.anvilpowered.ontime.relocated.jetbrains.exposed")
#

but also the latest release of that plugin is from 2021

#

probably something broke

#

super weird

brave widgetBOT
lament scarab
#

I have no idea

#

Something is still obviously pointing to the unreloaded classes somewhere

verbal skiff
#

this is EntityClass.kt:32

    private val entityCtor: (EntityID<ID>) -> T = entityCtor ?: { entityID -> entityPrimaryCtor.call(entityID) }
#

i dont understand where its doing a reflective name lookup

#

that should be able to handle relocation

lament scarab
#

it's not doing a reflective lookup

#

Kotlin has a few oddities in the jars they produce that raw shadow jar doesn't understand

verbal skiff
#

okay, I fixed it 😂

#

damn

#
diff --git a/core/src/main/kotlin/org/anvilpowered/ontime/core/db/OnTimeUserTable.kt b/core/src/main/kotlin/org/anvilpowered/ontime/core/db/OnTimeUserTable.kt
index 870fba9..b3c497b 100644
--- a/core/src/main/kotlin/org/anvilpowered/ontime/core/db/OnTimeUserTable.kt
+++ b/core/src/main/kotlin/org/anvilpowered/ontime/core/db/OnTimeUserTable.kt
@@ -40,7 +40,7 @@ internal class OnTimeUserEntity(id: EntityID<UUID>) : UUIDEntity(id) {
     var playTime by OnTimeUserTable.playTime
     var bonusTime by OnTimeUserTable.bonusTime
 
-    companion object : UUIDEntityClass<OnTimeUserEntity>(OnTimeUserTable)
+    companion object : UUIDEntityClass<OnTimeUserEntity>(OnTimeUserTable, OnTimeUserEntity::class.java, ::OnTimeUserEntity)
 }
 
 internal fun OnTimeUserEntity.toOnTimeUser() = OnTimeUser(
verbal skiff
grave compass
#

Hello, why could I be getting these errors after trying to use paperweight-userdev 1.7.1 on gradle groovy? I've followed the tutorial and managed to import the bundle so I don't get the bundle error, but now I get https://pastes.dev/1QbYWzbVyq

distant mango
#

also send ur build script

lament scarab
#

you'd generally want to look at the log file

grave compass
# distant mango also send ur build script
plugins {
    //id("io.github.goooler.shadow") version "8.1.7"
    //id("io.typecraft.gradlesource.spigot") version "1.0.0"
    id("io.papermc.paperweight.userdev") version "1.7.1"
}

repositories {
    mavenCentral()
    gradlePluginPortal()
    maven {
        url = "https://repo.papermc.io/repository/maven-public/"
    }
    maven {
        name = "spigotmc-repo"
        url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
    }
    maven {
        name = "sonatype"
        url = "https://oss.sonatype.org/content/groups/public/"
    }
    maven {
        url = "https://oss.sonatype.org/content/repositories/snapshots"
    }
    maven {
        url = "https://oss.sonatype.org/content/repositories/central"
    }
    mavenLocal()
}

dependencies {
    paperweightDevelopmentBundle('io.papermc.paper:dev-bundle:1.20.6-R0.1-SNAPSHOT')

    implementation project(':Starter')
    implementation project(':Commons')

    compileOnly "org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT"
    //compileOnly "org.spigotmc:spigot:1.20.2-R0.1-SNAPSHOT"
    //compileOnly("org.spigotmc:spigot:1.20.2-R0.1-SNAPSHOT:remapped-mojang")

    compileOnly fileTree(dir: '../libsAPI', include: ['*.jar'])
}

//spigotRemap {
//    spigotVersion.set("1.20.2")
//    sourceJarTask.set(tasks.shadowJar) // or `tasks.shadowJar` if you use Shadow plugin.
//}
floral jackal
lament scarab
#

generally, make sure that you applied patches and handled anything like paperweight, etc, updates

distant mango
#

broken java install

lament scarab
#

otherwise, something is busted with your task inputs or something

distant mango
#

wait nvm read the wrong thing

grave compass
#

Hey, just wanted to come back and say that it's fixed, my dum dum was using java 16 instead of 17 for 1_20_2

#

Thanks for the help

floral jackal
#

I just realized what was wrong, thanks for the help

sharp trellis
#

since server version api has been merge, some changes to manifest attributes happened, which values I should change to my fork brand here?

            "Main-Class" to "org.bukkit.craftbukkit.Main",
            "Implementation-Title" to "Paper",
            "Implementation-Version" to implementationVersion,
            "Implementation-Vendor" to date, // Paper
            "Specification-Title" to "Paper",
            "Specification-Version" to project.version,
            "Specification-Vendor" to "Paper Team",
            "Brand-Id" to "papermc:paper",
            "Brand-Name" to "Paper",
            "Build-Number" to (build ?: ""),
            "Build-Time" to Instant.now().toString(),
            "Git-Branch" to gitBranch, // Paper
            "Git-Commit" to gitHash, // Paper
            "CraftBukkit-Package-Version" to paperweight.craftBukkitPackageVersion.get(), // Paper
#

nvm

verbal skiff
#

Its fine to include org.jetbrains:annotations in the compileOnly configuration right?

#

or does it need to be available at runtime

distant mango
#

it does not

verbal skiff
#

okay, thanks

vale pelican
#

Hello, since Java target and souce compatiblity are scheduled for removal in Gradle 9, I am trying to find a way to use a newer java sdk, but still compile against an older version of Java. In this case I am using the Java 21 SDK, but I am trying to compile against Java 8 (I am not making use of any of the new Java features). Previously I could just set my project SDK to 21, and then set source and target compatiblity to Java 8, and that has been working fine ever since.

I am now trying to switch to the toolchain option, but I am having isues getting it to compile towards the Java 8 bytecode.

I tried both:

withType<JavaCompile> {
  options.encoding = "UTF-8"
  options.release = 8
}

and

tasks.withType<JavaCompile>().configureEach {
    javaCompiler = javaToolchains.compilerFor {
        languageVersion = JavaLanguageVersion.of(8)
    }
    options.encoding = "UTF-8"
}

But none of these options are working.

Does someone has any idea how I could solve this issue?
Thanks in advance!

Bram

verbal skiff
vale pelican
verbal skiff
#

Is there a good way to fail the shadowJar build if a specific package (org.slf4j) is present in the jar?

#

I know theres package exclusions for shadowJar but I'd rather solve this by excluding the dependency entirely from the runtimeClasspath

#

theres some packages sneaking the slf4j transitive runtime dependency into my build

prime cliff
verbal skiff
#

but if a dependency suddenly includes this other dependency in a new update, there's no safeguard

#

so far it's exposed and the mariadb driver including slf4j as a runtime dep

prime cliff
#

Nope, not that I know. Except creating a tasks that checks dependencies and fails when these are present.

verbal skiff
#

the thing is that the presence of slf4j in the jar kinda breaks logging

static urchin
#

shadowJar task iirc has a dependency filter no?

prime cliff
#

Dependency filtering does not apply to transitive dependencies.

static urchin
#

skully rough

#

I guess it is indeed time to just flatten the dependency tree and scan

#

actually no, the page says it just does not exclude transitive deps if you exclude their parent.

#

I think this should work

prime cliff
#

Oh, missed reading the context. My bad

static urchin
# verbal skiff hm yeah

so yea give this a try

tasks.shadowJar {
    dependencies {
        exclude { it.moduleGroup == "org.slf4j" }
    }
}
verbal skiff
#

but maybe it's the only good way

static urchin
#

oh

#

sorry did not read that far up

#

but I mean, if you just wanna yank them from the config, that should be doable too?

static urchin
#

gone it is

#

just, that is going to fuck with you if you then actually use papers supplied slf4j stuff

#

so be aware of that I guess

dusk quail
#

anyone had issues of shadow, john and gooler's taking like 5 or 6 seconds to run a fresh build with kotlin, cached builds take like 300ms but modified files take a lot longer, Project is kotlin and the classes arent that big, its got 8gb of ram and caching, parallel and kt incremental enabled.

Build Files:
build.gradle.kts https://pastes.dev/hwkzD0ReWh
gradle.properties https://pastes.dev/onCQKtJVpf

verbal skiff
#

sounds quite normal for a compilation depending on your hardware

#

my repo needs 11s to compile and I have a relatively recent and powerful laptop

tranquil bough
#

i'm working on a paper fork but it's randomly decided to stop building, apparently it thinks that a load of org.bukkit classes don't exist

#

i've tried clearing every kind of cache i can possibly think of, restarting etc, nothing's worked

#

where would i even begin to debug this? intellij has indexed them completely fine, they're definitely there

static urchin
#

I mean, attempt to run ./gradlew build in your terminal and upload the error log

echo kilnBOT
#

Please send large files/logs to a pastebin

lament scarab
#

probably java version related

#

missing package though, not class

tranquil bough
#

i've got everything using 21 already

lament scarab
#

all I can guess is that the server artifact isn't depending on the API artifact properly

tranquil bough
#

fwiw it worked perfectly half an hour ago

lament scarab
#

best guess is going to be to rebuild patches, yeet -api/-server and reapply them and build

#

otherwise, we can't really see what is going on, all we can see is that the classpath is apparently mashed

tranquil bough
#

it's still broken sadly :(

#

i just tried deleting and cloning fresh too, still brokey

tranquil bough
#

i got someone else to try it and it worked for them, could it possibly be because i'm on a mac?

lament scarab
#

generally, no

#

a good chunk of the team works on mac

verbal skiff
#

Is there a good way to solve the problem of "transitive relocations"? Say there is a lib Foo, which is shaded and relocated in plugin A and plugin B (also exposed in each api).

Now, plugin C wants to use some api of plugin A and plugin B. Is there a way to relocate the imports at compile time in the source so that plugin C can effectively use lib Foo types without any conflicts?

in plugin C:

import org.example.a.relocated.foo.Bar as ABar
import org.example.b.relocated.foo.Bar as BBar
#

even if there arent two plugins using Foo, it would be necessary to inform the downstream dependency (plugin C) of the relocation of lib Foo

smoky violet
#

the two solutions are basically have consumers manually copy the relocations or to publish and consume the shadowjar

verbal skiff
#

you would have to pick one relocation

#

I wonder if there is a way to publish relocation information? Then it would maybe be possible to write a plugin to support this

smoky violet
#

you'd need to use multiple sourcesets or projects in that case

verbal skiff
#

or relocate the imports of these dependencies at compile time

#

which im not even sure is possible

smoky violet
#

just publish some metadata file as a variant and consume it on the other end

#

or even put it in the jar

#

still would need to separate conflicting uses into sourcesets or smth

verbal skiff
#

not if the imports are separated no?

smoky violet
#

I am talking about the solution where you don't consume the shadowjar

verbal skiff
#

yeah I mean a solution where you publish relocation information like you said, but still manage to transform the imports with a plugin

smoky violet
#

you mean transform the incoming deps? not clear what you mean by "imports" here

verbal skiff
#

I mean transform the package names of the dependencies

#

so it were as if you were consuming the shadow jar

smoky violet
#

it would be much more complex, and ignoring the various limitations of artifact transforms, not sure if it would handle the same dependency twice with two target variants (probably not)

#

you would need to venture into hacky territory

verbal skiff
#

hm yeah

#

kinda frustrating that there isnt already a solution to this problem

#

but its quite specific to situations where you have to relocate, which I guess isnt so common

lament scarab
#

relocation is a hack, not a solution, and so ofc there is generally no good mechanism for this, all you can do is not expose transitives so it's a non-issue or basically relocate them in the published artifact so that people build against the relocation

tranquil bough
#

Non-GNU diffutils diff detected, '--version' returned:
Apple diff (based on FreeBSD diff)
i'm getting this when generating a dev bundle for publishing, what might having a non-gnu diff break?

lament scarab
#

it behaves differently

#

and is generally an outdated version

granite valve
#

can you have typesafe accessors to the version catalog in an includedBuild plugin in like buildSrc?

#

I'm trying to move away from using subprojects in the root build.gradle to apply common stuff, but am unsure how to best handle dependencies that are required for each

verbal skiff
#

it's quite a clusterfuck

granite valve
#

yeah, I saw that issue and did the super jank thing

weary salmon
#

but still no louck in getting it to work

distant mango
#

you need to add the plugin to the root project under id("tech.parent") with apply false

weary salmon
#

Like that right?

distant mango
#

yes

#

then apply in subproject

weary salmon
#

So like that in the bukkit module

distant mango
#

just id(".....userdev")

#

without version or apply

weary salmon
#

Still getting this error

distant mango
#

can you send the full error

weary salmon
#
> Could not resolve all dependencies for configuration ':bukkit:compileClasspath'.
   > Could not find io.papermc.paper:paper-server:userdev-1.20.6-R0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/paper-server-userdev-1.20.6-R0.1-SNAPSHOT.pom
       - https://repo.papermc.io/repository/maven-public/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.papermc.io/repository/maven-public/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/paper-server-userdev-1.20.6-R0.1-SNAPSHOT.pom
       - https://repo.extendedclip.com/content/repositories/placeholderapi/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.extendedclip.com/content/repositories/placeholderapi/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/paper-server-userdev-1.20.6-R0.1-SNAPSHOT.pom
       - https://repo.viaversion.com/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.viaversion.com/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/paper-server-userdev-1.20.6-R0.1-SNAPSHOT.pom
       - https://repo.opencollab.dev/maven-snapshots/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.opencollab.dev/maven-snapshots/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/paper-server-userdev-1.20.6-R0.1-SNAPSHOT.pom
       - https://repo.purpurmc.org/snapshots/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.purpurmc.org/snapshots/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/paper-server-userdev-1.20.6-R0.1-SNAPSHOT.pom
       - https://repo.spongepowered.org/repository/maven-public/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.spongepowered.org/repository/maven-public/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/paper-server-userdev-1.20.6-R0.1-SNAPSHOT.pom
       - https://jitpack.io/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/maven-metadata.xml
       - https://jitpack.io/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/paper-server-userdev-1.20.6-R0.1-SNAPSHOT.pom
       - https://repo.md-5.net/content/groups/public/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.md-5.net/content/groups/public/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/paper-server-userdev-1.20.6-R0.1-SNAPSHOT.pom
       - https://nexus.codecrafter47.dyndns.eu/content/repositories/public/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.codecrafter47.dyndns.eu/content/repositories/public/io/papermc/paper/paper-server/userdev-1.20.6-R0.1-SNAPSHOT/paper-server-userdev-1.20.6-R0.1-SNAPSHOT.pom
     Required by:
         project :bukkit

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html```
distant mango
#

uhh..
is paperweight.paperDevBundle("1.20.6-R0.1-SNAPSHOT") still the same in the bukkit one?

weary salmon
#

Its now like that

#

And that

#

So these are both in the bukkit module.
But the paperweight.paperDevBundle("1.20.6-R0.1-SNAPSHOT") isn't inside the root build.gradle

distant mango
#

that's correct

weary salmon
#

In the settings.gradle.kts I had to set this in the image as it didn't get the other dependencies

distant mango
#

I'm kind off out of ideas, can you maybe check if for some reason something is including paper-server:userdev-...? est bet is to probably wait on someone smarter then me :d

weary salmon
#

But when I remove that I get this

#

Oke so I think I know what the issue is and thats because of the repositoriesMode = RepositoriesMode.PREFER_SETTINGS line which only allows the retrieval of repo's from the main settings.

But when I don't do that I get an error which doesn't rerieve the other repo's because of PaperWeight plugin

weary salmon
#

The frustrating part is that the system works great without the PaperWeight plugin but once I added that it breaks the module setup

#

Please ping me if you can help me

smoky violet
#

userdev is not compatible with repos declared in settings

#

it needs to be able to add it's local repository to the project

weary salmon
#

Like its either Paperweight or the other dependencies

distant mango
#

add the repositories in the subprojects (or all?) block

weary salmon
#

Yea, just added the repositories to the bukkit module build.gradle.kts that works

#

might be something to take a look at why it does this weird thing.

#

But that goes above my head XD

smoky violet
#

it's not compatible with settings repos, as I already said

weary salmon
#

Well when I remove the PaperWeight plugin it works

#

but when I add it doesn't

smoky violet
#

...

weary salmon
#

So when I am not using the plugin it gets all dependencies but once I add the plugin (paperweight) it doesn't work anymore.
Somehow paperweight blocks the global settings.gradle.kts repositories.

smoky violet
#

for the third time, paperweight is not compatible with declaring repos in settings

#

(userdev that is)

weary salmon
#

Oke I didn't know that and that explains why

#

So far I saw its not displayed on the wiki

#

it just says it needs to be in the settings.gradle.kts but nothing about thats not compatible with mutli module setup

smoky violet
#

it has nothing to do with multi-project setups

#

it's a limitation of paperweight

#

which is not easily solvable, users would have to apply an extra settings plugin and duplicate the dev bundle dependency there

weary salmon
#

Oke no worries, I have made a work arround which works

verbal skiff
#

Is there a way to "inject" some transformer in a gradle property? I'm looking to mutate but not replace the whole value. E.g:

abstract val config: Property<Config>
// ...

config.set(config.map { it.copy(foo = "test") })
#

unfortunately this errors

smoky violet
#

I think they had some prop.update { existingValue -> ... } method incubating for that

#

iirc it was planned for 8.7 but got pushed back to a later release

verbal skiff
#

okay, interesting

#

weird that it hasn't existed yet

deep falcon
#

I receive this error when trying to run my build
io.papermc.paperweight.PaperweightException: Execution of 'net.fabricmc.tinyremapper.Main' failed with exit code 1. Log file: C:\Users\willy\IdeaProjects\CustomCamera.gradle\caches\paperweight\taskCache\reobfJar.log Classpath: C:\Users\willy.gradle\caches\modules-2\files-2.1\net.fabricmc\tiny-remapper\0.10.1\c293b2384ae12af74f407fa3aaa553bba4ac6763\tiny-remapper-0.10.1-fat.jar
Here's that log file

Command: C:\Program Files\Java\jdk-17\bin\java.exe -Xmx1G -classpath C:\Users\willy.gradle\caches\modules-2\files-2.1\net.fabricmc\tiny-remapper\0.10.1\c293b2384ae12af74f407fa3aaa553bba4ac6763\tiny-remapper-0.10.1-fat.jar net.fabricmc.tinyremapper.Main C:\Users\willy\IdeaProjects\CustomCamera\build\libs\CustomCamera-1.0.0.jar C:\Users\willy\IdeaProjects\CustomCamera\build\libs\CustomCamera-1.0.0.jar C:\Users\willy.gradle\caches\paperweight-userdev\ff775525efc29c3503a07d1006e63e5695a742b7505cf63e157d49d32419c69f\module\io.papermc.paper\dev-bundle\1.20.4-R0.1-SNAPSHOT\paperweight\setupCache\extractDevBundle.dir\data\mojang+yarn-spigot-reobf.tiny mojang+yarn spigot C:\Users\willy.gradle\caches\paperweight-userdev\ff775525efc29c3503a07d1006e63e5695a742b7505cf63e157d49d32419c69f\module\io.papermc.paper\dev-bundle\1.20.4-R0.1-SNAPSHOT\paperweight\setupCache\applyMojangMappedPaperclipPatch.jar --threads=1
Can't read input file C:\Users\willy\IdeaProjects\CustomCamera\build\libs\CustomCamera-1.0.0.jar.
smoky violet
#

show your build script

deep falcon
# smoky violet show your build script
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
    id 'java'
    id 'com.github.johnrengelman.shadow' version '8.1.1'
    id 'io.papermc.paperweight.userdev' version '1.7.1'
}

group = 'me.thermal.customcamera'
version = '1.0.0'
jar.enabled = false

java {
    toolchain.languageVersion = JavaLanguageVersion.of(21)
}

compileJava {
    sourceCompatibility = '17'
    targetCompatibility = '17'
    options.release = 17
    options.encoding = 'UTF-8'
}

repositories {
    mavenCentral()
    maven { url 'https://repo.papermc.io/repository/maven-public/' }
    maven { url 'https://oss.sonatype.org/content/groups/public/' }

    maven { url 'https://repo.dmulloy2.net/repository/public/' }
    maven { url 'https://mvn.lumine.io/repository/maven-public/' }
}

dependencies {
    paperweight.paperDevBundle "1.20.4-R0.1-SNAPSHOT"
    compileOnly "io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT"


    compileOnly 'org.projectlombok:lombok:1.18.32'
    annotationProcessor 'org.projectlombok:lombok:1.18.32'

    compileOnly 'io.lumine:Mythic-Dist:5.6.2'
    compileOnly 'com.comphenix.protocol:ProtocolLib:5.1.0'
    implementation 'dev.jorel:commandapi-bukkit-shade:9.4.1'
}

build {
    dependsOn shadowJar //reobfJar
    doLast {
        File file = file(testServerPath + '/plugins/')
        file.listFiles().each {
            if (it.name.equalsIgnoreCase("${rootProject.name}-${version}.jar"))
                delete(it)
        }
        copy {
            from("build/libs/${rootProject.name}-${version}.jar")
            into(testServerPath + "/plugins/")
        }
    }
}

shadowJar {
    archiveFileName = "${rootProject.name}-${version}.jar"
    relocate 'dev.jorel.commandapi', group + '.customcamera.commandapi'
}

processResources {
    filter(ReplaceTokens, tokens: [version: version])
}
smoky violet
#

don't change the shadow jar name

deep falcon
lament scarab
# deep falcon Can I ask why?

Because it breaks the task output and means that we can’t find the jar, there is also generally 0 gains for remaining that jar

maiden totem
lament scarab
#

No, that's yarn

maiden totem
#

also multiple files in 1 correct?

zenith flower
#

yes, all jar files are zip files

#

so they (usually) contain more than one thing

quick leaf
lament scarab
#

assuming you're using gradle, you'd generally run with one of the flags it tells you to run with

quick leaf
#

Okay, now what?

lament scarab
#

what?

quick leaf
#

it looks the same-

lament scarab
#

provide the full output of gradle

echo kilnBOT
#

Please send large files/logs to a pastebin

quick leaf
#

Where do I find the logs?

lament scarab
#

there is no logs file

quick leaf
#

hm

lament scarab
#

I want to see the full output of the gradle thing you ran

#

IJ might let you see the full thing if you click on the task run in the bottom

#

otherwise, run in a proper terminal

quick leaf
#

?...

lament scarab
#

the thing above that one should provide the full gradle output iirc

#

might be missing the actual trace for the actual error

#

but, all I can guess is that you've got something in your build setup that doesn't like java 21, or you're running gradle with an outdated JDK

lament scarab
#

oh, 66

quick leaf
#

ye

lament scarab
#
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 66
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:199)
#

I'd guess gradle doesn't like java 22

#

at least, the version that you're using

#

caches\8.0

quick leaf
#

Could you help me figure out which one I need to use them? i've literally tried seventeen, twenty one, and twenty two, but I've also tried multiple different versions of twenty one that I have in my versions list that I can choose fro

lament scarab
#

You need to update gradle

quick leaf
#

How do I update gradle?

lament scarab
#

see their docs, generally you use the wrapper command

quick leaf
#

okay-

quick leaf
distant mango
#

np

quick leaf
bronze willow
brave widgetBOT
brave widgetBOT
bronze willow
#

Am i missing something?

distant mango
#

use that

bronze willow
#

Whats that

#

And how

distant mango
#

a fork of shadow that supports java 21

bronze willow
#

How can i use that?

distant mango
#

replace original shadow with that

bronze willow
#

Ty ig

#

Is the original shadow not active anymore?

distant mango
#

correct

bronze willow
#

okay

bronze willow
#
tasks.named<ShadowJar>("shadowJar") {
    archiveClassifier.set("")
    relocate("com.fasterxml.jackson", "de.derioo.shadow.jackson")
    relocate("com.fasterxml.jackson.databind", "de.derioo.shadow.jackson.databind")
    relocate("com.fasterxml.jackson.core", "de.derioo.shadow.jackson.core")
    relocate("com.fasterxml.jackson.annotation", "de.derioo.shadow.jackson.annotation")
}

tasks.named<ShadowJar>("sourcesJar") {
    archiveClassifier.set("sources")
    relocate("com.fasterxml.jackson", "de.derioo.shadow.jackson")
    relocate("com.fasterxml.jackson.databind", "de.derioo.shadow.jackson.databind")
    relocate("com.fasterxml.jackson.core", "de.derioo.shadow.jackson.core")
    relocate("com.fasterxml.jackson.annotation", "de.derioo.shadow.jackson.annotation")
    from(sourceSets.main.get().allSource)
}

Does that make sence to do something like this?

#

Because i want to publish a normal shadowjar with the reloacted stuff and a sources jar with the sources

#

i have fixed it

#

tasks.register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allJava)
}
Im using this^ now

distant mango
#

you can enable a sourcesJar from the java extension

#
java {
    withSourcesJar()
    withJavadocJar()
}
granite valve
#

does the sources jar usually have dependencies in it? I don't think so

raven barn
#

No it doest

teal helm
#

Hey, it seems like the PluginRemapper does not run when running the "runDev" paperweight task. Is it possible to somehow invoke it?

granite valve
#

you mean the runDev from the paper repo?

#

or a task added by paperweight userdev

teal helm
#

If this is unexpected behavior, I can send logs from both situations: with runDev, and built jar

static urchin
#

try runServer

distant mango
#

do you mean runDevServer?

teal helm
#

anyways I'm going to try runDevServer

#

Okay it seems like ./gradlew runDev just runs ./gradlew runDevServer:

./gradlew runDev

> Configure project :
paperweight-patcher v1.7.1 (running on 'Linux')

> Configure project :paper
paperweight-core v1.7.1 (running on 'Linux')

> Task :slimeworldmanager-server:runDevServer
#

but I'm going to try ./gradlew runDevServer just for good measure

#

yup, the issue is still there - the plugins are not remapped

#

./gradlew runServer just straight up started downloading 1.20.4 lol

#

So is this intended or not?

distant mango
#

runDev doesn't contain mappings (afaik?)

        if (MappingEnvironment.reobf() || !MappingEnvironment.hasMappings()) {
            return null;
        }
smoky violet
#

yes it's intended

#

runDevServer: Spin up a test server without assembling a jar

#

generating reobf mappings requires analysis of a complete jar

#

use runServer if you need remapping

#

if it downloaded 1.20.4 that kind of screams you have some other project with a 1.20.4 runServer task that is taking prioritiy

teal helm
smoky violet
#

please read the task descriptions and if you have a more specific question let me know

teal helm
#

okay, the 1.20.4 issue was caused because someone put:

    runServer {
        minecraftVersion("1.20.4")
    }

under the tasks configuration

#

So it's an oversight on my side

smoky violet
#

that would result in a script compilation error on Paper-Server's runServer task...

static urchin
teal helm
#

But yeah, runServer does remap the plugin JARs, so thanks for your advice!

#

Yup, you were correct. Someone back in the day put the xyz.jpenilla.run-paper gradle plugin there, which is why it behaved like that.

grim mauve
#

(Posting this for anyone that is searching for this issue on this server)

If you are updating your fork and you are getting error: release version 21 not supported when trying to compile your fork even tho you already have JDK 21 set up... don't forget to change the Java version from 17 to 21 in your fork's root build.gradle.kts (whoops, spent some minutes trying to debug this issue)

balmy pier
#

I am trying to use the run-paper plugin, but I keep getting these errors when refreshing my gradle:

Could not create task ':runMojangMappedServer'.
Could not create task of type 'RunServer'.
Could not create an instance of type xyz.jpenilla.runtask.pluginsapi.DownloadPluginsSpec.
Could not generate a decorated class for type DownloadPluginsSpec.
Cannot have abstract method NamedDomainObjectSet.named().

build.gradle.kts:

/*
 * This file was generated by the Gradle 'init' task.
 */

plugins {
    `java-library`
    id("io.papermc.paperweight.userdev") version "1.7.1"
    id("xyz.jpenilla.run-paper") version "2.2.0"
}

repositories {
    maven {
        url = uri("https://repo.papermc.io/repository/maven-public/")
    }

    maven {
        url = uri("https://oss.sonatype.org/content/groups/public/")
    }

    maven {
        url = uri("https://repo.maven.apache.org/maven2/")
    }
}

dependencies {
    compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")
    paperweight.paperDevBundle("1.20.6-R0.1-SNAPSHOT")
}

java {
    toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}

java.sourceCompatibility = JavaVersion.VERSION_21

tasks.withType<JavaCompile>() {
    options.encoding = "UTF-8"
}

tasks.withType<Javadoc>() {
    options.encoding = "UTF-8"
}
distant mango
#

is that your full config?

#

also update to 2.3.0

balmy pier
#

upgarding to 2.3.0 worked, thank you

distant mango
#

fyi runMojangMappedServer has been deprecated and replaced by runDevBUndleServer

balmy pier
#

ah i see, ty

balmy pier
#
plugins {
    `java-library`
    id("io.papermc.paperweight.userdev") version "1.7.1"
    id("xyz.jpenilla.run-paper") version "2.3.0"
    id("com.github.johnrengelman.shadow") version "8.1.1"
}

repositories {
    maven {
        url = uri("https://repo.papermc.io/repository/maven-public/")
    }
    maven {
        url = uri("https://oss.sonatype.org/content/groups/public/")
    }
    maven {
        url = uri("https://repo.maven.apache.org/maven2/")
    }
}

dependencies {
    compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")
    paperweight.paperDevBundle("1.20.6-R0.1-SNAPSHOT")
}

java {
    toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}

group = "me.slimified"
version = "1.0-SNAPSHOT"
description = "SlimifiedPlugin"
java.sourceCompatibility = JavaVersion.VERSION_21
java.targetCompatibility = JavaVersion.VERSION_21

tasks.withType<JavaCompile> {
    options.encoding = "UTF-8"
}

tasks.withType<Javadoc> {
    options.encoding = "UTF-8"
}

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
    archiveClassifier.set("")

    dependencies {
        include(dependency("me.slimfied:SlimifiedLibrary:1.0-SNAPSHOT"))
    }

    relocate("me.slimified.library", "me.slimified.slimifiedplugin.shaded.library")
}

tasks {
    build {
        dependsOn(shadowJar)
    }
}

How come I get this error?:

Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 65

distant mango
#

use io.github.goooler.shadow

#

drop in replacement

#

just need to change the id and version

balmy pier
#

ah alr

balmy pier
distant mango
#

it’s not com.github

balmy pier
#

what is it?

distant mango
#

read my message lol

balmy pier
#

oh lol

#

sry

balmy pier
#

everything works fine now, ty

final jewel
#

wonder what happened to johnrengelman

#

dude's been maintaining the shadow plugin since forever

thorn maple
remote mortar
#

Anyone know work arounds to the file name error with gradle, i have my project file in the root of the drive and i have the registry flag for longer file names on

lament scarab
#

That’s a windows limitation

#

The registry flag fixes some stuff but then that stuff needs to be using certain api

#

Best you can do is just use a shorter path at this point

raw vessel
#

I'm trying to use paperweight-patcher to create an 1.20.1 fork by using the example as template but when I run gradlew applyPatches I get the following error:

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':applyGeneratedApiPatches' (type 'PatcherApplyGitPatches').
  - In plugin 'io.papermc.paperweight.patcher' type 'io.papermc.paperweight.patcher.tasks.PatcherApplyGitPatches' property 'upstreamDir' specifies directory '/Users/pixeldev/Workspace/fenix-team-updated/new-paper/.gradle/caches/paperweight/upstreams/paper/paper-api-generator/generated' which doesn't exist.
    
    Reason: An input file was expected to be present but it doesn't exist.
    
    Possible solutions:
      1. Make sure the directory exists before the task is called.
      2. Make sure that the task which produces the directory is declared as an input.
    
    For more information, please refer to https://docs.gradle.org/8.8/userguide/validation_problems.html#input_file_does_not_exist in the Gradle documentation.
GitHub

Contribute to PaperMC/paperweight-examples development by creating an account on GitHub.

#

I'm aware that the example is setup for 1.20.6 but I made this changes:

static urchin
#

.1 may not have had the generator branch merged

#

I'd just find the last commit in the examples repo that was made for 20.1 and go from there

raw vessel
#

There are no commits with 1.20.1 on the paperweight-examples repository

#

I found one version for 1.20.2

#

But nothing for 1.20.1

distant mango
#

why .1

raw vessel
#

why not

raven barn
#

If you go modern at least go latest

true burrow
brave widgetBOT
true burrow
#

My build.gradle

plugins {
    id "java"
    id "net.minecrell.plugin-yml.bukkit" version "0.6.0"
    id "net.minecrell.plugin-yml.paper" version "0.6.0"
    id "io.github.goooler.shadow" version "8.1.7"
    id "xyz.jpenilla.run-paper" version "2.3.0"
    id "io.papermc.paperweight.userdev" version "1.7.1"
}

group = "me.greenlantern456"
version = "0.0.1-ALPHA"
description = "A work in progress practice plugin for Minecraft"

repositories {
    mavenCentral()
    maven {url = "https://repo.papermc.io/repository/maven-public/"}
    maven {url = "https://jitpack.io"}
}

dependencies {
    // Lamp command framework.
    def lamp_version = "3.2.1"
    implementation("com.github.Revxrsal.Lamp:common:$lamp_version")
    implementation("com.github.Revxrsal.Lamp:bukkit:$lamp_version")

    // Paper
    paperweight.paperDevBundle("1.20.6-R0.1-SNAPSHOT")
}

compileJava {
    options.compilerArgs += ["-parameters"]
}

bukkit {
    main = 'me.greenlantern456.plugin'
    apiVersion = 1.20
    authors = ['Greenlantern456','Amethyst Organization']
}

paper {
    main = 'me.greenlantern456.plugin'
    generateLibrariesJson = true
    apiVersion = '1.20'
    load = 'STARTUP'
    prefix = 'xPractice'
    authors = ['Greenlantern456','Amethyst Organization']
}

shadowJar {
  minimize()
}

tasks {
  runServer {
    minecraftVersion("1.20.6")
  }
}
smoky violet
#

copy the java toolchain & options.relase parts from the test-plugin's build & settings.gradle.kts

true burrow
#

Yes it works now, thanks!

mystic cloud
#

Hello guys, I'm going to try to create my own fork of Paper but I don't know where to start, does anyone have any documentation or something?

lament scarab
#

see the paperweight-examples repo

#

There comes a level of, "you're expected to be familiar with our tooling and able to crossref what we do" sorta deal

polar edge
#
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>lt.itsvaidas</groupId>
  <artifactId>ZCAdminSystemAdvanced</artifactId>
  <version>1.0</version>
  <build>
    <finalName>../../../KAIMUX-plugins/${project.artifactId}</finalName>
    <sourceDirectory>src/main/java</sourceDirectory>
    <defaultGoal>clean package</defaultGoal>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <release>17</release>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <repositories>
    <repository>
      <id>papermc</id>
      <url>https://papermc.io/repo/repository/maven-public/</url>
    </repository>
    <repository>
      <id>viaversion-repo</id>
      <url>https://repo.viaversion.com</url>
    </repository>
    <repository>
      <id>zcapi</id>
      <url>file://${project.basedir}/../ZCAPI</url>
    </repository>
    <repository>
      <id>zcmessages</id>
      <url>file://${project.basedir}/../ZCMessages</url>
    </repository>
    <repository>
      <id>zcpackages</id>
      <url>file://${project.basedir}/../ZCPackages</url>
    </repository>
    <repository>
      <id>zcwebsitelinkapi</id>
      <url>file://${project.basedir}/../ZCWebsiteLinkAPI</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>io.papermc.paper</groupId>
      <artifactId>paper-api</artifactId>
      <version>1.20.6-R0.1-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>```
#
    <dependency>
      <groupId>com.viaversion</groupId>
      <artifactId>viaversion-api</artifactId>
      <version>LATEST</version>
      </dependency>
    <dependency>
      <groupId>lt.itsvaidas</groupId>  
      <artifactId>ZCAPI</artifactId>  
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>lt.itsvaidas</groupId>  
      <artifactId>ZCMessages</artifactId>  
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>lt.itsvaidas</groupId>
      <artifactId>ZCPackages</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>lt.itsvaidas</groupId>
      <artifactId>ZCWebsiteLinkAPI</artifactId>
      <version>1.0</version>
    </dependency>
  </dependencies>
</project>```
echo kilnBOT
#

Please send large files/logs to a pastebin

distant mango
#

next time

#

set it to 21 like I said

polar edge
fossil topaz
lament scarab
#

probably outdated jdk

#

or maybe that

polar edge
#

How to change intellij used jdk?

lament scarab
#

see the module settings

polar edge
fossil topaz
polar edge
#

How to do it?

distant mango
#

button top right

lament scarab
#

just run a build and it will pull that stuff

polar edge
#

Changed to jdk 21, reloaded everything, still doesnt work

distant mango
#

try restarting your intellij and building via terminal

lament scarab
#

generally you set the sdk on the root of the thing and that is inherited

polar edge
#

After restart the version error from compiler dissapeared

lament scarab
#

you're also not looking at the full error

lament scarab
#

thought those where submodules

#

nvm

polar edge
#
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.357 s
[INFO] Finished at: 2024-06-04T13:42:28+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project ZCAdminSystemAdvanced: Fatal error compiling: error: release version 21 not supported -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Process finished with exit code 1```
lament scarab
#

probably still building with an older jdk

distant mango
#

what happens if you add

<properties>
  <java.version>21</java.version>
</properties>
``` to your pom?
polar edge
distant mango
#

make sure maven is actually using the 21 jdk ¯_(ツ)_/¯

polar edge
#

Does this do anything?

lament scarab
#

no

#

because you're not using the built in thing, you're using the maven runner

polar edge
#

I don't like the first line

#

Okay, now it works, now fixing 80 projects with all those changes

brisk belfry
#

im not a pro in terms of build tooling but if I have 80 projects i would start thinking about a plugin or whatever that handles such things. Like i'm 90% certain that you could add a plugin to your pom that automatically sets your java version along with dependencies no?

polar edge
#

No, I dont really know how to use that pom.xml, so what I find in the internet, that's that

#

Redstone particle is now just Dust?

violet depot
#

What paperweight version is compatable for io.papermc.paper:dev-bundle:1.20.6-R0.1-SNAPSHOT

distant mango
#

you need to add paperweight to the root project with apply false

static urchin
#

you also apply it in the respective modules, without the version tho

swift kayak
#

anyone know how to fix this?

#

trying to run build.sh for paper 1.8.8 with some added patches

lament scarab
#

the things upset with the version of java you're using, probably

dense laurel
#

for the latest version use java 21

quick thicket
#

hello, I have confused. Must I use reobfJar from 1.20.6 and newest version of paperweight or I can build it only with build? I built my core with createMojmapBundlerJar

distant mango
#

for 1.20.5+ you do not need to use reobfJar

quick thicket
#

oh, I have reobfArtifactProduction set to MOJANG_PRODUCTION

quick thicket
distant mango
distant mango
#

just a guess with no errors

humble solar
#

oh no worries I fixed it by removing kryptonmc thing

#

no idea why it was there actually

paper kestrel
#

whats the policy for mache for "backporting" changes like vineflower updates?
cause even though 1.20.6 seems to compile, i dont think it runs because of a vineflower bug that has since been fixed (bitrandomsource is missing a cast from long thats present in newer versions, causing an index out of bounds on init)
its made more awkward by the face that vineflower has already been updated as part of a compile fix since then, even though 1.20.6 is (presumably) sill supported as the latest full release

bronze ember
#

Didn't somebody just back port that?

paper kestrel
#

🤦‍♂️ i dont think i looked at prs

bronze ember
#

Oh is it not merged yet?

#

Maybe I get a chance tomorrow

frozen jackal
#

How to increase the rendering distance of creatures in general on a paper server, which setting do I have to adjust?

rapid fractal
#

also #paper-help you are in wrong channel @frozen jackal

teal helm
#

Hey, is it possible to remap my plugin (and its dependencies) at compile-time to mojmap?

static urchin
#

it preferably should be in mojang mapping at a source level and remapped to spigot mappings if you need it (you don't on paper)

teal helm
#

I need to do the exact opposite

#

The command library I use uses spigot mappings

#

I need to deobf it to Mojang mappings

static urchin
#

my condolences

#

I don't think we have anything for that?

teal helm
#

;/

static urchin
#

but at that point, it will just be remapped during runtime by the server

teal helm
#

I mean it's not that big of a deal

#

But it's 4s in the initial startup

#

And some users create a new instance every time they start their server, so it is 4s for every startup

#

So it would be nice if this were possible, but I understand it's a niche use case

static urchin
#

alternatively, the users that "recreate" their server might want to look into also keeping the remapped plugin folder

#

given that it is in the plugin folder, they must have a rather fun setup anyway that keeps both plugin jars, their configurations and data folders but not the remapped folder KEKW

echo kilnBOT
#

Please send large files/logs to a pastebin

zealous spade
#

I'm having trouble starting up an empty project, I'm following the guide here:
https://docs.papermc.io/paper/dev/project-setup

The error I'm getting is:
> Could not find method maven() for arguments [https://repo.papermc.io/repository/maven-public/] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

Here's my build.gradle. Everything is in red by the way.
https://paste.gg/p/anonymous/7bf0b86efb4a4b01af861caed3b23cf3

bronze ember
#

That method is only for the kotlin syntax

zealous spade
#

Ah I see, I've been creating projects using the Minecraft helper for awhile, I create an empty project instead then follow that tutorial?

static urchin
#

Yea, the mcdev plugin template for build.gradle has some downsides

teal helm
#

thanks for your ideas tho

solemn carbon
#

So basically I'm making a plugin for some custom enchants , I have the plugin coded but I'm not sure how I put it in my server, or even if the plugin is coded properly. Btw it's just some code idrk if I need to put it in some sort of API.

distant mango
#

Don't crosspost, not the right channel

solemn carbon
distant mango
civic token
#

tbh the error does not seem helpful

#

recloned and re ran like 4 times and ig that worked. i think depedancy downloads partially failed or something.

zealous spade
#

[22:17:43 ERROR]: [DirectoryProviderSource] Error loading plugin: java.lang.IllegalArgumentException: Directory 'plugins.paper-remapped\ManaNPC-1.0.0.jar' does not contain a paper-plugin.yml or plugin.yml! Could not determine plugin type, cannot load a plugin from it!
java.lang.RuntimeException: java.lang.IllegalArgumentException: Directory 'plugins.paper-remapped\ManaNPC-1.0.0.jar' does not contain a paper-plugin.yml or plugin.yml! Could not determine plugin type, cannot load a plugin from it!

I'm having trouble trying to build my project.
Under gradle, I'm opening up the paperweight option and selecting 'reobjJar' if that's has anything to do with it

distant mango
#

do you have a plugin.yml

zealous spade
#

Yeah I was dumb, I put it under this test folder resources instead of my main zz

zealous spade
#

Thanks, got it working 👍

solemn carbon
#

So basically I'm making a plugin for some custom enchants , I have the plugin coded but I'm not sure how I put it in my server, or even if the plugin is coded properly. Btw it's just some code idrk if I need to put it in some sort of API.

distant mango
#

stop cross posting

#

this is like the 4th time you’ve been told

dim forge
#

Is the good channel to ask questions about paperweight and userdev plugin ?

static urchin
#

Sure 👍

dim forge
#

Okay, I opened an issue in Git repository but someone redirected me here !
So my issue is :
When I try to use the "Find Usage" of Intellij Idea on a method or class of the NMS mapping, decompile with the paperDevBundle, Intellij doesn't succeed to find anything.
When I look to class decompiled by the software there's always the mention "no usages" at the end of all classes.

Any idea to patch this ?

main mica
#

Check that your userdev plugin is up-to-date

#

I had that issue in older versions, but updating to 1.7.1 fixed it

smoky violet
#

pretty sure it's something in a recent intellij update

#

once populated the ivy repo is bog standard in terms of the meta, classes/sources jars, etc

distant mango
sturdy coral
#

Ill take a look. Having to define a toml configuration file for this makes me unhappy

distant mango
#

just suggesting something which i know actually works, i’ve never used (or seen) the one in settings

sturdy coral
#

Thanks for sharing either way

static urchin
#

@sturdy coral if you only expose the version, isn't that exposed under catalogName.versions?

static urchin
sturdy coral
#

Yes that worked.

static urchin
sturdy coral
#

Instantly nuked the toml file

#

Thank god it worked for plugin resolution as well

static urchin
#

Well for the plugin you could use the plugin directive in the catalog

sturdy coral
#

Hmm

#

It compiles -> me no touch

static urchin
#

but anyway, you should be using version refs instead

#

like this does not make sense

distant mango
#

also 1.20.1 ):

sturdy coral
#

I have a project with like 20 modules and have to prepare an update for 1.20.6
Thats why i wanted to centralize the versioning.

static urchin
#
version("minecraft", "1.20.6-R0.1-SNAPSHOT")

library("api", "io.papermc.paper", "paper-api").versionRef("minecraft")
#

like

#

this is how you'd use the version directive

sturdy coral
#

Hmm

#

That makes sense

#

In that case ill try to declare the plugin in there as well

static urchin
#

yea, that should also be straight forward

#

you just end up replacing the entire plugin definition with alias(paper.plugins.userdev)

sturdy coral
#
dependencyResolutionManagement {
    versionCatalogs {
        create("paper") {
            version("minecraft", "1.20.1-R0.1-SNAPSHOT")
            version("userdev", "1.7.1")
            library("api", "io.papermc.paper", "paper-api").versionRef("minecraft")
            plugin("userdev", "io.papermc.paperweight.userdev").versionRef("userdev")
        }
    }
}
static urchin
sturdy coral
#

Probably no way to bring the paperDevBundle into the version catalog without serious shenanigans

#

But that helped a lot. thx.

static urchin
#

yea the "paperweight.paperDevBundle" part is similar to "implementation" or "compileOnly"

#

those remain there

sturdy coral
#

Makes sense

dim forge
dim forge
sturdy coral
#

In my multi-module gradle setup, i called subprojects to configure my modules with common functionality:

subprojects {
    plugins.apply("java")

    java {
        toolchain {
            languageVersion.set(JavaLanguageVersion.of(17))
        }
    }

    tasks.withType<JavaCompile> {
        options.encoding = "UTF-8"
    }
    ...

I would now like to add a conditional configuration:
If a project has the shadow plugin applied, let the assemble task depend on the reobfJar task:

tasks.assemble {
    dependsOn(tasks.reobfJar)
}

But im not sure how to achieve this.
This might be tricky, because the root project does not have the shadow plugin applied, meaning it might not
be able to resolve the reobfJar at all.

#

Its not a huge issue, but i would like to prevent any repetition in my build files

static urchin
#

evaluationDependsOnChildren might be your friend

#

alternatively, afterEvaluate

#

or, if you are this far down into gradle magic, custom extensions

static urchin
#

well rn your reactor project is evaluated first, then its children

#

you could change that order

sturdy coral
#

Hmm

static urchin
#

Tho, it obviously comes with some ✨ cost ✨

sturdy coral
#

That sounds like it will make something kaputt

static urchin
#

Indeed, your entire subprojects block would be applied after

#

so your projects cannot really depend on that iirc

#

afterEvaluate is probably fine tho

sturdy coral
#

I decided that copying 3 lines is ok for now

static urchin
#

Well give afterEvaluate a try 😉

sturdy coral
#

Ill try it

gritty robin
#

Is correct? @sturdy coral

gritty robin
sturdy coral
#

I have a gradle project using the userdev plugin as well as the shadow plugin.
The shadow plugin shadows a dependency, containing different NMS classes (AnvilGUI) which subsequently results in the reobfJar task failing.
Should i run the shadowJar task after the reobfJar task, and if so, how would i accomplish that while still automatically shading/reobfuscating when running
the build task?

#
plugins {
    id("java-library")
    alias(paper.plugins.userdev)
    alias(libs.plugins.shadow)
}

repositories {
    mavenCentral()
    maven("https://repo.papermc.io/repository/maven-public/")
    maven("https://oss.sonatype.org/content/groups/public/")
    maven("https://repo.codemc.io/repository/maven-snapshots/")
    maven("https://repo.aikar.co/content/groups/aikar/")
}

dependencies {
    paperweight.paperDevBundle(paper.versions.minecraft)

    compileOnly("org.projectlombok:lombok:1.18.32")
    annotationProcessor("org.projectlombok:lombok:1.18.32")

    api("co.aikar:acf-paper:0.5.1-SNAPSHOT")
    api(project(":core-java-library"))
    // api("net.wesjd:anvilgui:1.9.4-SNAPSHOT")
}

tasks.assemble {
    dependsOn(tasks.reobfJar)
    dependsOn(tasks.shadowJar)
}
distant mango
#

what is the error you're getting

sturdy coral
#

Hmmm. Maybe this is just a version issue. This is the exception:

Exception in thread "main" java.util.concurrent.CompletionException: java.lang.RuntimeException: error analyzing /net/wesjd/anvilgui/version/Wrapper1_20_R4$AnvilContainer.class from E:\Development\Laintania\LaintaniaCitybuild\core-paper-api\build\libs\core-paper-api-1.0.1-SNAPSHOT-dev-all.jar
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.RuntimeException: error analyzing /net/wesjd/anvilgui/version/Wrapper1_20_R4$AnvilContainer.class from E:\Development\Laintania\LaintaniaCitybuild\core-paper-api\build\libs\core-paper-api-1.0.1-SNAPSHOT-dev-all.jar
    at net.fabricmc.tinyremapper.TinyRemapper.analyze(TinyRemapper.java:573)
    at net.fabricmc.tinyremapper.TinyRemapper.access$400(TinyRemapper.java:71)
    at net.fabricmc.tinyremapper.TinyRemapper$2.visitFile(TinyRemapper.java:522)
    at net.fabricmc.tinyremapper.TinyRemapper$2.visitFile(TinyRemapper.java:518)
    at java.base/java.nio.file.Files.walkFileTree(Files.java:2811)
    at java.base/java.nio.file.Files.walkFileTree(Files.java:2882)
    at net.fabricmc.tinyremapper.TinyRemapper.readFile(TinyRemapper.java:518)
    at net.fabricmc.tinyremapper.TinyRemapper.access$200(TinyRemapper.java:71)
    at net.fabricmc.tinyremapper.TinyRemapper$1$1.get(TinyRemapper.java:490)
    at net.fabricmc.tinyremapper.TinyRemapper$1$1.get(TinyRemapper.java:486)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
    ... 3 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 65
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:199)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:180)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:166)
    at net.fabricmc.tinyremapper.TinyRemapper.analyze(TinyRemapper.java:571)
    ... 13 more
distant mango
#

use goooler's fork of shadow

sturdy coral
#

This results in a quite cryptic error:

> class io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject cannot be cast to class io.papermc.paperweight.userdev.internal.setup.UserdevSetup (io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @3eab654f; io.papermc.paperweight.userdev.internal.setup.UserdevSetup is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @1853f5c2)
#

Ah im using an outdated userdev version... why is this project so scuffed

short trench
#

a few things-

  1. My runServer task takes ages to load now, it was not this slow before. how would i fix that (tends to freeze before the reobf task)
  2. I keep getting erros with some SSL stuff, not sure why... https://pastebin.com/GZzzQ3cF
#

the SSL errors have persisted for a few weeks now, and no I don't get them if I download and run a jar manually

short trench
#

My old project from like 1.20.4 works without any issues, downloads and decompiles the jar in ~ 2 minutes without having ssl errors.. any suggestions..?

brisk belfry
#

Have you deleted your gradle caches where the downloaded files are stored locally

short trench
#

i nuked the .gradle and build files in the project and my home dir

gritty robin
#

It only happens to me if I put more than one implementation XD

gritty robin
#

any solution?

lament scarab
#

as for 2, something killed the connection

#

either mojangs services are screwing you, or, something on your machine is killing the connection

short trench
#

On the same machine

#

I had a small speculation that since the task was taking forever to load it might have somehow fucked with the GET of the keys? (longer than 30s timeout)

lament scarab
#

The process is running under other processes

#

All run-paper does is spin up a JVM process in order to start the server, it doesn't do anything magical

short trench
#

It just freezes here

#

it used to be with 1.20.4 but im not sure now

#

I set the priority of the task to "realtime" but it's still just stuck there.-.

short trench
#

I think my Intellij / Gradle are just broken..

#

3 minutes just to spawn the compile java

lament scarab
#

outside of "make sure that you're not crossing some FS boundary" type stuff, eeeer

short trench
#

FS? file systerm?

smoky violet
#

the other day I had a weird issue where ./gradlew applyPatches took 6 minutes in intellij terminal but 30 seconds in my normal terminal

#

might be that PepeLa

short trench
#

oh I should have tried that before nuking everything related to jetbrains and gradle ._.

short trench
#

anyways whatever- am i setting paperweight up correctly?

dependencies {
//    compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")
    paperweight {
        paperDevBundle("1.20.6-R0.1-SNAPSHOT")
    }
//    paperweightDevelopmentBundle("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")

    implementation("org.incendo:cloud-paper:2.0.0-beta.8")
    ...
#

I do not need the compileOnly right?

lament scarab
#

correct, api will come as a transitive to the server itself

short trench
#

unfortunately wiping everything did not help... what was that filesystem thing I could do-?

lament scarab
#

well, that's not an FS error

#

that's a network issue

short trench
#

Yeah, but the thing is it doesn't happen if I do java -jar server.jar from a jar I download from paper's website

lament scarab
#

but the thing is, that's literally all run-paper does

short trench
#

i don't know anymore 😭

lament scarab
#

run-paper has literally 0 control over your network

short trench
#

i see that's what run-paper does under the hood but its just

lament scarab
#

all it does is spin up a JVM fork process to run the server in

#

so, it's either going to be down to your machine, or some of the manner in which your server is running

#

like, only real caveat I could think of is going to be like antivirus, WSL, or things like proxy setting sorta things

#

but, I'd guess if you're in powershell, probably not using WSL

short trench
#

Yeah im not actively using WSL, and it generally wasn't an issue before this

#

it must be something fucked with my gradle installation because if normal jars work fine, this should too...

north girder
#

I was told to go here from #paper-dev when asking about this error, I'm trying to use NMS for multiple versions using multiple modules for each version. I'm on Java 21 and trying to export the code to be compatible with Java 17 (preferably Java 8 but right now I'm just trying to get 17 working), because I want people using 1.19 - 1.20.6 to be able to use the plugin without needing to change their Java version.

I've attached the first error (I'm getting the same error for the 1.19.1 and 1.19.2 modules) and the log it tells me to look at - I don't really understand any of it though. The first build.gradle.kts file I have attached is the project's one, the second is the 1.19 module's one and the third is the core (where non version dependant code is, the main part of the plugin)

Also side note but I just removed the group and version tags from the non-main build.gradle.kts files, hoping they'd default to the parent one, does that work? If not I'll change it back, but it wasn't working before I removed them either so that's not the source of the error if that is an issue.

brave widgetBOT
brave widgetBOT
brave widgetBOT
brave widgetBOT
brave widgetBOT
north girder
#

Just by trial and error the issue seems to be that Gradle 8.5 results in the 1.19, 1.19.1 and 1.19.2 NMS stuff breaking, and Gradle 8.0 seems to work fine - but IntelliJ made me update Gradle to 8.5 when I switched to Java 21, which I'm pretty sure is needed to make the 1.20.5 and 1.20.6 modules work and still export in Java 17 (unless I'm misunderstanding something?)

north girder
# north girder Just by trial and error the issue seems to be that Gradle 8.5 results in the 1.1...

When I make Gradle use Java 21, I get an error in the 1.19 module because for some reason the 1.19 NMS stuff requires Gradle 8.5 when using Java 21, but I don't get one in 1.20.5 because it apparently doesn't (I don't understand why) - and if I upgrade Gradle to 8.5 I get the error I sent above, which I don't understand

When I make Gradle use Java 19, I get an error in 1.20.5 because it requires Java 21 in order to use the 1.20.5 NMS classes, but I don't get an error in 1.19

Is there a way to make different modules use different versions of Java? Or some other fix I don't know about?

lament scarab
#

You can set the toolchain per module or task

smoky violet
#

use latest gradle & latest paperweight. java 11+ is required for the gradle runtime. also note what cat said above as well as the pinned messages

novel knoll
#

is there a way i can tell patcher to use a different tag name other than base after it's done apply paper patches / before my patches?

#

specifically i want it to not get rid of paper's base tag while still having one for before my patches

#

ah nvm it's hardcoded

smoky violet
#

wouldn't upstream/base work

novel knoll
#

doesn't seem like it does, isn't the base tag entirely local?

smoky violet
#

upstream is some Paper-Server dir on your disk in the case of patcher -Server

#

usually in ./.gradle

novel knoll
#

right

novel knoll
#

i do have upstream in the correct dir but there is no base tag in the upstream remote, there is a base tag in the local history (before my patches) and there is a base tag in the git history of where upstream is, but local doesn't have it as upstream/base

#

imma just get the hash

iron talon
#

emily is doing cursed things and I'm watching her do it

smoky violet
#

maybe need to fetch again or smth

#

idk

#

what are you doing though lol

novel knoll
iron talon
#

i told you you'd be asked that

novel knoll
#

something involving upstream/base..base

smoky violet
#

this channel is for developers needing help with their builds

novel knoll
#

it works kappa

crude kernel
#

just running publish also doesn't publish anything

#

just set up a new reposilite repo and been wanting to push my libs there

distant mango
#

you need to add the repositories to the publishing extension

crude kernel
#

oh ty

distant mango
#

try changing your java versio to 21

crude kernel
#

what's the task for publishing the dev bundle?

crude kernel
#

oh i'm blind

#

i removed that line in my build script

crude kernel
#

why am I getting this error when trying to start a ktor server within my plugin? i have another lib which uses coroutines. the error: java.lang.NoSuchMethodError: 'void kotlinx.coroutines.internal.LockFreeLinkedListHead.addLast(kotlinx.coroutines.internal.LockFreeLinkedListNode)'
my buildscript: https://pastes.dev/gTBM5dimx5

olive violet
#

moving from #paper-dev, I had 3 things to get working on gradle in my migration from maven:

  1. I was able to shade and relocate the libraries I use (adventure, fastutil, and roaringbitmap) into the output jar
  2. I was able to zip a datapack (setup as a module) and embed that in the output jar
  3. I was able to specify the LICENSE.md in the root of the project to be put into the root of the output jar

I have a working configuration for 2 & 3, but was told there's a better way to do it:

tasks.processResources {
    from(rootProject.file("LICENSE.md"))
    from(project(":movecraft-datapack").file("build/zip/movecraft-data.zip"))
    dependsOn(project(":movecraft-datapack").tasks.build)
}
#

for 1 I'm going to try either the libraries section of plugin.yml or the loader functionality of paper-plugin.yml

lament scarab
crude kernel
#

okay i'm gonna check what coroutines version ktor uses

static urchin
#

or well, depends on how your -datapack module looks

crude kernel
#

looks like it's 1.8.0

static urchin
#

maybe the output is already in a configuration

olive violet
#

here is what my datapack build looks like, I totally just AI'd this so no idea if it's good or not:

plugins {
    base
}

val zipTask = tasks.register<Zip>("zipFolder") {
    archiveFileName.set("movecraft-data.zip")
    destinationDirectory.set(file("$buildDir/zip"))

    from("src/main/resources/movecraft-data") {
        include("**/*")  // Include all files and folders within the specified folder
    }
}

tasks.build {
    dependsOn(zipTask)
}

description = "Movecraft-Datapack"
static urchin
#

Yea, that should be easily done with configurations ^

crude kernel
#

i tried adding this to every dependency that uses coroutines and add the 1.8.1 impl, but that doesn't work either. still the same erorr

    implementation("...") {
        exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-core")
    }
#

that method, does in fact, not exist

#

lovely

#

fuck this i'm using spring for this

olive violet
#

found a 4th item I need to tackle, embedding the version in the plugin.yml, this works but I'm open to recommendations:

tasks.processResources {
    [...]
    filesMatching("*.yml") {
        expand(mapOf("projectVersion" to project.version))
    }
static urchin
#

that is pretty much the go to way ^

olive violet
#

it looks like something's not being done right with my paperweight-userdev configuration here, or my understanding is off:

plugins {
    id("buildlogic.java-conventions")
    id("io.papermc.paperweight.userdev") version "1.7.1"
}

java.toolchain.languageVersion = JavaLanguageVersion.of(21)

dependencies {
    api(project(":movecraft-api"))
    paperweight.paperDevBundle("1.20.6-R0.1-SNAPSHOT")
}

description = "Movecraft-v1_20"
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
#

my assumption was that I was developing in mojang mappings, and then it runs in mojang mappings, but obviously my source code is still in spigot mappings

#

how do I make this work?

distant mango
#

set it to spigot mappings or don't set it at all

#

mojang_prod is for when your code is mojang mapped (or no nms at all)

olive violet
#

I want to convert over to mojang mappings for dev & production, and I thought I set up to do so with my build system

#

in fact I had to modify fields in my code from the obfuscated to mojang names, so I thought I was all good

#

but it looks like class references are wrong?

#

is it a matter of rewriting my code and the build will work?

#

wait a second, the error during runtime is using the spigot mapping, and my source code is using mojang mapping

#

this might be an issue with one project using the wrong output from the other

#

movecraft-v1_20-8.0.0_beta-3 has the correct mojang mappings (net.minecraft.world.level.Level), but movecraft-v1_20-8.0.0_beta-3-reobf has the incorrect spigot mappings (net.minecraft.world.level.World)

static urchin
#

Well that is kinda the point?

#

since 1.20.6 paper uses mojang mappings so you just don't run reobfJar and use the plain build jar

olive violet
#

I don't know why it's running reobfJar

static urchin
#

Something must be depending on it

olive violet
#

this is how I have the other module configured:


dependencies {
    [...]
    implementation(project(":movecraft-v1_20"))
}

tasks.shadowJar {
    manifest {
        attributes["paperweight-mappings-namespace"] = "mojang"
    }

    dependencies {
        [...]
        include(project(":movecraft-v1_20"))
    }
}```
#

Per the docs, it looks like maybe paperweight-userdev is trying to outsmart me (and succeeding):

If you have the shadow Gradle plugin applied in your build script, paperweight-userdev will detect that and use the shaded JAR as the input for the reobfJar task.

The -dev-all.jar file in build/libs is the shaded, but not re-obfuscated JAR.
Is there a way to disable this?

static urchin
#

no that should not outsmart you

#

the only thing that should changing is that the reobf jar uses shadows output instead of jars output

olive violet
#

this may have resolved my issue

tasks.reobfJar {
    enabled = false;
}
#

nope nevermind, now Movecraft-v1_20 is't in the output shadow jar at all

#

how do I change it so that this implementation(project(":movecraft-v1_20")) includes the non-reobfuscated jar?

static urchin
#

it should by default skully is this project public?

olive violet
distant mango
#

This may have something to do with inproper multi module setup?

#

try adding userdev to the root project with apply false then applying it to the su bmodules without the version

static urchin
#

I am surprised it hasn't crashed omegaroll

olive violet
#

look, I had 0 gradle knowledge when starting this process and am trying to cobble it together with what limited documentation, googling, and AI prompting I can get

olive violet
#

and how do the sub-modules know which minecraft version if I don't apply a version?

tall ice
#

Yo

#

Im getting an error with a paper fork

#

It's failed to read upstream data

balmy pier
#
tasks.withType<io.github.goooler.shadow.ShadowJar> {
    dependencies {
        include(dependency("me.slimified:slimified-api:1.0.0"))
    }
}

Why do I get this error when reloading my gradle project:
Unresolved reference: github
I have included the plugin in my gradle config as well.

fair gazelle
#

how do I disable velocity connection errors

past mortar
fair gazelle
rapid fractal
drifting torrent
#

trying to remove Feather Falling from the enchantment table in a fork

tried removing the tag from the NON_TREASURE tag though doesnt seem to work
Would this not remove it from the tag?
Wanna try without adding a datapack and just doing it in the fork if possible

#

alternatively how can i add one of the cached json files so they are "editable"
cant find the correct artifactid to use in dev-imports

granite valve
granite valve
#

So yeah, you want to dev-import the tag file, and remove it there

drifting torrent
granite valve
#

Yeah. I think remove the “data/” part of that entry

#

I think it assumes you are going into data, hence mc_data

drifting torrent
#

aha ok

#

also would this be the place to ask about specific fork related things or #paper-dev ?
having issues disabling fall-damage negation logic on stuff like windcharges and mace

granite valve
#

Well if it’s not build tooling specific for forks, I think #paper-dev is fine. If you have an issue with paperweight for forks, that’s this channel

drifting torrent
granite valve
#

oh lol @drifting torrent remove the minecraft/ too

#

just tested that and it worked for me

drifting torrent
#

yep that worked thanks hypers

distant mango
#

it's in n/m/s/world/Container.java

lament scarab
#

Because that's a class that is modified

distant mango
lament scarab
#

and that too

#

Because once agian, it is a class that we modify

#

and so it is inside of Paper-Server/src

balmy pier
#
tasks.withType<io.github.goooler.shadow.ShadowJar> {
    dependencies {
        include(dependency("me.slimified:slimified-api:1.0.0"))
    }
}

Why do I get this error when reloading my gradle project:
Unresolved reference: github
I have included the plugin in my gradle config as well.

distant mango
#

send full build script

echo kilnBOT
#

Please send large files/logs to a pastebin

lament scarab
#

they didn't relocate the packages afaik

distant mango
#

ah yes they didnt

#

only the plugin id & version changed

balmy pier
#

?

distant mango
#

also you don't need the api dependency with userdev

balmy pier
#

oh

distant mango
#

the code is still under com.johnwhatever

balmy pier
#

oh ok

#

thanks

distant mango
#

com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

balmy pier
#

is there a userdev for 1.21 btw?

distant mango
#

yes

rancid gust
brave widgetBOT
rancid gust
brave widgetBOT
rancid gust
brave widgetBOT
rancid gust
#

what could be the problem?

olive violet
distant mango
#

don't run reobfJar

#

just run build / shadowjar

olive violet
#

I'm not sure why reobfJar is being called, is there some way to debug what is happening in a gradle build?

distant mango
#

check your build script

brave widgetBOT
distant mango
#

also don't think setting multiple reobfAtifactconfiguration's will work like that?

olive violet
# brave widget

Do you know how to see what triggered a task in the build scan?

olive violet
#

it looks like for some reason :movecraft:shadowJar is triggering :movecraft-v1_20:reobfJar

#

I assume the issue is in how I am including :movecraft-v1_20 in the shadowJar, but I can't find documentation on other ways to do it:

tasks.shadowJar {
    manifest {
        attributes["paperweight-mappings-namespace"] = "mojang"
    }

    archiveBaseName.set("Movecraft")
    archiveClassifier.set("")
    archiveVersion.set("")

    dependencies {
        include(project(":movecraft-api"))
        include(project(":movecraft-v1_18"))
        include(project(":movecraft-v1_20"))
    }
}
lament scarab
#

shadowJar does not depend on reobfJar

#

rather the other way around, because libraries

olive violet
#

I am I reading this right then?

lament scarab
olive violet
#

Looking at this forum thread, I found out that adding "reobf" can force it to reobfuscate a module (runtimeOnly(project(":movecraft-v1_18", "reobf"))), but how do I do the opposite?

lament scarab
#

you need to work out what in your build is making it trigger that step

#

I cannot see your full config

lament scarab
#

what command are you running to build?

lament scarab
#

Coming back to this, it's only running reobfJar for the test task

olive violet
#

I am running ./gradlew clean shadowJar

lament scarab
#

Yea, the thing looks fine

#

paperweight is just injecting the reobfJar into the testing environment for some reason

rancid gust
tawny horizon
#

using java 21, the 1.21 dev bundle isn't working

#

1.20.6 dev bundle works fine

#

im using userdev 1.7.1

fallow garnet
tawny horizon
lament scarab
#

if it makes you feel any better

#

it works fine for me

#

my only question is what does the file it's failing to apply the hunk to look like

distant mango
#

Can't reproduce using the test-plugin

tawny horizon
distant mango
#

can you share the log file

tawny horizon
#

sure

#

hold on

lament scarab
#

or, not that?

tawny horizon
distant mango
#

empty

tawny horizon
#

oh sorry

lament scarab
#

.gradle/caches/paperweight-userdev/ff775525efc29c3503a07d1006e63e5695a742b7505cf63e157d49d32419c69f/module/io.papermc.paper/dev-bundle/1.21-R0.1-SNAPSHOT/paperweight/setupCache

#

in your user folder, go to that folder

tawny horizon
#

yeah im in that

lament scarab
#

open the decompileMinecraftServerJar.jar

#

and send net/minecraft/world/item/crafting/ShapedRecipe.java

tawny horizon
brave widgetBOT
lament scarab
#

odd

#

both are the same

tawny horizon
#

i cant see any reason why it would be failing

#

theres nothing in the error logs theres nothing at all

#

it just fails

#

im gonna try building it again on my mac and see if it makes any difference

lament scarab
#

like, I think I got the right jar

smoky violet
#

@tawny horizon you should just push what you have to a branch and let me try it locally

tawny horizon
#

sure

#

my system jdk is 21

smoky violet
#

it took a little long to clone and I was worried it was going to be an essentialsx moment, just for a second omegaroll

tawny horizon
#

its just a pretty big project and its got a fair few dependency jars thanks to people who can't use maven

smoky violet
#

(if you don't know md_5 or someone put like 20 spigot jars into it's git history so its a couple gb)

tawny horizon
#

LOL

#

im not that bad at least

smoky violet
#

yeah just clone essx and see how long it takes PepeLa

#

ah so there are some jars in there

tawny horizon
#

yes

verbal skiff
#

oh god why

tawny horizon
#

no choice

smoky violet
#

yeah those plugins are typical culprits

tawny horizon
#

its for plugin dependencies that either aren't available on a repo or their repo doesn't work

smoky violet
#

the altnerative is making up some metadata and putting them on your own repo

verbal skiff
#

self host sonatype nexus?

tawny horizon
#

tempting but i also can't really be bothered

tawny horizon
verbal skiff
smoky violet
#

you don't have to change any. just make some up

#

ie a group artifact and version

verbal skiff
#

oh they don't even have any

#

lmao

#

i see

smoky violet
#

yes a jar will probably have version at best

#

maybe maven leaves some meta in it

verbal skiff
#

i mean I would stay away from commiting binaries like the plague

#

quite wary of exploding repo sizes

smoky violet
#

yeah of course

#

so, a problem I found @tawny horizon

#

if you want to open a pw issue for me, changing the JDK doesn't seem to invalidate the decompile cache

#

I'll have a patch for you in a moment. but will need to rm -rf ~/.gradle/caches/paperweight-userdev/ before it works

tawny horizon
#

yeah i just deleted the folder again for the millionth time and it seems to be working

#

touch wood

#

i'll open an issue

smoky violet
#

hm, I thought this was going to work but it still fails

tawny horizon
#

it seems to be working but im expecting it to fail once it gets to 1.21

#

whats weird is this is at least the fifth time i've deleted the cache and each time i do it i get different results

smoky violet
#

I feel like it might be something weird with the cross-project configuration

tawny horizon
#

i wouldn't be surprised

#

but its weird that everything worked mostly fine when i added a 1.20.6 module but now i add a 1.21 module it fails

#

even though 1.20.6 was also java 21

#

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':eco-core:core-nms:v1_21:compileJava'.

Could not resolve all dependencies for configuration ':eco-core:core-nms:v1_21:compileClasspath'.
Failed to apply dev bundle patches. See the log file at 'C:\Users\Will.gradle\caches\paperweight-userdev\ff775525efc29c3503a07d1006e63e5695a742b7505cf63e157d49d32419c69f\module\io.papermc.paper\dev-bundle\1.21-R0.1-SNAPSHOT\paperweight\setupCache\patchedSourcesJar.log' for more details. Usually, the issue is with the dev bundle itself, and not the userdev project.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.

#

yep

#

as expected

#

1.21 died

smoky violet
#

I'll ping you again if I figure it out

tawny horizon
#

thanks a lot

smoky violet
#

you can try setting paperweight.experimental.genSources=false in gradle.properties for now, it’s mainly meant for ci since it degrades the ide experience a lot. but should let you compile at least

#

(on ci it’s off automatically based on the CI env var)

#

or actually I think that feature starts working with 1.18 bundles 😂 it still has to gen sources for 1.17 because it’s pre-server-bundler

#

oops

tawny horizon
#

well the 1.17 module seems to still be building

#

this time i only got a 1.21 error

#

ill give it a shot

brave widgetBOT
tawny horizon
#

1.21 still fails

#

everything else seems to work now somehow but 1.21 doesn't