#build-tooling-help

1 messages · Page 16 of 1

charred pewter
#

Do you recall the name of it?

charred minnow
charred pewter
#

Ahh awesome. I'll test it out, thanks!

torn sonnet
#

"Nobody suggests you use this" - "okay I'll use it!"

charred pewter
# torn sonnet "Nobody suggests you use this" - "okay I'll use it!"

I don't see the issue, I haven't asked for support regarding setting up the build, how to use it etc. I've only asked what sort of possibilities there would be in my use-case. I don't get the hostility towards wanting to use Maven? It's not like I've criticized, how the developers haven't made NMS compatible with (Paper+Maven)? I understand that there might be certain benefits to using Gradle and Paper, and that it's the "supported way", but I was simply asking if there were any alternatives where I wouldn't be depending on having to use Gradle.

torn sonnet
#

I'm just an old grump, sorry.

charred pewter
opal hatch
#

Hello guys, i want to fork a papermc fork. For this i use useStandardUpstream with withStandardPatcher. But for some reason i run into this problem while executing applyPatches:
(> Task :cloneFirstForkServerRepo FAILED)
io.papermc.paperweight.PaperweightException: Command finished with 128 exit code: git -c commit.gpgsign=false -c core.safecrlf=false submodule update --init --recursive

I am not really sure what went wrong here. Does some documention/guilds exist for the case for a fork of a fork of papermc?

For the background information, with mc version 1.20 it worked, then i successfully updated the fork to 1.21.
Now i have to update the fork of the fork where i run into this issue.
Maybe someone could tell me what goes wrong here.

zenith flower
#

try running with -Dpaperweight.debug=true

#

it should show more of the error message

#

and could you show your gradle buildscript?

opal hatch
#

Sure
With debug:
del

gradle.build.kts:
del

#

I messed it up. I updatet the pastebin links.

It look like i have some problems with this:
$ (pwd) C:\Users\Fabian\IdeaProjects\SecondFork.gradle\caches\paperweight\upstreams\FirstFork
$ git -c commit.gpgsign=false -c core.safecrlf=false submodule update --init --recursive
fatal: No url found for submodule path 'paper-api-generator/generated' in .gitmodules

Can someone tell me what this is?

opal hatch
#

Thanks to Noah . The debug thing helped me a lot. I have now managed to solve it. The first fork did not create a 'paper-api-generator'. I have now specified the url and ref of paper there. That made it work.

pallid elbow
#

What just changed...? ```Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':compileClasspath'.
Could not resolve org.apache.logging.log4j:log4j-bom:{strictly 2.22.1}.
Required by:
root project : > com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT:20240916.181108-14
root project : > com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT:20240916.181108-14 > com.sk89q.worldguard:worldguard-core:7.1.0-SNAPSHOT:20240916.181108-14
Cannot find a version of 'org.apache.logging.log4j:log4j-bom' that satisfies the version constraints:
Dependency path 'com.n9works.bukkit:TheArtifact:4.6' --> 'com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT' (apiElements) --> 'org.apache.logging.log4j:log4j-bom:{strictly 2.22.1}' because of the following reason: Mojang provides Log4j
Dependency path 'com.n9works.bukkit:TheArtifact:4.6' --> 'com.sk89q.worldedit:worldedit-bukkit:7.4.0-SNAPSHOT' (apiElements) --> 'org.apache.logging.log4j:log4j-bom:{strictly 2.24.1}' because of the following reason: Mojang provides Log4j
Dependency path 'com.n9works.bukkit:TheArtifact:4.6' --> 'com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT' (apiElements) --> 'com.sk89q.worldguard:worldguard-core:7.1.0-SNAPSHOT' (apiElements) --> 'org.apache.logging.log4j:log4j-bom:{strictly 2.22.1}' because of the following reason: Mojang provides Log4j
Dependency path 'com.n9works.bukkit:TheArtifact:4.6' --> 'com.sk89q.worldedit:worldedit-bukkit:7.4.0-SNAPSHOT' (apiElements) --> 'com.sk89q.worldedit:worldedit-core:7.4.0-SNAPSHOT' (apiElements) --> 'org.apache.logging.log4j:log4j-bom:{strictly 2.24.1}' because of the following reason: Mojang provides Log4j

quaint raven
pallid elbow
#

I suppose paper's log4j is just too old

pallid elbow
quaint raven
#

WE received an update

pallid elbow
#

Also WG API doesn't do stable releases

quaint raven
#

It does.

pallid elbow
#

There is no 7.1.0 stable version

quaint raven
#

The api has the same versions as the plugin

#

7.1.0 is not released

#

Use 7.0.x

pallid elbow
#

I think you're misunderstanding the plugin vs the api

quaint raven
#

I don't. I'm a developer from WorldGuard

distant mango
#

i think the person in top 3 of contributions to WG knows what they're talking about lol

pallid elbow
#

Well, balls

#

What changed today though?

#

I have been using 7.1.0-SNAPSHOT for months

quaint raven
#

The unstable version from WorldEdit (7.4.0-SNAPSHOT) updated dependencies

#

That's why you should use the release versions because they don't change their dependencies

pallid elbow
#

Guess i'm thrown off by my error mentioning worldguard

#

Dropped to 7.3.9 WE and that worked, thanks

lament scarab
void hill
#

Hey, been messing with a multi module project... and I can't get it to work lmao. and now somehow my core module was seperated from everything else?

#

include 'core', 'api', 'nms-wrapper', 'nms-1_21_R1', 'nms-1_21_R2', 'nms-1_21_R3'```
brisk belfry
#

i mean it has a settings.gradle. I dont think it needs one. as well as gradle, gradle.properties, gradlew and gradslew.bat

crude kernel
#

usually fixes that bullshittery

open latch
#

Hi.. i hate me and try to move to gradle for a few tests... but not sure why i just fail in build for a issue in import org.apache.commons.io.FileUtils;

glass sable
#

you didn't add apache commons?

open latch
glass sable
#

pretty sure there was a thing about that no longer being exposed by the server api

open latch
glass sable
#

yeah, the pom no longer includes apache commons

open latch
glass sable
#

I'm unsure what you are asking, sorry

distant mango
#

in older versions certain libraries were exposed in the api artifact, as of recently(?) they are not anymore iirc

open latch
glass sable
#

most likely you had some outdated pom cached in maven

open latch
glass sable
#

github has a cache as well iirc

open latch
hollow nimbus
#

I'm 5 months late to this but thank you

open latch
distant mango
#

update shadow to gradleup/shadow

#

probably use 8.3.5 for now dunno how stable the beta's are

open latch
open latch
#

ok.. now i move all versions to more "order" and build.. but when run i just get a error for the reflection dependency...

[15:33:46 INFO]: [ConterCraftLogger] [CustomEnchantmentBoostrap] Loading Custom Enchantment Boostrap...
[15:33:46 ERROR]: [BootstrapProviderStorage] Failed to run bootstrapper for plugins/ConterCraft.jar. This plugin will not be loaded.
java.lang.NoClassDefFoundError: org/reflections/Reflections
        at ConterCraft.jar/me.mrdoc.minecraft.utils.ReflectionUtils.getClasses(ReflectionUtils.java:39) ~[ConterCraft.jar:?]
        at ConterCraft.jar/me.mrdoc.minecraft.custom.enchantment.CustomEnchantmentManager.loadAllCustomEnchantments(CustomEnchantmentManager.java:34) ~[ConterCraft.jar:?]
        at ConterCraft.jar/me.mrdoc.minecraft.custom.enchantment.CustomEnchantmentBoostrap.bootstrap(CustomEnchantmentBoostrap.java:13) ~[ConterCraft.jar:?]
        at ConterCraft.jar/me.mrdoc.minecraft.contercraft.CoreBootstrap.bootstrap(CoreBootstrap.java:19) ~[ConterCraft.jar:?]
        at io.papermc.paper.plugin.storage.BootstrapProviderStorage$1.load(BootstrapProviderStorage.java:36) ~[paper-1.21.4.jar:1.21.4-14-b746d9d]
        at io.papermc.paper.plugin.storage.BootstrapProviderStorage$1.load(BootstrapProviderStorage.java:24) ~[paper-1.21.4.jar:1.21.4-14-b746d9d]
        at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:117) ~[paper-1.21.4.jar:1.21.4-14-b746d9d]
        at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.4.jar:1.21.4-14-b746d9d]
        at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.4.jar:1.21.4-14-b746d9d]
        at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enterBootstrappers(LaunchEntryPointHandler.java:30) ~[paper-1.21.4.jar:1.21.4-14-b746d9d]
        at net.minecraft.server.Bootstrap.bootStrap(Bootstrap.java:69) ~[paper-1.21.4.jar:1.21.4-14-b746d9d]
        at net.minecraft.server.Main.main(Main.java:126) ~[paper-1.21.4.jar:1.21.4-14-b746d9d]
        at io.papermc.paper.PaperBootstrap.boot(PaperBootstrap.java:21) ~[paper-1.21.4.jar:1.21.4-14-b746d9d]
        at org.bukkit.craftbukkit.Main.main(Main.java:281) ~[paper-1.21.4.jar:1.21.4-14-b746d9d]
        at io.papermc.paperclip.Paperclip.lambda$main$0(Paperclip.java:42) ~[app:?]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.ClassNotFoundException: org.reflections.Reflections
        at io.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader.loadClass(PaperPluginClassLoader.java:146) ~[paper-1.21.4.jar:1.21.4-14-b746d9d]
        at io.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader.loadClass(PaperPluginClassLoader.java:107) ~[paper-1.21.4.jar:1.21.4-14-b746d9d]
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
        ... 16 more
