#build-tooling-help
1 messages Β· Page 12 of 1
message.txt by @violet mortar: https://pastes.dev/7k92e3WfAv
i assume you already tried re running it?
will try building it myself. 1 sec
i mean yeah but its still a paperweight error from the task applying the patches
yup
builds successfully for me. is that a fresh clone?
also make sure the project is not in a onedrive synced folder (or any other syncing application)
.
one-drive might be the imposter.
But i had one on my desktop too
are you able to send your project files?
i mean i just did: git clone https://github.com/PaperMC/paperweight-test-plugin
also try running ./gradlew cleanAllPaperweightUserdevCaches
o okay!
alr lemme test on fresh clone
java.lang.UnsupportedClassVersionError: io/papermc/paperweight/userdev/PaperweightUser has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
i am 21 fym
gradle is using java 8
> Could not resolve all files for configuration ':paperweightDevelopmentBundle'.
> Cannot resolve external dependency io.papermc.paper:dev-bundle:1.21-R0.1-SNAPSHOT because no repositories are defined.
Required by:
project :
full message
thats the full msg
* What went wrong:
A problem occurred configuring root project 'paperweight-test-plugin'.
> Could not resolve all files for configuration ':paperweightDevelopmentBundle'.
> Cannot resolve external dependency io.papermc.paper:dev-bundle:1.21-R0.1-SNAPSHOT because no repositories are defined.
Required by:
project :
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
i think its still my java version lemme c
idk any more
i give up
Settings > Build, Execution, Deployment > Build Tools > Gradle
you need to set the jdk to project sdk
:O lemme try
should fix the java version error at least
if it still doesn't work you'll need to send your buildscript
message.txt by @violet mortar: https://pastes.dev/UeV6dVtwiY
message.txt by @violet mortar: https://pastes.dev/bJ2ZOdEQOQ
no, you need java 21
21? π³
still same error
welp...
the problem was
repositories {
maven("https://repo.papermc.io/repository/maven-public/")
}
i did not have that
yeah.....
i did not read docs but ig problems is fixed now
:)
idk wy the clone from github did not work
Anyone have a clue?
you update the ref and then apply patches
bonus points is apply patches, rebuild without filtering (forgot the command thingy), and then update the ref and apply patches
outside of some caveats, you generally just fall into a typical git rebase flow, in which part, we're not here to teach git
most other flows are generally a level of just gaining experience with the tooling and figuring out small tricks, i.e. not applying all the patches in one go
You have to do:
paperweight.paperDevBundle '1.21-R0.1-SNAPSHOT'
Uh yeah I'm not sure if that works on groovy
in the dependencies
it should theoretically. Just try it
Or switch to kotlin :^)
gr**vy
otherwise, you can safely get rid of the papermc maven repository, as that is included in the userdev plugin
Still erroring out
What is the error just btw?
Good ol' org.gradle.internal.operations.BuildOperationInvocationException: Failed to apply dev bundle patches. See the log file at ...
Can you send the whole thing xd?
message.txt by @faint iris: https://pastes.dev/cX1LVQSwE2
Honestly, that sounds like you need to manually clear your cache
@distant mango stop whatever you are currently doing and help this guy
you are better qualified than me
no
This is generally down to the wrong decompiler version
you'd need to ensure that you run paperweight on those projects with the expected version of java in order to appease the decompile output
(and then you'll need to manually delete the userdev folder with that busted state from the gradle home user folder)
Cool, seems like deleting everything paper related from my gradle caches folder works
Anyone able to tell what's going wrong? I can't figure out what the actual issue is
# ./gradlew applyPatches
> Configure project :
paperweight-patcher v1.7.1 (running on 'Windows 11')
> Configure project :paper
paperweight-core v1.7.1 (running on 'Windows 11')
> Task :paper:patchSpigotApi FAILED
> Task :getPaperUpstreamData FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':paper:patchSpigotApi'.
> io.papermc.paperweight.PaperweightException: Command finished with 128 exit code: git -c commit.gpgsign=false -c core.safecrlf=false fetch upstream --prune
try with -Dpaperweight.debug=true
Something like this you mean? ./gradlew -Dpaperweight.debug=true applyPatches
Alright
Yea
$ (pwd) C:\Users\vertig0\Downloads\WitherCraft\.gradle\caches\paperweight\upstreams\paper\work\Spigot\Spigot-API
$ git -c commit.gpgsign=false -c core.safecrlf=false fetch upstream --prune
fatal: '/C:/Users/vertig0/Downloads/WitherCraft/.gradle/caches/paperweight/upstreams/paper/work/Bukkit/' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Something's going wrong inside work/Bukkit apparently
I mean, yank the .gradle folder I guess
can you paste the whole output of applyPatches after yanking the .gradle folder
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
hold on
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
hm, lemme try to replicate π
the git thing there being a file is correct
but idk why it is failing
Yea, forgot that it was a submodule
It's being confusing yeah
You mean the NTFS long paths thing?
I dunno what to call it lmao, the option was Enable NTFS long paths last I remember
windows moment
https://pastebin.com/5fTb5yLv
paperDevBundle for 1.19, 1.19.1, 1.19.2 generates error
see pins
also why are you supporting those versions
doesn't make sense to support 1.19 and 1.19.1
val serverVer = "1.19"
dependencies {
paperweight.paperDevBundle("$serverVer-R0.1-SNAPSHOT")
pluginRemapper("net.fabricmc:tiny-remapper:0.10.3:fat")
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
this gives me same error. Some maps are only available on 1.19.2
cleaned cache it's now working, thanks.
lombok gives an error when compiling. Does anyone know what it could be? I added the annotation processor etc in gradle
compileOnly("org.projectlombok:lombok:1.18.34")
annotationProcessor("org.projectlombok:lombok:1.18.34") It doesn't recognize getters etc because it doesn't recognize lombok
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
provide the output of ./gradlew build
a moment
If you're using IntelliJ, make sure 'Enable annotation processing' is enabled in File | Settings | Build, Execution, Deployment | Compiler | Annotation Processors
its already enabled
i enable on everthing categories
the project isn't on github or something is it?
can you share your build.gradle.kts too
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
no
oh, did not see it there 
I've been doing this for 6 hours, man, how disgusting
Yea, suffering with compiler hacks is rough
delombok test doesn't even work and I'm not going to try the delombok
(sanity check, you did attempt to yank the .gradle folder ye?)
nope
i will try
π
then I am sadly out of ideas.
lombok not have support?
nothing that I know of
You know what's strange? Yesterday it worked!!
and I didn't even touch anything
i ll restart the pc
nothing that a good restart can't solve
NO FIX AAAAAAAAAAAAAAAAAA
FUCK U L OMBOK
where is gpt 6 at these times
fuck lombok π
how i execute delombok
What files do I need to edit to integrate bstats into my paper fork?
The metrics class
Sir this is build tool help not google
itβs actually build-tooling-help
is there a way to convert a groovy gradle file to kotlin automatically?
Copilot, lol
it's easier for me to use ChatGPT in intellij. Copilot doesn't auto modify files
How do you get chatgpt to modify files?
with the Codebuddy addon
Interesting
or plugin or however IJ calls that
you can chat with it then it analyzes the responses and auto creates a diff
and you can have different models e.g. Claude or the free chatgpr 4 omni mini
(but I wish the copilot chat could do that too :S)
Iβve used copilot to convert files to different languages, itβs generally okay
often needs to manual cleanup but does most of the tedious stuff
how do I get variables inside a buildscript block from outside it? xD
parsing dependency versions from a json file (which might be queried from an external server beforehand)
kinda wish this groovy script worked, I just want to build something xD
forgot to check channel, did you figure something out?
that does seem kinda cursed, might think of something if I see a snipit tho
you should look into external version catalogs
what you are trying to do sounds extremely cursed
I thinnnkkkk u can set the version catalog via code
but this is really cursed
is there a reason u need an external server fetch to figure out dependencies! :β)
hmm
u could generate a bom
well no thatβll only help if the dependencies stay the same and only versions change
ye idk this is cursed asf
not sure how youβd set that up to be dynamic like he wants though, unless Iβm missing something w catalogs
the version catalog as a snapshot dependency or using .+
beyond that you would need custom logic
So I've having an issue getting paperweight to work, I've added the dependency:
paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT")
and everything in my IDE works fine, but when I build to the server it keeps giving me a NoSuchMethodError:
java.lang.NoSuchMethodError: 'net.minecraft.server.level.ServerPlayer org.bukkit.craftbukkit.v1_20_R3.entity.CraftPlayer.getHandle()'
I can't figure out what is the proper way to build using paperweight, what tasks are supposed to be ran, or even what mappings Paper uses.
see this part of the example https://github.com/PaperMC/paperweight-test-plugin/blob/master/build.gradle.kts#L23
you're supposed to use the reobfJar task to build your plugin on 1.20.4 or below, adding that makes it run the task automatically when using build
I'm guessing this is due to the fact that I'm rebasing on 1.21 but the paperweight-examples repository is still on 1.20, how should I modify the Build changes patch to get it to apply?
Patch failed at 0001 Build changes
error: invalid object 100644 39303bb4e336732db0ab19dee0c1f8b609bbb134 for 'src/main/java/net/minecraft/server/MinecraftServer.java'
That's just how the libGDX pinball demo project I'm trying to build is setup π€£ (also cc @strange stirrup) I guess I could just hardcode the versions to get it built for now, stopped looking into that yesterday at some point.
https://github.com/libgdx/libgdx-demo-vector-pinball
is it this one?
That's so cursed
yeah
Just throw that shit out and hardcode the versions
They only do that so they don't have to update all examples all the time
I don't think they expect anybody to use that pattern in actual games
yeah I figured you wouldn't do it like that in a production environment xD
they did it it like 9 years ago i'll give them a pass i guess :')
https://mclo.gs/TQTroW2
no matter what I try, I can't get applyPatches to work
context?
are you just trying to build regular paper latest or old versino or have you made changes?
i'm trying to build the regular latest paper without any changes
i'm literally just cloning the repo and doing applyPatches and it gives me that error π€·ββοΈ
searched on stackoverflow but they say to do git am --abort or git am --continue or git am --skip but..
have you tried deleting the project and checking it out again yet?
yup
4 times now
even restarted the PC to make sure :))
have you tried it on linux/in WSL yet?
i tried on git client (shown above), windows power shell, windows terminal
it should have worked at least on one of those
even in IntelliJ, but it's a git terminal anyway
which git version are you using?
yeah do git --version
working for me on linux fresh clone, could try making sure you're on j21 and not 22 or something
is there a reason you want to manually build it btw?
that's 1 newer than the one mine just worked for me on Windows 10
so unlikely they broke something in a patch release lol
im on 2.45.2 but linux, would be surprised if git broke somethin tho
*than the onet aht just worked for me
yes, I want to edit it later
might want to try updating that (although I would be surprised if that has anything to do with it)
yeah idk, might have to wait for someone smarter than me
yeah, i'm reinstalling git rn
had a look thru people asking about this before and didn't see anything too notable, just people with fs issues
could just be some Windows 11 weirdness too... don't they do something special with the system partition? I remember there being some stuff with that in the past
they said they tried in powershell too
Failed patches mostly are caused by different java versions
Have you tried looking why the patch actually fails?
when I know how to do that
Yes, it's some weird bash like kinda stuff
So open the log utils file and look at the patch for the changes to the file and compare which lines look different, causing the patch to fail
You are in the wrong folder if you wanna do those commands
it's a fresh clone
Needs to be ran from the server dir
^
...
As I said, you need to look at the file it's complaining about and then at the patch and see why it's complaining, i.e. which lines don't match
I can't help you if you have no git experience
but it's an fresh git clone
there wasn't an edit at all??
why there is a file complain if it's paper's repo directly?
something most likely modified something on download/after downloading
e.g. an antivirus, firewall or even windows syncing itself
Or you decompiled with a wrong jdk, have line ending or encoding problems, etc
It's impossible to say without seeing the actual issue that git is complaining about
jdk here
have you tried WSL
yeah tbh, it should work on windows but if you're going to be actively working with the server you're going to have a way better time on wsl
patching on windows is quite slow
it's only one time
what is this one time change you want to make to paper
Um, anyone?
same issue looks like
no they're trying to make a fork
Oh yeah similar issue
Looks like it at least, the patch files need manual fixing in my case to work
but I, well, don't know how Paper fixes their patches whenever they need to rebase it on top of a newer Minecraft version
Stuff works just fine on windows
Just like you fix any other git conflict
Do you guys automatically regenerate the patch files in the process or do y'all hand edit them?
Maybe I can bug @static urchin to upgrade paperweight-examples to 1.21, heh
We hand apply the patch and rebuild it
it's done by hand, for the most part, apply, rebuild without filtering, update the ref, apply patches and merge
outside of that, it's pretty much just basic git
(though, the examples repo is so small, caring that you can get into the 3way is pointless, just update the refs, apply, and fix it manually like any other git merge)
I can later today yea
apatch go brr lol
yeah, nothing works to get it to applyPatches
updated git, updated java, disabled anti-virus..
but I've found out, after doing applyPatches and fail, the git am --abort command works
who needs patches? π€£
and to make sure it's not me, 1.20.6 works
and
without doing absolutely nothing other than passing the --scan argument, it works
π€―
I've tested again
without the --scan argument, the build fails
π€
Importing 0 classes from library sources... why?
try a shorter folder path, I guess
did that, still failed
with --scan, works
anyway, it's fixed now, i've also added zstd, so everything's good
missing library source patches is sus
but, 
I can't really diagnose what is going sideways for you
Probably some local libraries failed, and by the looks of it, the scan command uses another type of cache for libraries, but I'm not also sure myself at this point
Yeah, I don't even understand that graph
maybe build scan making the build slow fixed it, who can say
pretty sure that graph is just showing you how gradle builds work in general, and then the extra step it does to upload the data for the scan
8 cores 16 threads
oh no, I doxxed myself
xd
a build scan really ain't going to reveal much here
a patch failed to apply, the question is why
as said, one would need to look at the source file and the patch file and see why it went sideways
I would be happy to know how and where to look exactly and what to do.
maybe deleting the .m2 folder might fix it?
nothing to do with .m2
We suggested looking into this some time ago
I'm not really willing to aid with pulling it apart right now
well, i'll trying investigating myself
for now, I've found out that a java process remains open after the build fails
@lament scarabfind out why. It's an issue in gradle 8.8! I've updated to 8.9 and it works now without the --scan command
sorry for ping π
thats the gradle daemon most likely
@static urchin Thanks for upgrading to 1.21! Much appreciated :)
yes
anyway, version 8.9 fixed the issue
Since updating to Java 21 and 1.20.6 when I try to use shadowJar I keep getting Unsupported class file major version 65
does anyone know how to fix that?
Thanks
What in tarnation
> Task :WitherCraft-Server:compileJava
C:\Users\vertig0\Downloads\WitherCraft\WitherCraft-Server\src\main\java\io\papermc\paper\configuration\mapping\InnerClassFieldDiscoverer.java:17: error: '.' expected
import InstanceFactory;
^
C:\Users\vertig0\Downloads\WitherCraft\WitherCraft-Server\src\main\java\io\papermc\paper\pluginremap\InsertManifestAttribute.java:3: error: '.' expected
import ManifestEntry;
^
C:\Users\vertig0\Downloads\WitherCraft\WitherCraft-Server\src\main\java\net\minecraft\network\chat\PlayerChatMessage.java:3: error: '.' expected
import Signature;
^
C:\Users\vertig0\Downloads\WitherCraft\WitherCraft-Server\src\main\java\net\neoforged\art\internal\RenamerImpl.java:22: error: '.' expected
import SortedClassProvider;
^
4 errors
./gradlew createMojmapBundlerJar ^^^
Bruh I just wanna play Minecraft why does it have to pull this shit
erm
Hey, why could I be getting this?
plugins {
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.4-R0.1-SNAPSHOT')
compileOnly "org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT"
//compileOnly "org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT"
compileOnly fileTree(dir: '../libsAPI', include: ['*.jar'])
}
probably not using Java 21
Is there any reason why you aren't using paper dev bundle?
no, I am not sure, wasn't it just like dev-bundle?
yea but shouldn't 1.20.4 be java 17?
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT")
otherwise iirc, group and artifact id are specified as params rather than colon format iirc
isn't that for kotlin though? Because I already am able to use the 1.20.4 on another module, just on this one it doesn't let me
(both are java 17)
(just for some reason this one won't work)
Did you see this?
Hey Guys! I'm trying to run a grade build and am getting this error message:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':compileJava'.
> Could not resolve all dependencies for configuration ':compileClasspath'.
> There was a failure while executing work items
> A failure occurred while executing io.papermc.paperweight.tasks.GenerateMappings$GenerateMappingsAction
> Unable to resolve class data binding for 'jdk/jfr/Event' which is listed as the super class for 'net/minecraft/util/profiling/jfr/event/NetworkSummaryEvent'
On my first build it crashed before any error messages but since then its just thrown these errors. Anybody experienced this before or know where I could get some help? π
could you upload your build.gradle(.kts)
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
what jdk are you using
I downloaded this one: https://adoptium.net/
lastest version
does it also happen when building with terminal
i don't see any obvious issues, couple things i dont see often like where you're using the base task, setting the source set for resources manually
but that shouldn't matter
and i'd imagine this error is before any of that matters
you could try deleting the cache ~/.gradle/caches/paperweight-userdev
I've deleted my .gradle folder before running a couple times, I don't get a caches folder. Just these:
ah sorry, it's in your home folder
believe its the same in windows
so like, one folder up from where documents are your user folder
should be in there but you'll have to enable show hidden files or whatever
i also see that you're setting the jvm toolchain to 17 in kotlin, i dont think that'll overwrite java toolchain but you should change that to 21
might wanna throw in
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
}
too
Just trying it again now - caches was locked by the openjdk thingy (presumably been there since VS Code crashed on first run)
So i couldn't delete that folder
Will let you know how this build goes
Yeah thats not solved it unfortunately, same error message as before
weird, did you add the toolchain stuff i talked about? might want to try providing the string yourself for the dev bundle version incase the libs is returning somethin weiwrd
I ran it again, and its worked just fine - guess it hadnt updated based on those changes. Appears to be working now perfectly. Thankyou so much, you are an absolute champion
hey, uhhh im wondering if its at all possible to port the 1.20.5 predicate system to an older version with a plugin. i wanna know if its possible before i start the project. anyone have a clue if this is possible (or if its been done? i havent seen anything online but you never know)
what predicate system
in datapacks
i mean, maybe, whats the xy where though?
you'd probably have to fork paper and it'd be complex, not sure if everything possible in .5 datapacks would even have conversoins back to older mc
wdym?
why are yuo trying to port new datapack features to old versoins
and why not just use new versions
because of the crazy changes to datapacks in .5
my team doesnt wanna go thru changing all of the old stuff to the new stuff
ah, i misread you i thought you wanted to add support for new datapacks to old versions
and even if they did theyve been used to doing datapacks in .4 for so long and dont wanna adapt π
nono just predicates
hmmm
not sure if there'd be an easy way, would probably have to fork paper in some way add some preparsing
dont think you could do it in a plugin, would be too late in the server i thnik
mmmm
might be easier writing a tool completely detached from mc that goes thru files and replaces things
well
its not that
in .5 predicates theres an added feature
namely, the ability to compare values in storage directly
without copying the values to scoreboard
really, thats all i want
The sensible approach would be just updating your project. Using an older version has many more issues other than just missing features
hi, im using maven and trying to add NMS to my project.
i never did that before so im getting dependencies error
i will appreciate advice / tutorial / documentation on how to add NMS
build error:
The following artifacts could not be resolved: ca.bkaw:paper-nms:jar:1.20.1-SNAPSHOT (absent): Could not find artifact ca.bkaw:paper-nms:jar:1.20.1-SNAPSHOT in papermc-repo (https://repo.papermc.io/repository/maven-public/)
@verbal mirage read the docs of the project you are using but if you want help here you will need to use the official setup
if you need help with third party tools you will need to use their support places
π π thank you, i founded some documentations and was able to add NMS.
another question is how can i use the net.minecraft classes?π
i mean you can just use them by well.. using them. you can get alot of the nms objects by looking for getHandle methods on the implementations of the api
ohh my imports just have different namesπ€¦ββοΈ
import net.minecraft.core.BlockPosition -> import net.minecraft.core.BlockPos
BlockPosition is a spigot name, while BlockPos is a mojang name, you can use https://mappings.dev to translate them ^^
Hello, I'm from the Netherlands and I noticed it would take ages to build.
I tried to load in my browser:
https://repo.papermc.io/repository/maven-public/
It gives me connection timeouts.
server down
oh it is?
yeah
hmm it's been 2 days, (at least in the intervals I've tried.)
Does this mean there is not much I can do than wait?
aah
2 days?
can u send a screenshot of the error?
well it's definitely not working right now, the infrastructure is having some problems
well I might have spam attempted and it will be a heck of a search to get that error back
but yeh previously it worked just fine, I will just wait till it's fixed and by then if it is still somehow broken for me I'll be back :o
yap
@pearl fog fyi the repository seems to be back online
thank you so muchπ π π π π
thank for reminder <3
noproblem
π«‘
is there a way to make my plugin refer to the spigot mapping instead of the minecraft ones?
i heave been pointed out that i can rename all spigot to minecraft with https://mappings.dev/
but my plugin already uses the spigot classes and methods so renaming the entire plugin might be less efficient then just making it referring to the spigot mappingsπ€
We don't support that
set the mappings thing to spigot ?
There are libraries you can use to automatically rename everything tho
But all paper tooling uses Mojang mappings and it's what we recommend everybody to migrate to
I think the source code renaming lib was cadix mercury
Or cadix atlas
One of those
thank youπ i will try, i know the minecraft ones are more recommended and readable its just that my plugin already uses the spigot ones
(there's an example here https://github.com/PaperMC/paperweight-test-plugin/tree/source-remap)
π π π
It's Mercury
Or if you're insane enough you can use my paperweight fork, which supports remapping your Minecraft server (and possibly plugins) to use any mapping set you desire it to use ;)
Wait nevermind I just remembered I forgot to push the branch for custom mappings to GitHub
why does hotswap really not want to work with paper
i install the jbr and put hotswap into it and tried running devBundleServer with it but
i get about 10 no such class exceptions coming FROM the hotswap agent
alright apparently when you use fatjar it doesnt work,
but only using core seems to work?
I'd guess the classpath injection failed? 
could it be that the paperDevBundle for 1.21 is broken?
https://pastes.dev/m2Gm8nICyW <- Error
The mentioned log only contains DEBUGS for the patching
https://pastes.dev/mhwa9hAHqS <- build file
https://pastes.dev/5PlwhKI6N9 there is exactly one warn at the Shapeless Recipe
Okay, after professional error search (delete all gradle caches i could find on my computer and restarting the pc twice, after the second restart it worked) I Have no clue how a second restart with no file change did something but im happy it works now
generally down to having decompiled with the wrong java version
Could be, but the build file did not change the whole time
Please also say some information to it π
I am trying to run
./gradlew applyPatcheson the paper project, but I am getting this error. Can somebody help me figure it out?
π
sorry
lmao
i changed mcversion but not paperRef
could that be why?
mcversion is 1.20.6
Btw could you try running ./gradlw applyPatches --scan?
Well
changing the mc ver and not the paper ref is generally a bad idea
unless you're on the same mc build
but, the patch failed
π
but, that is a valid ref, so, not sure
yeet the folder and try again, make sure that you cloned with git, etc
im using 20f51650a9648c78e608d4d80f0e89dba24ac799 now
newest 1.20.6 comment
same error
using --scan tag now
it broke
π¦
uploading scan after i activate it
it went farther this time but still failed
almost a whole hour wasted
im demolishing a bathroom
got damn
so its ok
lmao
hmmm
yeah, i saw that
bro I have no idea what it is failing at for you π
for now ima just run it again
You are using some downpathed version or something, right?
Could you try to clean clone the PaperMC/Paper repo and try with that?
With 1.21?
Well, you should update anyways
π
Yeah, but it is always better to stay up to date anyways
Mainly with in-development projects
Maybe it just magically fixes your issue 
π¦
i dont want 1.21 cause
the new items are ass for my server idea
could my custom fork remove them from the server?
Not 'remove', but you could block/replace them, I suppose?
But I see no reason in that tbh
same error again
not last error
the error i was getting at the start
going to try default config with 1.21
yeah same failed clone task
is there another way to fork paper?
Use the Folia way as I have told you a few times already

What no
That is absolutely not what I meant
If I have understood it correctly myself (Please tell me if I am wrong lynxplay), Folia takes the already patched paper.jar, and patches that again with its own patches. This should suffice for your usecase. You just need to look at how they have achieved that. No need to actually use Folia
folia is based on paperweight-examples
thats what im using
thats what im having build errors with
look at the folder name on my logs
I though you were trying to modify PaperMC/Paper itself?
well then I am completely out of ideas
not anymore someone pointed to paperweight examples
my gradle version is newer
ill try to change my gradle wrapper to the correct version
or whatever its called
downgrading to gradle 8.7
oh wait nvm, i was alr on that version i think
i disabled gatekeeper
the -128 error code is common with random java files trying to execute
lets hope
yeah nvm π
final idea before i switch to something else and mess around with it, a vpn
my isp likes blocking stuff
yesterday it refused to connect to roblox and download the installer without a vpn
its actually doing stuff now π
i can see the files being downloaded in the .gradle/caches folder
exit code 1 now
attempting this fix
attempting to just use githubs build system
it just works π
but when i try to compile locally its just a stupid error π¦
whatever, atleast i got it to work
is it worth it to switch from ant to maven?
seems to be working on my home wifi but not at my second house
just as i say that
> java.util.zip.ZipException: zip END header not found```
another weird error
yes but I would recommend gradle
I wonβt lie, I havenβt seen someone use ant in about 8 years
its an old project
im trying to revive it :p
you got any good tutorials for gradle?
its not that bad
unless your project uses a lot of build code then you shouldnt have to learn koltin either
the basics for it are pretty easy
you dont need to know kotlin
its not actual code
ugh
im forced to use a vpn cause my ip has issues with some major services
yes
that means i have the worst download speed ever
no do kotlin
groovy is also "a programming language"
but groovy is much older and using it is horrible compared to gradle kotlin
just call it like it is, a scripting language
alr nvm then
so im having issue
refusing to clone paper from the paperweight-examples
should i try building from paper itself?
should I spent the extra time learning kotlin?
isnt groovy and koltin the same?
on intellij idea it is
legit getting 15 kb/s from github withoutt a vpn...
what the hell π¦
wat
my isp is messing with speeds i think
downloads are goofy slow
yeah straight up 400kb/s from the vpn
nah, its literally like
plugins {
id("java")
}
dependencies {
compileOnly("paperactualpackage:1.21etc")
}
π
i am yet to find a good repo for minimal gradle
its not no
and its not on intellij either ..
minimal repo using kotlin or groovy?
my ant project is pretty big 
kotlin
if you can think of any
all my projects and org projects are 20 file build logic folder stuff
define minimal
paper? paperweight-example?
thats a good point actually
paperweight userdev test would be good
ignore the userdev parts
just like yknow, not using build-logic or crazy plugins
is that a good point of referrence?
if you don't care about spigot support, yeah
well
yeah it's pretty minimal
the notes in the README of that repo breaks it down pretty well
well that's me out of the question
:p
https://github.com/ryderbelserion/PluginTemplate/blob/main/build.gradle.kts I actually have this though, I forgot
it's just one build.gradle.kts file, no buildsrc, no build-logic
i busted out my windows mini pc cause i cant use my desktop, ill try to compile on here
i keep getting an error while cloning caftbukkit
what error
let me send scan
oh my windows pc doesnt have scan
> io.papermc.paperweight.PaperweightException: Command finished with 128 exit code: git -c commit.gpgsign=false -c core.safecrlf=false clone --no-hardlinks C:\Users\PeakB\source\repos\
iiModManager\paperweight-examples\.gradle\caches\paperweight\upstreams\paper\work\CraftBukkit C:\Users\PeakB\source\repos\iiModManager\paperweight-examples\.gradle\caches\paperweight\upstreams\paper\.gradle\caches\paperweight\taskCache\patchCraftBukkit.repo
i did have scans i just forgot to type yes
I just found out that, at least in Paper forks, includeMappings is still run for createMojmapBundlerJar jars
This doesn't seem correct?
This ends up resulting in reobf mappings being stored inside of Mojang Mapped server jars
Which, as this comment in PacketClassSerializer seems to suggest, is wrong:
@Nullable String mojName = ObfHelper.INSTANCE.mappingsByMojangName() == null || !MappingEnvironment.reobf() ? name : PacketClassSerializer.MOJANG_TO_OBF.inverse().get(name); // if the mappings are null, running on moj-mapped server
I guess this happens to work thanks to that !MappingEnvironment.reobf() call next to the == null call saving the day, but this still doesn't smell right to me
we need to include a mapping file for the remapper, etc
I see
That would make the ObfHelper.INSTANCE.mappingsByMojangName() == null useless though, no?
Actually, on second thought, my fork does need that check, nevermind
it is also used in runDev env iirc, runDev does not create mappings
I mean, that's just a util thingy for the packet config stuff
the remapper sits elsewhere
Alright, thanks
Neither does my fork, please don't remove that code and forget that I ever said that :P
going to post this here for anyone else that has issues like i had
if your git is closing with exit code 1 you likely timed out or your isp is messing with your connection, use a vpn
if your git has error 128 you likely forgot to enable long path names and restart your computer (windows)
i also had error 128 on macos but never really figured it out
how do you handle global files in gradle?
(im running a multi project and I have a Config class that is used globally)
a common project
and I just use include in all the other instances?
yes
because the config uses classes from the other projects and the projects use the config as well
I didnt think it would be a good idea to add everything as a dependency to everything :p
Well
if you're using a modular design you should cater for that design and not have an object that depends on 20 other modules
you'd need to bust that so you can isolate the config object
so, your recommendation is to rework my config class?
if you're upset about it's module requirements, yes
im not sure what the best practice is hence why I asked, I just imagined that having everything be dependent on everything else is a bad design choice
Well, yea, but having a common sorta like, core "I generally expect this class to be available in a fairly wide scope" is generally to toss it in a submodule that everything that needs it depends on
is this a private project beer?
yes sir
you don't have to make every module depend on it, just the ones that need it
ok beer lock in
but, if you have such a dependency thing, might make more sense to just flat pack it rather than dealing with module deps
im ngl, using gradle build-logic in your first time using gradle feels like hell
well, there is auth, game and common. common has the Config class which has access to instances from game and auth, but auth and game also use config
but there's really nice ways to do multimodule stuff
so, reworking the config is the best option?
I don't have any real functional advice for this as I can't see everything
but, this smells like a design issue around how modules work
ignore what i said
i just woke up and i thought it was sharing build logic cuz we're in the build channel
π
well, reworking config sounds like the best option especially because it uses ini files π
wat
bunch of different ways to do it, easiest and clearest is probably having a common config, game config and an auth config
common shouldn't know that auth and game exist
i'm seeing this quite often:
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
which seems kinda unnecessary? (and wrong) is there any advantage to doing this?
why not just set the toolchain version regardless of what version is installed
or am I missing something
from the mc dev plugin
okay, but is there a reason for it?
or is it just some mistake that is carried over from those templates
i mean, at least when publishing, you have to watch out that you don't publish with a too recent java version
for example, if you publish with java 22 installed, you should still mark the binaries as java 21 compatible
mc dev also specifies release and source to the java version too
but yes i would personally just set the toolchain version regardless and nothing else
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
this is the whole block I believe
I think that there has been some changes over the behavior which has caused some general "fun"
especially if you have the foojay thingy it will pull in that version of that JDK that is set, which, you might not always specifically need
it's just meant to cause as little friction as possible buttt yea
i kinda wanna make a template idk if i can do it as like an addon for mcdev
why set target and source compat, setting up toolchain version will do it for you
no it wonβt?
source and target compatibility are basically deprecated anyway
you should just use toolchains and the release flag
it's funny, I remember reading this medium article long ago and took it as the truth for the longest time
now that I look at it again, they might just have misinterpreted this line from the documentation:
Using Java toolchains is a preferred way to target a language version.
A toolchain uniformly handles compilation, execution and Javadoc generation, and it can be configured on the project level.
the big thing is that it lets you specify a version of the JDK that will be universally used across your project, modules, etc
you can even tighten it down to running with certain variants of the JDK, for ex
i'm having trouble running applyPatches in my cloned paper repo https://pastes.dev/GqibTSPfja
spigotDecompileJar.log doesn't appear to be useful but just in case, here it is https://pastes.dev/FDNuv7rNXF
137 would imply you ran out of memory
π maybe not, I think we request up to 4GB of memory for that process + the memory gradle needs
gave it a little more memory and it worked fine. should have just googled error code 137. my bad π
Glad ya got it working π«‘
hi guys
stuck with this problem:
Failed to apply dev bundle patches. See the log file at '/home/neon/.gradle/caches/paperweight-userdev/af7c7f36899cbf40396ed0591c7fc79813433d06e2734dd7ebe8c612fcab57bc/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.
Failed to apply dev bundle patches. See the log file at '/home/neon/.gradle/caches/paperweight-userdev/af7c7f36899cbf40396ed0591c7fc79813433d06e2734dd7ebe8c612fcab57bc/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.
Operation has non zero exit code: 1
whats wrong?
patchedSourcesJar.log by @nova marsh: https://pastes.dev/7OfJpqxnpU
eh, usually means you decompiled with a wrong java version
idk the kotlin plugin well enough to tell you if that also configures the base toolchain to java 21
to which version should i switch? In docs is used java v21 for that code
yea java 21 is correct, I am saying idk if that config does actually configure paperweight to use java 21
omg, how fucking damn, but the problem was gradle version :/
just updated and all works fine
why cant i runDevServer? i get this error everytime. Is there a way to manually specify the spark version?
I mean that's a 404, which means that file/URL doesn't exist.
yes, i go to jenkins and its not there
build 416 specifically is not
i can see more recent ones like 436 though
I think I'm confused about what you're asking then.
oh you know what
my fault entirely, the build expired and i had an old runserver line that got undone i guess
from before spark getting built with paper i guess
How can I build the auth project while having it depend on common?
by running build
I did, I cant run the produced jar though
it gives me this structure
but that jar is not runnable
you need the application plugin
whatβs the design here
common is sort of a lib
auth and game are 2 different servers
this is what my project is looking like
in what way isnβt it runnable
Iβm assuming your build logic plugin applies the application plugin
and is that the auth modules build.gradle.kts
yeah, if you choose a multi project
ahh right um
1sec
run ./gradlew.bat :auth:run
does that work?
just as a debug step obviously you want the jar working too
should i cd into the auth directory or the base directory?
base directory
does that run the jar?
should do
cause my jar accesses some files that are supposed to be in the same directory but are not because in the source, there is a resources folder
does it attempt to run at least
yeah
thatβs good
I think thereβs a weird thing where the applicatiok plugin doesnβt actually make a runnable jar
should I attempt to make a custom task?
itβs ugly but try adding
tasks.withType<Jar> {
manifest {
attributes["Main-Class"] = "your.class"
}
}
Well, the thing needs to know where the entry point is
there might be a better way but I havenβt made many standalone things in gradle
they do no?
probably how the things being consumed then
I think if you're using the shadow plugin you might need to tell it to merge files for it to be happy or something
not 100%, am dizzy
application plugin just doesnβt set manifest by default
could it be that common has libraries that arent specified in auth?
it just helps with gradlew run
do I need a plugin for that?
itβs just called shadow but
if youβre on new Java versions
very new
Youβll need a fork goooler shadow
im on jdk 21
this seemed to not upset the IDE
nvm
it didnt
:/
welp, too much for today, im going to go to sleep and forget about all this π
hey, anyone know why paperweight doesnt like this dependency configuration? was working a little bit ago
i get this error
although for some reason it has never been correctly highlighted, but did build and compile
.kts ?
groovy
where can i find that? paper github?
yes
oh, thought we'd have a link to the repo in there at least
groovy is kiiinda dead
should i switch everything over? id hate to but i guess i already use kotlin in the actual project π€£
it was working like two seconds ago
hmmm, no idea
clear caches?
I honestly have no idea and my heads kinda spinning
java 21, latest paperweight?
i dont really remember how groovy works tbh
you can paste the whole build fil etho
paste mine here?
groovy is extremely similar
instead of callThis(value) its literally callThis value
there's a lot of differences
i mean for that part specifically, but i dont know plugin development
the reobj artifact static field is completely unusableon groovy
you have to use some weird getter it generates
mmmmm
but yeah your build.gradle
try setting the toolchain in java too
toolchain.languageVersion = JavaLanguageVersion.of(21)
inside the java {}
nope, same error
is this a multi module project?
are you applying paperweight in two diffeernt places?
because your root project does not initiate the plugin where it also declares a version
yeah tbh this is really hard for us to debug
if the plugin is public source, i'd be willing to look
i mean the source code is pretty irrelevant to this issue lol. It is not fully open source, but id be willing to send over the source code if you pinky promise not to give it to other people
yeah, you could even just send the build files tbh
Yea, I clicked on, one of those days \o/
yeah of course no worries π
so that paste is the plugin build file, ill send the root build, client mod editor project build file, and the common build file for things shared between both
yeah that would be great because I use kotlin in the actual project anyway but i switch early on so its not kotlin yet LOL
yeah ill do that
have the whole thing
ping me when
@strange stirrup sent
looking now
thanks man!
I'm struggling to get Paperweight 1.7.1 for MC 1.21 and Adoptium OpenJDK 21.0.4.7 to work. Apparently a single patch is failing to match in patchedSourcesJar.log, and I've tried deleting and regenerating the paperweight cache to no success. Any idea what I am missing?
[DEBUG] Patching: net/minecraft/world/item/crafting/ShapelessRecipe.java
[DEBUG] Hunk 0: EXACT: @@ -4,14 +4,23 @@
[DEBUG] Hunk 1: EXACT: @@ -22,7 +31,24 @@
[WARN] Hunk 2: FAILURE: @@ -49,18 +75,21 @@
[DEBUG] Hunk 3: EXACT: @@ -71,62 +100,68 @@
this worked for me: #build-tooling-help message
Restarting my PC twice..? Really? I already tried deleting the Gradle paperweight cache
did you delete the gradle caches too (not the one in the project, the general one)?
You can probably also look for only the paperweight entry in there
I only did that part, not the restarting lol. But same error with the same shapeless recipe class, and it worked afterwards
Okay, I was el stupido, I forgot about the java version specified in the build.gradle file - it was still set to Java 17 π
@nova marsh what gradle version did you use to fix that issue yesterday
ty
getting this error trying to import multiverse core
this is what I have, I have no idea why it's saying htat
if I remove the repo, then it says not found, so I know it's finding it, but just don't know why that error appears
Hey, this isn't really paper-related but I've been getting issues with compiling kotlin in a project: https://pastes.dev/lLRuzxgWcz | The build script: https://pastes.dev/otxPJlb3w8
Tried using the run task and just running the main function in IJ, exact same result
try in terminal
There shouldn't be any kotlin errors
./gradlew build
That's what i did
hmm
cant really tell where its getting to
remove the archivesName and the import tho
i've never seen anyone do it like that
same error
not sure then, update kotlin to the latest non-2.0 version and update gradle ig
Am on gradle 8.9, I can try updating Kotlin to 2.0.0
would probably be worse :p
Looks like it's fixed it