lament scarab
#

you want the shadowJar task and its output

#

renaming files as part of the build is also asking for issues

open latch
void hill
#

Hey, so trying to compile the entire project in my core module in the project so I tried to do this in the other modules

tasks.jar {
    enabled = false
}``` and in the core do
```java
    from(project(':api').sourceSets.main.output)
``` but it breaks the project and doesn't let me compile. What is the correct way to compile everything in the core module?
lament scarab
#

you just shade everything

#

rather than trying to mangle source sets

#

idk what that output stuff is though

smoky violet
#

For anyone feeling adventurous you can try paperweight-userdev 2.0.0-beta.1 now, it supports config cache for all supported dev bundles

#

One small difference is you may need to click "Attach sources" when viewing a minecraft/paper-server class for the sources to... attach

turbid moon
static urchin
#

5head move that the version fetcher is recommending beta builds

#

(that should be fixed if possible)

turbid moon
#

I might look into that though

static urchin
#

Would be great

turbid moon
#

With "might" I mean right now lol

#

Got nothing better to do

distant mango
#

the beta build should probably be marked as a pre release then?

#

then you’d just be able to check if it’s an actual release or pre

#

@ jmp

turbid moon
#

Yeah would be useful for sure

#

My current idea is to just check whether the version contains "BETA", but that is obviously not a sustainable solution

#

Well, it's a quick-fix alright

turbid moon
hardy tendon
smoky violet
#

it's not duplicated

#

that is the class file and the source file

#

in v1 a fake ivy repository was created with separate source and class jars during a dependency resolution hook

#

in v2 a task produces a jar, however this doesn't have a way of attaching sources normally

#

but you can merge the sources and classes into the same jar and intellij will recognize it and index properly

sterile topaz
#

(I tried updating paperweight and it didn't change anything)

smoky violet
#

share the log file it points you to on a paste site

#

most likely you need to configure java toolchains with java 21

sterile topaz
#

the error is consistently on the same class

#

line 3908

#

it's literally the only error

hybrid star
# sterile topaz

Just in case you didn't, change the java version of your project to java 21

#

You might be using java 17

sterile topaz
#

since a co-dev told me it fixed it for them when something similar happened (not actually sure if it was the same issue)

#

but didn't work for me

#

a quick ctrl + F shows I'm not using java 17 anywhere in any of my scripts

lament scarab
#

make sure that you're using the latest version of paperweight

#

make sure that you have 21 set for the toolchain, not 22, not 23, etc

sterile topaz
#

I have paperweight on 1.7.7

sterile topaz
lament scarab
#

That error is generally because a different version of java was used which caused the decompiler to produce different output

sterile topaz
#

gotcha

austere bronze
#

Why every item explodes? (only tnt should explode)

sterile topaz
#

so is literally just that one file using v21 exclusive code lol

lament scarab
#

Nah, it's just oddball decompiler quirks

sterile topaz
#

(though at a glance, not sure)

lament scarab
#

probs want to do a clean build or something, all I can guess is that you're running a jar from before you added that check

austere bronze
#

:)

#

That fixed so many things lol

cold sparrow
brisk belfry
#

whats the goal?

#

if you want to move the file to your plugins folder use a copy task

cold sparrow
brisk belfry
#
tasks.register("copy", Copy) {
    mustRunAfter(build)
    from("build/libs/Plugin.jar")
    into("destination/plugin/dir")
}
cold sparrow
#

ooo nice and can i rename it when copying?

brisk belfry
#

why do you need to rename it?

cold sparrow
#

cause i like renaming things, can I?

smoky violet
#

using mustRunAfter not always but very often means something is wrong

brisk belfry
#

yeah idk it was the only fix and i cba to look for other solutions

smoky violet
#

in this case you are using a raw file path as an input instead of using the output from the jar task, which forces you to declare explicit dependencies

cold sparrow
#

also should there be something instead of copy?

cold sparrow
smoky violet
#

... what?

#

changing jar names away from the conventions is not something I recommend

cold sparrow
#

i mean just a different folder

smoky violet
#

switch 'jar names' for 'jar file paths' and it's still a true sentence

cold sparrow
#

cring

bronze ember
#

Why do you need to do that?

#

Only reason I can think of is running a test server, and there are better options for that, ie the Gradle plugin

granite valve
#

or symlinks

magic hearth
#

how do I use xyz.jpenilla.run-paper to run a folia server?

distant mango
#

see its docs

magic hearth
#

I did but I dont understand it

magic hearth
#

it says to use runPaper.folia.registerTask()

#

but where do I use it?

smoky violet
#

... in your build script?

#

keep in mind it can only resolve folia versions that have been merged to the master branch

magic hearth
#

oh

#

thanks

#

I am blind

#

sorry

#

so folia does not support 1.21.3?

lament scarab
#

1.21.x is on a seperate branch

main mica
#

pretty sure 1.21.3 specifically was never released

magic hearth
#

ok thanks for the help

charred pewter
#

Not sure if this is the right channel, BUT how would I make gradle output the plugin jar to a specific folder? More specifially I want gradle to output to my plugins folder whenever I build.

smoky violet
charred pewter
#

Awesome, but how do I get my plugin into the plugins folder in my intellij project?

#

Nevermind

#

It did

#

But, how can I make it show the jar files

charred pewter
#

Nevermind again

cold spindle
#

I'm trying to build a paperweight fork in a CI/CD job (GitLab) and there seems to be a random chance the build is failing.
Here is the runner log: https://pastes.dev/vCeHyLuQLH Does anybody have an idea whats going on here?

bronze ember
#

Look at the log file

#

To see why the decompiler failed

#

(man, life is so much better without spigots decompiler now)

cold spindle
cold spindle
bronze ember
#

yes!

#

exit code 137 apparently means the process was killed from the outside

#

so idk why gitlab is killing the process

#

maybe it uses too much ram?

cold spindle
#

might be OOM

bronze ember
#

oom would be different

#

I would just assume it used too many resources and gitlab killed it

glossy fox
#

Is there a specific reason why there is no paperweight-userdev dev-bundle for 1.17, but only for 1.17.1?

distant mango
#

why do you even need 1.17

bronze ember
#

without looking up, I assume it was one of those releases that directly got hotfixed

#

so there never was a paper release

glossy fox
bronze ember
#

ah no, maybe we didnt have userdev back then?

glass sable
#

it's also possible that paperweight simply wasn't a thing back then? not sure

bronze ember
#

paperweight was, just not userdev I think

#

but generally, there is no point in supporting minors that arent the latest of a version, no?

#

so just drop 1.17.0

glass sable
#

I mean depends on the changes mojang made in it...

#

tbh. I'm more confused that a sitting plugin still needs NMS to work :S

glossy fox
glossy fox
glass sable
#

well I personally don't see the value in using packets for something simple as that at all but ¯_(ツ)_/¯

glossy fox
glass sable
#

yeah I'm looking at it now and I don't see anything that couldn't be done with api tbh

bronze ember
glossy fox
#

Yes, you are right, I will simply drop the support with the switch to gradle ^^

glossy fox
# bronze ember

I'm really glad that so many of my GSit users are using the latest server versions. I considered dropping support for 1.16.x, 1.17.x, 1.18.x and 1.19.x a while ago. This versions currently only make up about 7.5%.

bronze ember
#

thats why you added stats after all, to see what matters to your users

#

imagine the build time save by that, all the remove code, etc

#

and generally, people that run such dead end versions most likely don't run the latest version of your plugin anyways, they can just stick on an old one

glossy fox
glass sable
#

you can easily add that as a custom chart

#

but of course that wont work for outdated plugin versions

bronze ember
#

I would also love if bstats would allow you to filter for stuff like that, but it quickly becomes a privacy issue, if stats only return 5 results, its not really anonymous anymore

glass sable
#

as long as it doesn't list IPs/domains or all installed plugins in correlation to other values I don't see an issue tbh

#

maybe bStats v2 will have it (whenever it happens lol)

#

(PaperStats wen?!?)

bronze ember
#

it crossed my mind before...

glass sable
#

I just wish Bastian had accepted my PR which added some of the missing graph types a couple years ago instead of dismissing them because they wanted to write a new version anyways :(

#

I actually considred just running my own install after that lol

bronze ember
#

hes def responsive to PRs rn

#

but didnt want to accept PRs towards finishing v2

glass sable
#

right, I noticed that there actually is a new backend now thonk

#

I wonder if my test setup still works

bronze ember
#

oh yeah I PRd a fix for server name resolving to that

glass sable
#

mergh, it seems to use google firebase now instead of redis :S

#

makes me actually consider pulling all of my plugins from it now that I know that :(

glossy fox
#

I'm having 4 more build tooling related questions (maybe you can help me with this 🫠 ):
https://github.com/gecolay/GSit/tree/gradle

distant mango
#

use the shadowjar task

bronze ember
#

a) you use different configurations. in maven the equalivent kinda was scopes? basically use implementation("dep") for shading and compileOnly("dep") for provided

#

d) is just processResources { expand(project.properties) } I think?

distant mango
#

move the src/resoircds to core/src/nain/reaouces

#

typos ofc

glossy fox
glass sable
#

(ok nice, apparently Bastian wants to move away from Firebase 👀 )

rapid fractal
glossy fox
distant mango
azure lotus
#

Any Ideas why everyhing is red? I mean its working but kinda confusing

glass sable
#

did neither of the two suggestions work?

azure lotus
#

I tried to invalidate the Chaches but it didnt work

azure lotus
glass sable
#

well try the other suggestion...

azure lotus
#

I dont know what he means

glass sable
#

build the project in intellij and then reimport it

azure lotus
glass sable
#

run through the repeair dialog

#

or just restart (if you didn't do that yet)

azure lotus
#

what repair dialog?

#

I tried this Intellij repair thing but didnt change anything

devout ledge
#

Did you walk through the entire repair flow? Rebuilding indexes should take a while

azure lotus
#

yes I did

#

2 times

#

completed this 3 times now

bronze ember
#

wdym by everything red in the first place

#

the red lines in the screenshot?

azure lotus
#

yep

bronze ember
#

thats not really important, IJ jsut doesnt always resolve plugins

#

I think you can force it, but just ignore it, lol

azure lotus
#

oh okay

bronze ember
#

this is why expressing your problem clearly is important, everybody else thought you had issues accessing api classes 😛

devout ledge
# azure lotus completed this 3 times now

Every time I've had to walk through the repair flow, it's taken 5m+, so I'm guessing you're not actually going through the whole flow properly.
Are you clicking the buttons on the notification at the bottom after that completed? It should be giving you a notification that's something like "Did <thing>, step 1/#", and giving you "Everything works now" / "Try <next step>"

bronze ember
#

you are chasing the wrong symtomps _11, they are just confused why IJ marks their plugins as red in the pom

devout ledge
#

Fair enough, still good to know though

azure lotus
#

sorry for that, im kinda new into this

glass sable
#

I mean, all their xml tags are red too

devout ledge
#

Isn't that default for unthemed / no Rainbow Brackets?

bronze ember
#

thats their color theme hopefully 😄

azure lotus
glass sable
#

if that is default then that would be a really shitty theme ;P

hardy tendon
#

Not necessarily a Paper-specific question, but any tips for handling private repository credentials with Gradle? Maven has settings.xml, never done it with Gradle

lament scarab
#

with gradle you basically use properties

humble scaffold
lament scarab
#

same folder, just $HOME will be your C:/Users/urname

haughty plover
lament scarab
#

the decompiler is jdk sensitive

#

set the toolchain for older versions to an appropriate java version, iirc, 17

haughty plover
#

oh..

lament scarab
#

er, I don't deal with groovy

#

on the surface, looks okay

grizzled river
#

‘toolchain.languageVersion’ set to java 17 by itself is fine

haughty plover
#

I finally fix this problem with

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

compileJava {
    java {
        toolchain.languageVersion = JavaLanguageVersion.of(21)
    }
}
sinful solar
#

is this the place to ask for help with plugin dev?

#

Would like to know if my plugin can detect an event for when a player joins/switches to a different vanilla scoreboard team

lament scarab
sinful solar
#

Ty

echo kilnBOT
#

Please send large files/logs to a pastebin

distant mango
#

Jan^

frail pelican
#

When I try to build my plugin, I get the following error message:
org.gradle.api.GradleException: Could not add file '/home/jan/IdeaProjects/CastleConquest2/build/classes/java/main/net/chaossquad/castleconquest2/Utilities$1.class' to ZIP '/home/jan/IdeaProjects/CastleConquest2/build/libs/CastleConquest2-1.0-SNAPSHOT-all.jar'.
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 65.

When I remove both relocations, everything works fine.

The weird thing is that the file shown in the error is not a file from a dependency, it is a file from my current plugin.

distant mango
#

probably need to update shadow (com.gradleup.shadow)

distant mango
#

old plugin

#

com.gradleup.shadow is the new updated one

frail pelican
shut mural
#

I am compiling the plugin with 1.20.6 because that is my minimum API version.
However, when I try to run my plugin with version 1.21 and above, I get the following error.

java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_20_R4/inventory/CraftInventoryCrafting
distant mango
#

v1_20_R4 isn't included anymore

shut mural
#

1.20.6 includes?

distant mango
#

see the forum post

shut mural
#

hmm so i should downgrade the paper-userdev?

#

to use with 1_20_R4

distant mango
#

don't downgrade it

#

see the forum post

shut mural
#

man i am importing this class, so i am not using a version package name here
import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting;

Should I use like Class.forName("org.bukkit.craftbukkit.v1_20_R3.CraftServer")

distant mango
#

just read the forum post

shut mural
#

i read it man, i am just not sure what should i do

distant mango
shut mural
#

i will try it

#

So what could be the reason for the error below? This seems like a different situation.

java.lang.NoSuchMethodError: 'int net.minecraft.world.entity.Display$TextDisplay.al()'

i am getting this error only 1.21 version not 1.21.1

#

it is a Commodore issue? or something

distant mango
#

paper uses mojang mappings now

#

are you using paperweight

shut mural
#

yeah

distant mango
#

show your code

shut mural
#

but REOBF_MAPPING

distant mango
#

and what jar are you running

shut mural
#

paperweight.reobfArtifactConfiguration = ReobfArtifactConfiguration.REOBF_PRODUCTION

#

i am using these

compileOnly("dev.folia:folia-api:$serverVersion")
paperweight.paperDevBundle(serverVersion)
#

serverVersion is 1.20.6-R0.1-SNAPSHOT

round needle
#

Is there an example floating around of using paperweight with java and build.gradle instead of kotlin?

crude kernel
#

why? it's only the buildscript that's kotlin

round needle
#

Cause I have never used a kotlin build script before. Been reading on the docs about setting it up was just curious. I will look into kotlin builds scripts more

shut mural
#

java.lang.NoSuchMethodError: 'net.minecraft.world.level.Level net.minecraft.server.level.ServerPlayer.dW()'

When I run a plugin I compiled with 1.21.3 bundle with 1.21.4 paper, I get errors like the following. There is no error in 1.12.3. How should I approach NMS functions to get rid of these errors?

quaint raven
#

compile it with the 1.21.4 bundle. NMS is not backwards compatible, it is not considered API

shut mural
#

but i don't wan't compile jar by version
all versions should be in one jar ?

quaint raven
#

You can use a multi modules setup in gradle and create an adapter for every version. Then you still have one plugin.

#

There is no easy solution for this. NMS is not stable, if you want backwards compatibility use the API

shut mural
#

Unfortunately, the API is inadequate in my scenario, I would love to.

hollow condor
#

How far back does paperweight support?

#

Because we need it until 1.13, and paperweight is not working for 1.17 right now

bronze ember
#

1.17.1 was the first userdev version iirc

#

why do you need to go back that far? people dont use these versions anymore

hollow condor
#

For this API, we want to be able to support every version that brigadier can be used in sadly

#

So what are our options?

#

Using BuildTools?

static urchin
#

That was pre bundler right?
iirc back then you used to just smack the uber server jar onto the classpath

bronze ember
#

idk, I never cared to look what hoops people jump thru to support versions nobody uses

bronze ember
#

thats the whole reason userdev exists

hollow condor
#

Mhm, that's annoying...

static urchin
#

Well yea KEKW it would be a lot of hardcoding

bronze ember
#

you can fall back to reflection or something like that

hollow condor
#

Possibly, but very painful

rapid fractal
#

You know what's not painful, support modern version only 😉

bronze ember
#

I would just cross that bridge when somebody actually requests that

static urchin
#

didn't we have like a flag for this

hollow condor
#

Lamp supports up to 1.13, so that's what we're after

#

I prefer doing it now, rather than later, when somebody requests it, and then it takes us a lot of time, whilst they are waiting

static urchin
#

Yea we had -Dpaperclip.install=true

#

so you'd grab the paperclip jar for the respective version and just run that with that property ^

#

it would throw the uber jar into your mavenLocal

hollow condor
#

We could maybe do that, thanks!

static urchin
#

Then obviously suffer at the terrible naming and non reproducible builds

#

but, well, such is life

prime cliff
static urchin
#

Isn't that a command framework? omegaroll

hollow condor
#

Yup lol

static urchin
#

I doubt this is talking about the lamp stack lol

prime cliff
static urchin
#

only so many four letter combinations

hollow condor
#

Fair enough

prime cliff
#

btw. What's the long name of ur command framework? lamp?

static urchin
prime cliff
#

So arbitrary letters. 😄
I should create a permissions Framework starting with these letters. Insiders know what name I choose. 😄

shut mural
#

How should i get mojang jar from versions directory on higher than 1.20.6 versions

#

All I see is the paper jar

#

i need this jar for 1.21.3

rapid fractal
#

You can only get Mojang jar from Mojang. Or are you confusing it with something else?

shut mural
#

i am using reobf_production so iirc i need that jar

lament scarab
#

Er, what?

smoky violet
#

all I was explaining there was you need to ensure the classpath you provide to your thing is in the same mappings as the input jar your are providing it

shut mural
#

I know they are different sizes, but something interesting caught my attention. Some classes have different names.

#

like EntityType ~ EntityTypes

lament scarab
#

-all means that it's shaded

#

-dev means that it's mojang mapped

shut mural
#

If I put dev-all on my server, will it work without any problems?

#

Once upon a time, when I compiled, only a file with -dev at the end was created. But for some reason it's not happening now. It happened after I tampered with my build.gradle file.

lament scarab
#

I mean, idk how that works with the new stuff

shut mural
#

Do you have any idea how this -dev file is normally created, maybe I can fix it. Also, do you think there will be a problem if I put the shaded jar to the server?

#

Will I encounter strange things?

lament scarab
#

I mean, that's just your compiled jar ran through shade

#

userdev adds the dev classifier

smoky violet
#

(when you have REOBF_PRODUCTION set as the artifact configuration)

#

in that case shadowJar is -dev-all, jar is -dev, reobfJar (which uses shadowJar as input) is no classifier

#

with MOJANG_PRODUCTION jar and shadowJar do not have their classifiers changed and reobfJar is -reobf

glossy fox
#

Hey,
would be nice if someone who knows a bit more about Gradle could help me.
I currently have an "It works on my machine" problem with my project:
https://github.com/gecolay/GHolo

if i run "gradle clean build" on my local machine it works completely fine, but when it runs in the environment of the remote building it always fails. Example failed log: https://jitpack.io/com/github/gecolay/GHolo/339d1980de/build.log

My local env:

  • Windows 11
  • Default Java version 21.0.3
  • Installed 17.0.6
  • Using the in the project bundled gradle

The remote build fails with:

Dependency resolution is looking for a library compatible with JVM runtime version 17, but 'io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT:20241215.095037-18' is only compatible with JVM runtime version 21 or newer.

Even though only the java release version is 17 and the java toolchain version is 21.
Locally this works perfectly.

distant mango
#

can you try addng

plugins {
  id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
}
#

to settings.grade

glossy fox
hardy tendon
# glossy fox Hey, would be nice if someone who knows a bit more about Gradle could help me. I...
Installing: java 17.0.2-open
Done installing!


Setting java 17.0.2-open as default.

- Class 'io.papermc.paperweight.util.Jar_runnerKt': external process started '/home/jitpack/.sdkman/candidates/java/17.0.2-open/bin/java -Xmx4G

If you have JDK 21 for the toolchain, why are you installing JDK 17? My guess is that Jitpack is using that JDK and failing to resolve the dependencies even though you build against 17

#

Yes, but options.release = 17 doesn't mean you need the JDK installed, you can use Java 21 to target older versions

glossy fox
bitter linden
haughty plover
#

what task name is this task?

crude kernel
#

No task, just paperweight output

cold spindle
#

Following a conversation in #paper-dev message
Not sure if this is the right place to ask about the resource-factory gradle plugin, but considering that there isn't a place to ask for support on the repo, it's used in an official example and made by a paper maintainer, I think this place should be fine.
Anyway, the paperPluginYaml configuration doesn't support the load keyword to change startup from after the first world is loaded to before, which seems to work in Paper plugins.
I'm not sure if using the load keyword is unsupported behaviour in Paper plugins and thus not included in the gradle plugin, or actually missing, at which point I'd probably create an issue/pr on the gradle plugin.

crude kernel
#

gonna try updating to gradle 8.12

#

seems to fix it

tawny horizon
#

im losing my mind here

#

1.21.4 seems to only work with paperweight userdev 2.0.0-beta.8 now, fair enough

#

but for some reason when upgrading from 1.7.7 to 2.0.0-beta.8, everything breaks

brave widgetBOT
tawny horizon
#

it seems to me to be a completely nonsensical error

distant mango
#

what gradle version

tawny horizon
#

8.11.1

distant mango
#

try updating

tawny horizon
#

ok

glossy fox
static urchin
#
java {
  disableAutoTargetJvm()
}
#

(also, damn windows users and their non executable gradlew files Sadge)

obtuse vigil
#

Hi, does anyone know why is this error hapenning ?
Expected configuration ':paperweightDevelopmentBundle' to contain exactly one file, however, it contains more than one file.

config:
id "io.papermc.paperweight.userdev" version "1.7.7"
paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")

glossy fox
static urchin
#

party glad it worked out

static urchin
#

prayge thank you for making the life of us poor terminal users better

bronze ember
glossy fox
distant mango
#

also update paperweight

obtuse vigil
distant mango
#

update gradle

obtuse vigil
smoky sleet
#

HIi, i have a problème when i build, i have that:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':Core'.
> Expected configuration ':Core:paperweightDevelopmentBundle' to contain exactly one file, however, it contains more than one file.

* 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.

BUILD FAILED in 340ms
17:53:18: Execution finished 'clean build'.
#

I didn't touch my build.gradle and it appeared

proud maple
#

update gradle & paperweight

smoky sleet
#

and i have 1.7.7 version for paper-weight

distant mango
#

update it

#

2.0.0 beta 8 or something

smoky sleet
#

i put 2.0.0-beta.8 but its same

#

Plugin [id: 'io.papermc.paperweight.userdev', version: '2.0.0'] was not found in any of the following sources:

distant mango
#

that’s 2.0.0

smoky sleet
#

Could not resolve io.papermc.paperweight:paperweight-userdev:2.0.0-beta.8.

distant mango
#

remove that last .

smoky sleet
#

dont have

#

it asks me to update gradle to version 8.8

distant mango
#

update it to 8.12

smoky sleet
#

I think it works, it's re-downloading paper-weight

#

tyy !! ♥️

foggy heart
bronze ember
#

Did you actually clone main?

foggy heart
#

I deleted Paper dir entirely and cloned main with GitHub Desktop

static urchin
#

the dirs are not called Paper-API but paper-api these days sooo

#

thats sus

bronze ember
#

Yeah something is off

foggy heart
bronze ember
#

Try a new dir

#

You somehow got residuals

foggy heart
#

Nope, cloned into a new dir, still same :/

foggy heart
#

I'm genuinely clueless

distant mango
#

is documents a cloud(onedrive, icloud) folder?

foggy heart
#

Nope, local

distant mango
#

have you tried just getting rid of the gradle cache folder

foggy heart
#

Looks like that did the trick, neat
gradlew can build again and IntelliJ sees modules just fine

static urchin
#

✨ caches ✨

distant mango
#

i’m so smart

granite valve
#

when I checked out the main branch, it kept the folders as Paper-API and Paper-Server

#

so there's some craziness that happens there

bronze ember
#

but they claimed to have deleted the folder 🤷‍♂️

void hill
#

Hey, for a multi modular system where I want one for spigot and one for paper now that they're aparting. Just so I understand how I do this correctly. I have a core that just picks between the two depending on server type and go from there? for some reason in the past I assumed you have one core and just added the other ontop?

bronze ember
#

many plugins have been adding paper modules for ages, since the paper api often offers ways to do the same thing but with better performance

hollow condor
smoky violet
hollow condor
smoky violet
#

you should use jdk 21 for everything with java toolchains

#

and for the common module set options.release to 8 for JavaCompile

#

(see the test plugin for an example of setting those options)

#

for the version-specific modules set release to the appropriate version, i.e. 17 for 1.19, 21 for 1.21

#

and for paperweight modules for paper versions that use java 17 you will need to set paperweight.javaLauncher to be a java 17 launcher rather than 21

#

use paperweight 2.0.0-beta.8 for that option to appear

bronze willow
#

I have paperweight forked and if i remove it it works but i want to use it
I appreciate any help 🙂

distant mango
#

try looking at the reposllite example

#

you need to specify password credentials classs iirc

bronze willow
#

Where can i find the example

distant mango
#

https://reposilite.com/guide/gradle should work the same way

Reposilite

Lightweight and easy-to-use repository manager for Maven based artifacts in JVM ecosystem. This is simple, extensible and scalable self-hosted solution to replace managers like Nexus, Archiva or Artifactory, with reduced resources consumption.

topaz viper
#

paperweight-userdev just suddenly broke on me. a clean checkout in a virtual machine of a project that was working perfectly a week ago now doesn't even download dependencies, gradle fails with this error:

A problem occurred configuring root project 'CabotEnchants'.
> Failed to notify project evaluation listener.
   > Expected configuration ':paperweightDevelopmentBundle' to contain exactly one file, however, it contains more than one file.
   > Expected configuration ':paperweightDevelopmentBundle' to contain exactly one file, however, it contains more than one file.

I'm guessing some external dependency changed and broke stuff. Anyone found any solution?

Tried upgrading to paperweight 2.0.0-beta.8 but that fails with "configuration with name compileOnly not found"

prime cliff
#

I'll try to reproduce with one of my userdev projects. Gimme a minute

topaz viper
# prime cliff I'll try to reproduce with one of my userdev projects. Gimme a minute

If it helps, here's a public copy of the project I'm working on. last commit to this repo was a week ago and at that time there were no issues. now I can't get it to import anywhere, even on a brand new virtual machine on a different continent. https://github.com/EggAllocationService/CabotEnchants/tree/departmas/2024

GitHub

Contribute to EggAllocationService/CabotEnchants development by creating an account on GitHub.

hardy tendon
#

also it complains if id 'java' isn't at the top in the plugins block

topaz viper
hardy tendon
#
Index: build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build.gradle b/build.gradle
--- a/build.gradle    (revision b76f6801fc9efceeefa84681b2bf743f422c4016)
+++ b/build.gradle    (date 1734997479117)
@@ -1,5 +1,6 @@
 plugins {
-    id("io.papermc.paperweight.userdev") version "1.7.5"
+
+    id("io.papermc.paperweight.userdev") version "2.0.0-beta.8"
     id("xyz.jpenilla.run-paper") version "2.3.1"
     id 'java'
 }
Index: gradle/wrapper/gradle-wrapper.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>ISO-8859-1
===================================================================
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
--- a/gradle/wrapper/gradle-wrapper.properties    (revision b76f6801fc9efceeefa84681b2bf743f422c4016)
+++ b/gradle/wrapper/gradle-wrapper.properties    (date 1734997436901)
@@ -1,6 +1,6 @@
 #Sat Nov 23 00:53:45 AST 2024
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists

topaz viper
#

Interesting, if I use a paper dev bundle for 1.21.1 it doesn't happen (paperweight-userdev 1.7.5). I'm guessing 1.21.2+ dev bundles are screwed up for some reason

hardy tendon
#

I was just gonna say the same

#

Aaaand now that I think of it, it's probably the 1.21.4 dev bundle being incompatible with old paperweight builds

#

1.21.3 works fine

topaz viper
#

My old project on 1.5.11 seems to be broken for a sec but I think that was because I was screwing with my gradle caches

lament scarab
#

Depends on what you mean by 'broken', the dev bundle changed, maybe it should have broken harder, but, it's not a surprise that the new dev bundles aren't working on older versions of the userdev plugin

static urchin
#

If you can throw me your build.gradle.kts that'd be great

plucky stirrup
#

sure! thanks much

static urchin
#

ah yea, the feature may be exclusive to userdev 2.x

#

lemme see if 1.x has an equivalent

plucky stirrup
#

thanks

static urchin
#

does not look like it, seems pretty hardcoded

plucky stirrup
#

i can update without problems

static urchin
#

latest is v2.0.0-beta.8

#

it does iirc require a rather new gradle version too

#

so make sure you are on 8.12 gradle or whatever

plucky stirrup
#

i dont remember the intellij version tho, i think i'll have to install it myself

#

at least i have brew

static urchin
#

IJ should not matter

#

just the gradle wrapper

plucky stirrup
#

oh ok

#

snapshot repo right?

#

for the beta

static urchin
#

nah, its deployed to the gradle portal

plucky stirrup
#

id("io.papermc.paperweight.userdev") version "v2.0.0-beta.8"
?

static urchin
#

mhm

plucky stirrup
#

seems like it can't be found

static urchin
#

can you share the error log of ./gradlew build

#

or gradlew build on windows

plucky stirrup
#

sure

#

ah mb it could be im on gradle 8.8 instead of 8.12

static urchin
#

yea that might be it 😅

#

yup

#

just plugged that in a paste for ya 😅

#

Yea so, what you wanna do is running ./gradlew wrapper --gradle-version 8.12 twice (the twice is important)

plucky stirrup
# static urchin https://pastes.dev/bURvqmKNtp

i updated my gradle and also configured it in intelliJ build tools configuration but i still get this error

~/Desktop/XPrivateMines git:[master]
./gradlew wrapper --gradle-version 8.12

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/alessandrocalista/Desktop/XPrivateMines/build.gradle.kts' line: 3

  • What went wrong:
    Plugin [id: 'io.papermc.paperweight.userdev', version: 'v2.0.0-beta.8'] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
  • Included Builds (No included builds contain this plugin)
  • Plugin Repositories (could not resolve plugin artifact 'io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:v2.0.0-beta.8')
    Searched in the following repositories:
    Gradle Central Plugin Repository
    maven(https://repo.papermc.io/repository/maven-public/)
  • 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.

BUILD FAILED in 675ms

#

seems like it cannot find the plugin

static urchin
#

oh, sorry dies without the v

#

id("io.papermc.paperweight.userdev") version "2.0.0-beta.8"

#

I copied from the wrong place KEKW

plucky stirrup
#

that could have been the problem Lol

#

java 22 required?

static urchin
#

should not be no

#

at worst java 21

plucky stirrup
#

~/Desktop/XPrivateMines git:[master]
./gradlew wrapper --gradle-version 8.12

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'XenPrivateMines'.

Could not resolve all artifacts for configuration ':classpath'.
Could not resolve io.papermc.paperweight:paperweight-userdev:2.0.0-beta.8.
Required by:
project : > io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:2.0.0-beta.8
No matching variant of io.papermc.paperweight:paperweight-userdev:2.0.0-beta.8 was found. The consumer was configured to find a library for use during runtime, compatible with Java 22, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.8' but:
- Variant 'javadocElements' declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about its target Java version (required compatibility with Java 22)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.8')
- Variant 'shadowRuntimeElements' declares a library for use during runtime, compatible with Java 17, packaged as a jar, and its dependencies repackaged (shadow jar):
- Incompatible because this component declares a component, as well as attribute 'org.gradle.plugin.api-version' with value '8.11.1' and the consumer needed a component, as well as attribute 'org.gradle.plugin.api-version' with value '8.8'
- Variant 'sourcesElements' declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about its target Java version (required compatibility with Java 22)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.8')

  • Try:

No matching variant errors are explained in more detail at https://docs.gradle.org/8.8/userguide/variant_model.html#sub:variant-no-match.
Review the variant matching algorithm at https://docs.gradle.org/8.8/userguide/variant_attributes.html#sec:abm_algorithm.
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.

BUILD FAILED in 315ms

#

i did run twice btw.

static urchin
#

oh, no don'T upgrade the plugin before bumping gradle

#

that won't work

#

now gradle cannot set itself up, so it cannot bump to 8.12

#

its cyclic

plucky stirrup
#

i didn't upgrade the plugin, should i remove my brew installation and let intellij handle it alone?

static urchin
#

Well you did, it's searching for io.papermc.paperweight:paperweight-userdev:2.0.0-beta.8

plucky stirrup
#

aaaaa ok

#

i tought another gradle plugin

static urchin
#

nah. Just, before touching your build.gradle.kts at all, upgrade the wrapper by running that twice

#

then attempt to update

#

I'd be depressing if userdev needs java 22 tho 👀

plucky stirrup
#

ok so i go with 1.7.7 run twice then update

plucky stirrup
static urchin
#

pretty sure it should be compiling down to java 17

plucky stirrup
#

honestly

#

like regarding that issues with mockbukkit

#

now running the test doesn't even give me that error

#

LOL

static urchin
#

Well you might wanna updated anyway soon xd

plucky stirrup
#

yes yes i updated userdev

#

i mean with the updated userdev it works lul

static urchin
#

Oh XD well good lol

plucky stirrup
#

nah nvm

#

it happened again

static urchin
#

Okay well, if its updated, now you should be able to paste the snippet

plucky stirrup
#

yeah

#

also seems like mockbukkit only supports spigot plugins :X

#

yeah now i need to study how to pass test classes for the nms / economy and worldguard / worldedit things so i can make them work

static urchin
#

gl gl, try asking in their discord. Pretty sure they support paper

plucky stirrup
#

they have a discord?

bronze willow
#

Is there a way to develop gh actions or smth similar without spamming the whole repo with commits?

lament scarab
#

I mean, you'd need to check GH actions docs

#

there was an OSS project for building actions locally called act, iirc

#

idk if it's suitable for development

bronze willow
zenith flower
#

either use act or just force push your tests away

#

or test on a separate repo

lament scarab
#

^ pretty much

bronze willow
#

Thats what i was doing, just wanted to ask if there is a "better" way

#

ty

granite valve
#

yeah, thats a common thing with me. I'm usually testing on a separate repo

bronze willow
prime cliff
#

You aren't authorised. The error says that. Ensure that your env has
VARILX_USER and VARILX_TOKEN set.

bronze willow
#

And if these are not set i would get an 403 ig

indigo rapids
#

any ideas what it means? this error appears only on 1.21.4 version

prime cliff
bronze willow
#

My settings.gradle is almost empty

#

Can you tell me how i can put in there?

lament scarab
prime cliff
prime cliff
bronze willow
#

I think this wont work because my fork still uses the old "master" branch

brave widgetBOT
lament scarab
#

for one, update gradle, from the seems of it

indigo rapids
prime cliff
bronze willow
lament scarab
#

I mean, iirc your issue is one due to how repos work

#

use the properties to define that stuff

bronze willow
#

Do you mean gradle.properties?

lament scarab
#

yes

bronze willow
#

How?

lament scarab
#

~/.gradle/gradle.properties

paperSnapshotsUsername=xxx
paperSnapshotsPassword=xxx
replace paperSnapshots with your repo name

bronze willow
#

And do i need to change the build.gradle?

indigo rapids
lament scarab
#

update gradle

lament scarab
bronze willow
#

Is it this:
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
?

lament scarab
bronze willow
#

So the error doesnt change

indigo rapids
lament scarab
lament scarab
indigo rapids
# lament scarab update the gradle-wrapper.properties manually

updated, but now it shows this

Download https://plugins.gradle.org/m2/io/papermc/paperweight/paperweight-userdev/2.0.0-beta.8/paperweight-userdev-2.0.0-beta.8.jar, took 1 s 273 ms

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\just_lofe\Documents\GitHub1\xMain\bukkit\build.gradle' line: 14

* What went wrong:
An exception occurred applying plugin request [id: 'io.papermc.paperweight.userdev', version: '2.0.0-beta.8']
> Failed to apply plugin 'io.papermc.paperweight.userdev'.
   > Could not create an instance of type io.papermc.paperweight.userdev.PaperweightUserExtension.
      > Configuration with name 'compileOnly' not found.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

CONFIGURE FAILED in 6s
lament scarab
#

make sure that userdev is applied after the java library plugin

indigo rapids
#

like this?

lament scarab
#

yes

indigo rapids
#
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bukkit:paperweightUserdevSetup'.
> io.papermc.paperweight.PaperweightException: Failed to execute steps, invalidated relevant caches. Run with --stacktrace for more details.

💇‍♂️

#

oh i cleaned cache and it seems to work

#

same error

lament scarab
#

need more details

indigo rapids
#

what can I provide?

distant mango
#

the full message

indigo rapids
#
> Task :prepareKotlinBuildScriptModel UP-TO-DATE

> Task :bukkit:paperweightUserdevSetup
:executing 'download minecraft manifest'
:executing 'download minecraft version manifest'
:executing 'download vanilla minecraft server jar'
:executing 'download mojang server mappings'
:executing 'apply mojang mapped paperclip patch'
:executing 'extract libraries and server from downloaded jar'
:executing 'remap minecraft server jar'

> Task :bukkit:paperweightUserdevSetup FAILED

[Incubating] Problems report is available at: file:///C:/Users/just_lofe/Documents/GitHub1/xMain/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.12/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
1 actionable task: 1 executed

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bukkit:paperweightUserdevSetup'.
> io.papermc.paperweight.PaperweightException: Failed to execute steps, invalidated relevant caches. Run with --stacktrace for more details.

* 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.

BUILD FAILED in 3m 25s
proud maple
#

try running it with --stracktrace for some more info

indigo rapids
brave widgetBOT
pine hawk
#

help me Hello, who can help me with something, that is, create a menu with a kit for my paper server with the DeluxeMenus plugin, I hope you can help me, give me a config for a fine menu with a kit in private or even here in general

shrewd crestBOT
#

(676c00846ed5010734cf1a70) // @pine hawk (@dariuspro04859 / 1297152244793475112) has been warned by @rapid fractal (177150983258767360)
Reason: dont spam/crosspost asking for spoonfeed

daring sail
#

Hello, can anyone help me with paperweight-userdev?

I'm using gradle groovy v8.11.

if i try to sync gradle, it throws this error:

https://pastebin.com/XwD0V5fT

and this is my build.gradle file:

https://pastebin.com/8TEK7EiF

proud maple
#

your target java version needs to be java 21

daring sail
#

now i have changed the target version, but the same error was thrown

static urchin
#

Bump gradle

#

8.12 is latest

daring sail
#

ah, thanks now it seems to work

#

now i become this weird error:

Execution failed for task ':bukkit:paperweightUserdevSetup'.
> io.papermc.paperweight.PaperweightException: Failed to execute steps, invalidated relevant caches. Run with --stacktrace for more details.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.12/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 8s
static urchin
#

Well run stacktrace for more details / proivde the whole log

echo kilnBOT
#

Please send large files/logs to a pastebin

static urchin
#

C:\Users\Benny.gradle\caches\paperweight-userdev\613081b689735a1c6be92857491be1a4773c6b9c71a65baf922ee4f718c54ed2\module\io.papermc.paper\dev-bundle\1.21.4-R0.1-SNAPSHOT\paperweight\setupCache\remapServerJar.jar.log

#

Find the log

static urchin
#

Ehhhh, that is java 22 class code in there

#

Das not good

daring sail
#

how can i fix this?

static urchin
#

Idk. Might be a good idea to setup a java toolchain

indigo rapids
#

i has the exact same problem and java 22, is there any solution?

daring sail
#

i think this has fixed the problem:

def targetJavaVersion = 21
java {
    def javaVersion = JavaVersion.toVersion(targetJavaVersion)
    sourceCompatibility = javaVersion
    targetCompatibility = javaVersion
    if (JavaVersion.current() < javaVersion) {
        toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
    }
}

place this in your build.gradle

prime cliff
#

The answer is right above your question.

static urchin
#

Yea, 1.21.4 needs java 21

indigo rapids
#

only 21?

static urchin
#

Well java 22 should maybe work?

indigo rapids
#

no, it doesn't works

static urchin
#

Share your build.gradle.kts

echo kilnBOT
#

Please send large files/logs to a pastebin

indigo rapids
prime cliff
indigo rapids
#

what i need to change\update?

#

just adjust the version of plugin?

#

oh okay

prime cliff
#

That should at least fix shadowing in newer java versions.

indigo rapids
#

it doesn't fix my problem

static urchin
#

Did you post your log file?

static urchin
#

Caused by: io.papermc.paperweight.PaperweightException: Execution of 'io.papermc.codebook.cli.Main' failed with exit code 1. Log file: C:\Users\just_lofe.gradle\caches\paperweight-userdev\613081b689735a1c6be92857491be1a4773c6b9c71a65baf922ee4f718c54ed2\module\io.papermc.paper\dev-bundle\1.21.4-R0.1-SNAPSHOT\paperweight\setupCache\remapServerJar.jar.log

#

That lot

indigo rapids
static urchin
#

Can you share it anyway please. Just so I can confirm that

indigo rapids
#

the entire file or only stacktrace?

static urchin
#

For all I care all of it

indigo rapids
prime cliff
#

asm needs an update in paperweight I guess.

static urchin
#

Okay danke

#

Yea

#

In codebook

#

So yea java 21 only then but I'll look into getting that fixed

prime cliff
#

9.5 -> 9.7.1

static urchin
#

Only question is why the server jar it is remapping has java 22 code in it

prime cliff
#

The classfiles are compiles with java 22 and the remapping happens on them?

#

Just a wild guess.

static urchin
#

Well but that is the Minecraft server, which run on java 21

prime cliff
#

The plugin that uses userdev get's compiled with Java 22 and probably uses 22'er features in classes using NMS.

pallid chasm
#

I've built fresh paper project and published it to local maven repository (using publishToMavenLocal / publishMavenPublicationToMavenLocal) and tried to use local paper api in my plugin project as before:

    mavenLocal()
    mavenCentral()
}

dependencies {
    compileOnly 'io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT'
}```

but some error that I haven't seen before appears when trying to build jar: https://pastes.dev/61a0EtXBNi 
What did I wrong?
smoky violet
#

you still need to add the paper repo

#

just put it below maven local to prioritize your local build for testing

pallid chasm
#

It's working, thanks 🙃

bronze willow
#

Is there any option to use paperweight with credentials?

static urchin
#

Hm?

bronze willow
#

So im forking paper and publishing it to a private repo and i want to use this paperweight

static urchin
#

Paperweight patcher ?

bronze willow
#

Is there a documentation for that?

static urchin
#

Well, you are presumably using it if you forked paper?

#

paperweight-examples is the repo

bronze willow
#

Yeah but i dont really know what it does

static urchin
#

But credentials are defined in the repo definition

#

So paperweight isn't really related to how you Auth to a repo

bronze willow
#

So i have this in the fork: api(group = "de.varilx.coreapi", name = "common", version = "2.3.12-commit-bf53780", classifier = "shadow")
And if i use it normaly everything is okay, but if i add paperweight i get this:
> Could not HEAD 'https://reposilite.varilx.de/Shadow/de/varilx/coreapi/common/2.3.12-commit-bf53780/common-2.3.12-commit-bf53780.jar'. Received status code 401 from server: Unauthorized

static urchin
#

Idk if PW does anything in the build process that might fuck with that

#

But also not in a position to check that

#

Not like there is a "normally" without paperweight tho so, idk.

#

Is that project public

bronze willow
#

No thats why i have to use credentials

static urchin
#

Well the code of the fork might have been

bronze willow
#

I can use the forked api fine, but if i want to use paperweight everything breaks

#

I dont really understand the paperweight code, but could the problem be, that paperweight is doing something wron with the credentials

bronze willow
distant mango
tawdry spear
#

There's no 1.21.4 until after the fork, right?

bronze ember
#

It's now officially after the fork

tawdry spear
#

And we're mid-fork right now, right?

bronze ember
#

No, it's been merged into main

tawdry spear
#

Oh. So is there a stable 1.21.4 release?

bronze ember
#

No, we want more people to test it

tawdry spear
#

Gocha. Totally cool.

#

And no one considered calling it a spork?

bronze ember
#

It's not stable until we heard from enough people that it is stable

bronze ember
raven barn
#

hope that is enough feedback

quaint raven
#

Is there a guide to convert old paper forks to hardfork/paperweight 2?

#

Guess I can use the changes in the paperweight-examples for now

bronze ember
#

That's the easiest way, just start clean and copy patches over

rigid prism
#

I’m a bit confused. Never used userdev before. I only want to achieve one thing. Stop the server from remapping my plugins since I only use the api and not any nms stuff and I intentionally want to keep it that way. So umm, whats the easiest and most straigthforward thing to do to achieve this? Do I even need userdev?

#

I’m not too familiar with this whole manifest thing in java

bronze ember
#

No you just need to set a manifest entry

rigid prism
#

How do I not find these docs damn, thank you!

#

And I assume this will work for every version

lament scarab
#

yes

coarse hamlet
#

Hi, I am getting the following error when trying to build a multi-module project that uses paperweight-userdev v2.0.0-beta.8.

A problem was found with the configuration of task ':moduleB:compileJava' (type 'JavaCompile').
  - Gradle detected a problem with the following location: 'C:\Users\user\.gradle\caches\paperweight-userdev\613081b689735a1c6be92857491be1a4773c6b9c71a65baf922ee4f718c54ed2\module\io.papermc.paper\dev-bundle\1.21.4-R0.1-SNAPSHOT\paperweight\setupCache\patchedSources.jar'.
    
    Reason: Task ':moduleB:compileJava' uses this output of task ':moduleA:paperweightUserdevSetup' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':moduleA:paperweightUserdevSetup' as an input of ':moduleB:compileJava'.
      2. Declare an explicit dependency on ':moduleA:paperweightUserdevSetup' from ':moduleB:compileJava' using Task#dependsOn.
      3. Declare an explicit dependency on ':moduleA:paperweightUserdevSetup' from ':moduleB:compileJava' using Task#mustRunAfter.

I'm not sure whether this is a bug in paperweight-userdev or a misconfigured project on my part, though this setup works fine with userdev v1.
I've created an example repository to reproduce this here: https://github.com/NichtStudioCode/paperweight-userdev2-multimodule (Just run gradle build)

I've also tried using 2.0.0-SNAPSHOT and disabling shared caches with -Ppaperweight.sharedCaches=false, both of which did not seem to help.

#

Of course, doing what gradle suggests works, but that seems like an odd solution

static urchin
#

whatever that is does not look good

coarse hamlet
#

That is what I meant with "doing what gradle suggests works". Gradle's other suggested solutions also work, but I don't think this should be happening in the first place?

cinder ember
#

hmm

quaint raven
#

paperweight is probably sharing the cache between multiple submodules if they use the same paper devbundle version.

bronze ember
#

not even submodules, its machine wide

static urchin
#

Yea its a global cache, but gradle should not consider that as an output I don't think

bronze ember
#

open an issue pls, that repo is a good minimal repro, jmp can take a look then

static urchin
smoky violet
#

it's a known issue with using the same bundle twice in the same build and fixed by my rewrite, no issue needed

#

and do not try and follow the 'possible solutions', they are wrong

winter glacier
smoky violet
#

you are probably looking for classes in spigot mappings, but they will be in real mappings

#

ie ServerPlayer not EntityPlayer

winter glacier
#

I am not using any classes. I´ve just added paperweight-uesrdev to the build.gradle.kts, nothing more

bronze ember
#

So what exactly doesn't work anymore?

winter glacier
#

other plugins, they are just getting disabled with NoClassDefFoundError

#

[22:56:56] [Server thread/ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'EnderFrame-1.0-SNAPSHOT.jar' in folder 'plugins/.paper-remapped'

bronze ember
#

Please share the whole error, that part is useless

winter glacier
bronze ember
#

Ok, so it's not other plugins that are broken

#

What broke is the shading of libs into your plugin

#

First try updating both the shadow (it now has Gradle up as group id) and the paperweight-userdev plugin

smoky violet
#

no

#

they are just using the wrong jar

#

remove that block where you configure the shadowJar task, set the artifact configuration to MOJANG_PRODUCTION if you are not tagreting spigot, and then use the jar without a classifier

#

or honestly it could be both things lol

winter glacier
#

it helped somehow

bitter linden
winter glacier
smoky violet
#

2.0.0-beta.8

smoky violet
#

when I ran into it years ago

bitter linden
#

I've rebooted my computer multiple times :/

winter glacier
bitter linden
#

Yes

smoky violet
winter glacier
bronze ember
#

As I said, the shadow plugin moved it's group id to gradleup

#

And as jmp said, you are most likely running the wrong jar

winter glacier
smoky violet
winter glacier
bronze ember
#

Change the group id to the new one ^^

prime cliff
#

com.gradleup.shadow

winter glacier
bronze ember
#

Try open the jar and look if the classes are inside, then find the dependency that should add those classes and make sure you assigned it to the right configuration

winter glacier
#

looks like this, but i don´t have any nms classes in the project though

bronze ember
#

Yeah idk why shadow isn't doing anything

#

What task do you run to create that jar?

winter glacier
#

build

winter glacier
bronze ember
#

Paperweight should hook into shadow

winter glacier
smoky violet
#

if you are targeting spigot then make the assemble task dependsOn reobfJar and set paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.REOBF_PRODUCTION, otherwise make assemble dependsOn shadowJar

winter glacier
smoky violet
#

no, I mean if you want the plugin to run on spigot (it makes the build slower and requires remapping on server startup)

winter glacier
#

yea no I dont want it

#

I just want to use it for my own paper server

smoky violet
#

so then tasks.assemble { dependsOn(tasks.shadowJar) } and remove anything changing jar file names

#

then build should produce two jars

winter glacier
#

which one should I use?

prime cliff
#

-all

distant mango
#

full message

smoky violet
#

cut off errors are not useful but that looks like an error in your packet lib

winter glacier
#

it is the full message

smoky violet
#

as in the shading issue is fixed

#

you should relocate your dependencies though

winter glacier
winter glacier
smoky violet
#

seems like your dashboard is cutting out parts of the error, pull the latest.log file

smoky violet
#

relocate into your own package space

smoky violet
#

everything that you shade

winter glacier
#

I dont shade anything

smoky violet
#

your lib is spigot mapped

smoky violet
winter glacier
#

so I need to use the spigot mappings or what?

#

no

#

its a dependency

smoky violet
#

so you are shading it

#

you need to relocate it to your own package space

smoky violet
winter glacier
smoky violet
#

otherwise you need a more complicated build setup where you use the reobfJar and then add the spigot mapped library after remapping in another task

#

yes like that but for everything you shade

winter glacier
#

what exactly means shading though

#

I am just implementing it

smoky violet
#

including the library class files in your jar

distant mango
#

everything you have api or implementation or shadow

smoky violet
#

with shadow

smoky violet
winter glacier
#

so like I have to relocate everything that I implement or "runtimeOnly" or "compileOnly"?

smoky violet
#

by default shadow will include everything from your runtimeClasspath

distant mango
smoky violet
#

well they are either doing it wrong or have overridden other options to make that work

distant mango
#

¯_(ツ)_/¯

winter glacier
prime cliff
smoky violet
distant mango
#

I wasn't recommending anything?

smoky violet
#

idk why you are being so defensive over a small thing, maybe take a break from discord and relax or something

smoky violet
#

you don't need to redeclare the dependency runtimeOnly if it's implementation

#

generally for a plugin use implementation for things you want to shade and compile against, compileOnly for things you want to compile against but not shade, and runtimeOnly for things you want to shade but not compile against

winter glacier
#

I understand like nothing 😭

#

wait wait wait

#

maybe I have it

smoky violet
#

I explained shading is when shadow includes library classes in your jar

winter glacier
#

I found mojangmappings

smoky violet
#

what are you confused about? compiling against something?

#

that means it's on the classpath passed to javac

winter glacier
#

ahhh okay

#

understood

winter glacier
#

thank you a lot

#

and minidigger/martin too!

#

@smoky violet If I want to use nms now, I just have to create the right package, like net.minecraft.world.entitiy.monster and add my classes to it right?

smoky violet
#

you don't create the package

#

you can use classes from nms packages in your code

winter glacier
#

and how can I modify a zombie for example?

smoky violet
#

that's beyond the scope of the build tooling channel

bronze ember
#

(in generally, paper doesn't allow plugins to modify vanilla code, you can only call vanilla code or extend it or modify variables using reflection I guess)

jolly ore
static urchin
#

dies pencil still dead HUH

echo kilnBOT
distant mango
#

no it just died again

static urchin
#

fucking hell

bronze ember
#

Somebody add monitoring so I can auto restart it, lol

static urchin
#

I gotta review paper PRs im busy 😭

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

plugins {
    `java-library`
    `maven-publish`
    id("io.papermc.paperweight.userdev") version "2.0.0-beta.8"
}

repositories {
    mavenLocal()
    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(libs.io.papermc.paper.paper.api)
    paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")
}

group = "me.DJ1TJOO"
version = "1.0-SNAPSHOT"
description = "CustomGUI"
java.sourceCompatibility = JavaVersion.VERSION_16

publishing {
    publications.create<MavenPublication>("maven") {
        from(components["java"])
    }
}

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

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

#

This also works?

static urchin
#

sure

#

but yea, you need to tell gradle that you are running things with java 21

jolly ore
#

Oh I see the sourceCompatibility now. I automaticly converted from maven to gradle, so probably something went wrong there

#

Okay thanks its working!

hollow stump
#

Is there a way I can sync the version in my paper-plugin.yml with my build tool build.gradle.kts?

bronze willow
hollow stump
#

thanks but.. where do i put that in the file build.gradle.kts 💀

bronze willow
#

Normally

crude kernel
crude kernel
#
tasks.processResources {
    val props = mapOf("version" to version)
    inputs.properties(props)
    filteringCharset = "UTF-8"
    duplicatesStrategy = DuplicatesStrategy.INCLUDE
    filesMatching("paper-plugin.yml") {
        expand(props)
    }
}
bronze willow
#

So you can set the props there?

#

Everything you want?

crude kernel
#

Well no, you still need the key to exist

#

i.e. paper-plugin.yml for this: ```yaml
version: 0.0.0 # gets expanded to project.version

frail pelican
#
plugins {
    id("java")
    id("io.papermc.paperweight.userdev") version "1.7.7"
}

group = "net.jandie1505"
version = "1.3-1.21.4-SNAPSHOT"

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

paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION

dependencies {
    paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")
}

Expected configuration ':paperweightDevelopmentBundle' to contain exactly one file, however, it contains more than one file.

This has worked before, but now I have opened the project and it does not work anymore.

bronze willow
#

Update paperweight

distant mango
#

and gradle

winter glacier
#

anyone knows why my gradle files are still getting showed as changes in github even though this is my .gitignore?

bronze ember
#

Because you once added them

#

git rm them

winter glacier
#

just remove the changes?

winter glacier
#

but its in my gitignore

agile skiff
#

gitignore .gradle/* and build/*

bronze ember
#

or just .gradle and build

static trout
bronze ember
#

2.0.0-beta.8

static trout
#

And wich gradle version? I am currently using 8.11

bronze ember
#

at least .2 I think but use 8.12

static trout
#

There is no .12 lol

#

well

#

Not in the Project Wizzard for JavaProjects

bronze willow
#

There is a 8.12

static trout
#

Yup there, but not in the IntellijIdea Wizzard

#

I’m not sure exactly what I did wrong, but I definitely messed something up.

bronze ember
#

pls dont send screen shots of logs

static trout
#

Oh

#

ofc.

#

Can i show my Buildfile?

bronze willow
#

just do it

static trout
#
import xyz.jpenilla.resourcefactory.bukkit.BukkitPluginYaml

plugins {
    `java-library`
    id("io.papermc.paperweight.userdev") version "2.0.0-beta.8"
    id("xyz.jpenilla.run-paper") version "2.3.1" // Adds runServer and runMojangMappedServer tasks for testing
    id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.2.0" // Generates plugin.yml based on the Gradle config
}

group = "dev.subscripted"
version = "1.0.0-SNAPSHOT"
description = "Userdev Test"

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


dependencies {
    paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")
}

tasks {
    compileJava {
        options.release = 21
    }
    javadoc {
        options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
    }

}


bukkitPluginYaml {
    main = "dev.subscripted.Main"
    load = BukkitPluginYaml.PluginLoadOrder.STARTUP
    authors.add("Author")
    apiVersion = "1.21"
}
bronze willow
#

and whats your gradle version?

static trout
#

8.11

bronze ember
#

I want to see the full error

#

and as I said you need at least gradle 8.11.2 or 8.12

static trout
#

i've used 8.11

golden seal
#

there's a difference

#

if mini says you need 8.11.2 then you probably want to try said version

static trout
#

oh shi

#

i didnt saw the 2 behind it

#

Sorry

#

my bad

static trout
#

Okay now everything is working well

winter glacier
#

I have my core plugin from my minecraft network and its paper and velocity together. It all worked until I installed paperweight-userdev. Now the plugin won´t load on the Proxy. How can I fix this?

distant mango
#

#paper-dev and send logs there (and probably your build script)

winter glacier
distant mango
#

then send logs and your build scripts here

#

nvm you went to pd

jolly ore
#

Hello I would like to use the shadow color from adventure that was updated in one of the recent 1.21.4 builds. How do I update the paper version I use in development?

Should I change something about this in the build.gradle.kts:

paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")
static urchin
#

try with ./gradlew build --refresh-dependencies

#

alternatively, the caches are in ~/.gradle/caches/paperweight-userdev/ or whatever that path is on windows, so you could just yank that

bronze ember
#

gradlew cleanCaches or something is also a thing

static urchin
#

oh yea, there is cleanAllPaperweightUserdevCaches and cleanCache

jolly ore
#

cleanAllPaperweightUserdevCaches also doesn't seem to work for some reason

bronze ember
#

after you do that you need to reimport your gradle project in IJ of course

jolly ore
#

Yep, forgot that

#

its fixed now thanks!

smoky violet
#

deleting the userdev cache will not do anything to make the api update

#

(or the dev bundle/server for that matter)

echo sapphire
#

how to fix this issue

Expected configuration ':paperweightDevelopmentBundle' to contain exactly one file, however, it contains more than one file.

quaint raven
echo sapphire
#

Could not resolve io.papermc.paperweight:paperweight-userdev:2.0.0-beta.8.
Required by:
project :common-paper > io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:2.0.0-beta.8
No matching variant of io.papermc.paperweight:paperweight-userdev:2.0.0-beta.8 was found. The consumer was configured to find a library for use during runtime, compatible with Java 21, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.11-rc-1' but:

bronze ember
#

Update Gradle

echo sapphire
#

what version

distant mango
#

8.12

#

also why are you using a rc version

echo sapphire
#

idk what rc means

dusty plover
#

how do I publish the dev bundle to maven local?

dusty plover
#

ty

unique ivy
#

Hey! I have a multi-module project and need to detect the server type (Velocity, Paper, Spigot, etc.) at runtime. I assume the check should be done in onEnable(), but what universal dependency can I use to identify if it's Spigot, Bukkit, etc., without relying on imports that might not be available on all server types?

lament scarab
#

I mean, at least two of those platforms are their own entire thing that have their own entry points that you can detect and pass into your shared code type of deal

#

There is no universal thing here

#

but, you'd just deal with the associated detections on the platform specific side

#

like, if your velocity initialisation logic is what calls into your shared code, you can assume it's something velocity based

#

for the others, you'd basically be Class.forName'ing stuff

unique ivy
#

Oh, ok! Thank you

wide lake
#
plugins {
    id 'java'
}

group 'me.senkoco'
version '1.3.1'

repositories {
    mavenCentral()
    mavenLocal()

    maven { url = 'https://repo.papermc.io/repository/maven-public/' }
    maven { url = 'https://repo.glaremasters.me/repository/towny/' }
}

dependencies {
    compileOnly 'io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT'
    compileOnly 'com.palmergames.bukkit.towny:towny:0.101.0.4'
    compileOnly files("libs/TownyMenus-0.0.11.jar")
}

sourceCompatibility = targetCompatibility = '17'
compileJava.options.encoding = 'UTF-8'
setLibsDirName('../builds')
#

related error: Could not resolve io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT

#

this looks like the problem

No matching variant of io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT:20241228.232114-63 was found. The consumer was configured to find a library for use during compile-time, compatible with Java 17, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
          - Variant 'apiElements' capabilities com.destroystokyo.paper:paper-api:1.21.4-R0.1-SNAPSHOT and com.destroystokyo.paper:paper-mojangapi:1.21.4-R0.1-SNAPSHOT and io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT and io.papermc.paper:paper-mojangapi:1.21.4-R0.1-SNAPSHOT and org.bukkit:bukkit:1.21.4-R0.1-SNAPSHOT and org.spigotmc:spigot-api:1.21.4-R0.1-SNAPSHOT declares a library for use during compile-time, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component, compatible with Java 21 and the consumer needed a component, compatible with Java 17
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
#

oh I just saw it..

jolly ore
#

You need to use java 21 or higher

wide lake
#

yep

#

will people using versions older than 1.21.4 be able to use the plugin though?

jolly ore
#

I think it depends on which api's you are using, but I'm not sure

wide lake
#

well I'm gonna switch from spigot first then I'll get to checking that

#

indeed works much better

rocky geyser
#

uhh anyone able to help me with this paperweight-userdev error?

echo kilnBOT
static urchin
#

throw the entire error when running ./gradlew build or whatever the windows version is (I think just gradlew build

static urchin
#

Welp run it with --stacktrace then and please throw the output at a pastebin not a screenshot

rocky geyser
static urchin
#

/home/anmvc/.gradle/caches/paperweight-userdev/613081b689735a1c6be92857491be1a4773c6b9c71a65baf922ee4f718c54ed2/module/io.papermc.paper/dev-bundle/1.21.4-R0.1-SNAPSHOT/paperweight/setupCache/patchedSources.log

#

check the log file NODDERS

#

presumably wrong java version somewhere

rocky geyser
#

no error on the log

#

in

static urchin
#

can you provide the log

brave widgetBOT
static urchin
#

Yea you have hunk failures

#

which usually means the decompiler was ran with a different java version or generally some different values

#

can you share your build.gradle.kts

rocky geyser
#

i'm guessing for paper?