#build-tooling-help

1 messages · Page 2 of 1

chrome vector
#

Do you have community or ultimate?

distant mango
#

ultimate

#

its intellij looking in the wrong places

chrome vector
#

Hmmm can't find it sorry, also look online but wasn't able to find anything. Even moving my jdk to another partition just worked when running the build script. So I can't help you sadly sorry

open latch
#

@distant mango i keep everything in the wsl2 in the past i set the java thing for example in windows and let wsl2 use this but since a few versions sago this broken and then (dont remember how) change a few things for keep all in wsl2 (java and reps)

distant mango
#

wha

plucky stirrup
#

i am trying to create a project with 2 modules, one for the bukkit part and the second one for the proxy, anyone got any idea why its always throwing this error?

I know that the wrapper task is included in the gradle files but i got rid of them since they should be considered as subprojects and not as a totally independent project

this is my current project build.gradle file
https://paste.gg/p/anonymous/53f765bb90764b189caa57dfbdb0e0b0

#

i happened to fix it by unlinking the 2 projects from the main in the gradle window

#

there were 3 elements now there is only my project and it works great.

obtuse mural
#

I've got a 3-module project, and I'm trying to use paperweight in only 1 of those modules (so paperweight isn't present in any of the other modules & base build.gradle.kts), while still having 1 final jar file at project/build/libs
How can this be done?
When I do gradle reobfJar, there's no jar in project/build/libs, and if I do gradle shadowJar, then there's only a non-remapped jar that would error out if I used NMS
I tried to put kt tasks.shadowJar.get().finalizedBy(tasks.reobfJar) in the module but that also does not give a remapped jar - although in project/module/build/libs the remapped jar is there
I'm just using gradle implementation(project(":module")) in my base build.gradle.kts - how can I make it shade the remapped one instead of the normal?

tldr - how do I setup a multi module project with only 1 module using paperweight while shading all of the modules into 1 final jar?

smoky violet
#

project(":paperweight-module", "reobf")
is how you depend on the reobf artifact of a project using userdev (from within the same build)

obtuse mural
#

ohhhhhh what 👀
I didn't know gradle could do that
I'll try that!

#

oh yep it works! ty 😃

smoky violet
#

yw

runic aurora
#

so when I use ./gradlew applyPatches
I get Command finished with 128 exit code: git -c commit.gpgsign=false -c core.safecrlf=false reset --hard upstream/upstream, also tried with --stacktrace flag and basically got the same thing

cinder ember
#

Did you download as zip or git clone?

runic aurora
#

git clone

cinder ember
#

./gradlew applyPatches -Dpaperweight.debug=true should give more info iirc

runic aurora
#

okay lemme try

#

Okay so that didn't work for me. I think it's prolly because this is Folia I'm trying to work on and not Paper (which is my fault for not mentioning)
Here's that message:
Task '.debug=true' not found in root project 'folia' and its subprojects.

lament scarab
#

windows users...

#

you need to shove the thing in "

lament scarab
#

idk what the exact is

#

was either -D"k=v" or -D"k"=v

runic aurora
#

I don't see any sort of session lock in .git either so I think that it's good?

lament scarab
#

update git

#

otherwise, see antivirus software isn't borking stuff

#

/just use WSL

runic aurora
#

okay I don't think it'd be any anti virus stuff cause I really only use windows defender lmaoo

main mica
#

well that can bork stuff too

jagged rain
#

when I use reobfed jar from paperweight I get errors like these:

distant mango
#

restart server

jagged rain
distant mango
#

show new error

echo kilnBOT
#

Please send large files/logs to a pastebin

distant mango
#

full log

jagged rain
wanton horizon
dusk quail
#

anyone know how i can make gradle shadow minimize not remove classes in me.epic.spigotlib.nms? ive tried ```groovy
minimize {
exclude("me.epic.spigotlib.nms.**")
}

distant mango
#

use slashes

#

me/epic/spigotlib/nms/**

dusk quail
inland lake
#

java.lang.NoClassDefFoundError: net/minecraft/network/syncher/SynchedEntityData

#

Using nms in 100s of other things in the same project

#

Just suddenly started getting this

#
SynchedEntityData dataWatcher = new SynchedEntityData(null);
smoky violet
echo kilnBOT
inland lake
#

I just did

#

Now I'm getting error: void cannot be dereferenced

#

@smoky violet

#

    id "io.papermc.paperweight.userdev" version "1.5.4"

    paperweight.paperDevBundle("1.19.3-R0.1-SNAPSHOT")


    relocate 'org.spigotmc.spigot', 'shaded.org.spigotmc.spigot'
bronze ember
#

Why would you relocate spigot? Lol

inland lake
#

Ok wait I'm confused

#

What am I even trying to do

#

I want to relocate nms

#

Is the paperweight-test-plugin only compatible with paper dev?

proud maple
#

if you don't use any paper specific stuff it'll work on lesser platforms too

inland lake
#

Alright so

#

Do I not even need to include "relocate" at the bottom

proud maple
#

no, relocating nms is not something you ever want/need to do

inland lake
#

Yeah I'm starting to understand now, never used this tool or gradle

#

So I assume the tool automatically remaps nms

proud maple
#

if you use the reobfJar task it will, yes

inland lake
#

I see it now

#

In the gh

#

It's commented out

proud maple
#

you can also make the build/assemble tasks depend on reobfJar to make ./gradlew build reobf too

inland lake
#

Alright so that means

#

That I can just add the id

#

And run reobfJar task

#

I am required to add a paperweightDevelopmentBundle

proud maple
#

you need a dev bundle yes

inland lake
#

Am I just selecting 1.19.3?

distant mango
#

why not .4

inland lake
#

paperweight.paperDevBundle("1.19.3-R0.1-SNAPSHOT")

#

Because the nms used is .3

distant mango
#

yes

inland lake
#

Alright, executing the task now

#

Lets see

#
:installed server artifacts to cache
:done setting up paperweight userdev workspace for minecraft 1.19.3

> Task :compileJava
proud maple
#

that's not an error with paperweight and more an error in your code

#

I'm not sure why you deleted the message that showed you the offending line of code

obtuse mural
#

Using Java 17
I'm getting an error with io.papermc.paperweight.userdev version 1.5.4 with this buildscript: ```kt
plugins {
id("io.papermc.paperweight.userdev") version "1.5.4"
}

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

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

:executing 'apply patches to decompiled jar'
:executing 'apply patches to decompiled jar'

FAILURE: Build failed with an exception.

* What went wrong:
Failed to apply dev bundle patches. See the log file at `...\patchedSourcesJar.log' for more details. Usually, the issue is with the dev bundle itself, and not the userdev project.
```Anything I should try to fix?
Previously I had this error with java 19, but I'm on java 17 now :/ (confirmed with running the command in terminal - still happening)
#
Patch Summary:
 Un-changed files: 2420
 Changed files:    680
 Missing files:    0

 Failed matches:   2
 Exact matches:    4470
 Access matches:   0
 Offset matches:   0
 Fuzzy matches:    0
Overall Quality   99.96%
#

2 failed ☹️

#

for whatever reason this works fine on github actions

#

not sure what's wrong with my local environment

lament scarab
#

run the clean task and try again

lusty spindle
#

can someone help me with a patch for paper?
im trying to apply a "SlimeWorldManager" patch and everytime i try to applyPatches it says the patch is empty.
and phoenix616 the weird bot says the tool cant lie so it must be empty, but none of these patches are empty.
Build-changes.patch has 5kb and SlimeWorldManager.patch has 110kb
and as u can see on the screenshot the file is not empty

main mica
#

Try applying it manually and making a new patch out of that

turbid wing
#

I change from maven to gradle but when export the jar the shadowed dependencies dont appear in the jar file, im using the johnrengelman.shadow plugin

#

I looked in META-INF and all folders but the HikariCP library does not appear

main mica
#

you might need to include the version in the dependency() for the shadow plugin too

#

not sure, but thats like the only thing I can spot that looks off

turbid wing
#

I tried that too, but not works

verbal skiff
#

and in dependencies { } replace shadow with implementation

#

then run ./gradlew shadowJar

#

also, update the shadow plugin to 8.1.1

turbid wing
#

Worked bro

turbid wing
turbid wing
#

@verbal skiff
So i have 2 servers and i want send a shadow jar copy to his plugins folders when i build
I searched in gradle and the shadow plugin docs but i dind't find how
Do you know how do it?

smoky violet
inland reef
#

Im trying to create a paperDevBundle that is a pufferfish fork, but when creating the dev bundle and trying to use it from another project a bunch of stuff breaks, im getting Cannot access net.kyori.adventure.identity.Identified on player objects, Cannot access net.kyori.adventure.translation.Translatable on block object, anyone have an idea on how to fix this?

#

Here is my gradle for the devBundle ```tasks.generateDevelopmentBundle {
apiCoordinates.set("gg.pufferfish.pufferfish:pufferfish-api")
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl,
)
}

publishing {
if (project.hasProperty("publishDevBundle")) {
publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) {
artifactId = "dev-bundle"
}
}
}
}```
and this is for my other project trying to use it:

lament scarab
#

Cannot access would generally either be a java version issue or something is borked with your classpath

#

idk how you'd induce the former given version requirements, and no idea how you'd induce the latter

inland reef
#

Not sure, its very strange because the objects are resolving in my idea, just not working when i compile

#

You see nothing wrong with whati have for the devBundle?

lament scarab
#

Well, I mean, you should probably change the defintion so that you're not infringing on somebody elses namespace

#

as well as the fact that that paperDevBundle doesn't look like the example, but, if it's picking up the dep, eeer... 🤷‍♂️

patent copper
#

Hello, when i want to sync my gradle project then i have this erro: ServerManager:main: Could not resolve io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT. and when i want to build it i have this error: ``` Could not resolve all files for configuration ':compileClasspath'.

Could not resolve io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT.
Required by:
project :
Could not resolve io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT.
Unable to load Maven meta-data from https://repo.maven.apache.org/maven2/io/papermc/paper/paper-api/1.19.4-R0.1-SNAPSHOT/maven-metadata.xml.
Username must not be null!
Could not resolve io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT.
Unable to load Maven meta-data from https://repo.papermc.io/repository/maven-public/io/papermc/paper/paper-api/1.19.4-R0.1-SNAPSHOT/maven-metadata.xml.
Username must not be null!```
Repositories: https://paste.labymod.net/udopufadag.bash

lament scarab
#

Username must not be null!

#

er, your repos apparently blew up

patent copper
#

do i need so specify a username for all repos?

lament scarab
#

no

patent copper
#

how do i fix this?

lament scarab
#

My only guess is that it's pissed off that the one repo where you tried to define that stuff is apparently not properly set or something

patent copper
#

when i remove all repositories but not the paper repository the error still happends

lament scarab
#

best guess would be that it's something in your build config elsewhere

#

like, you have multiple repos screaming about the username being null

patent copper
#

should i recreate the project?

oak copper
#

How do I merge submodules into one jar ? 😄

#

Using gradle btw

#

I have been developing java for a long time so i am kinda embarrassed by that 😄

#

Nvm figured it out

novel pelican
oak copper
lament scarab
#

easy option is generally a dist submodule

#

otherwise, you can basically make the root have the shadowJar task and configure it there

oak copper
#

I included them in the root one

#

All the submodules implement the root one

#

But they do not get merged

lament scarab
#

"included"

oak copper
#

That is root settings.gradle

lament scarab
#

that means literally nothing

#

including it inside of the project just means that gradle will load its config, etc

#

it doesn't make gradle produce a shadowJar, etc

oak copper
#

How do I do it properly?

#

Btw it does produce their shadowJar

lament scarab
#

as I said, either you make the root submodule pull that stuff in through shadowJar or basically setup some task which will produce a merged output (google..); or, easy option is to just setup a dist submodule

#

do you have shadowJar configured in the root module?

oak copper
lament scarab
#

do you have it configured to pick up those modules as dependents?

oak copper
#

No because it does not need any of the classes from the submodules

lament scarab
#

well, there you go

#

you need to actually tell shadowJar what it needs to pick up if you want it to actually pull that stuff in

lament scarab
#

Yes, and if you want the root module to dump out a jar, you need to configure shadowJar in the root project to actually pick up the submodules configurations so it can produce something

oak copper
oak copper
#

Can you please help me 🥺

#

I think I will just make a common subproject and the root will handle the merging

golden seal
#

hello gamers

#

does anyone use gradle composite builds and does buildSrc from an includedBuild work properly

#

trying to use gitpatcher on Velocity but it doesn't seem to find any source / refuses to build anything

#

use the gradle shadow plugin

#

add the kotlin stdlib library as implementation in your dependencies block

golden seal
#

since you rewrote most of that logic into buildsrc recently

#

e.g. running ./gradlew :marina-proxy:build does compile buildSrc since otherwise it would have thrown a stacktrace for unresolved references (which is what happens if you include Velocity instead of includeBuild as a composite build)

hard moss
#

this is the first time im using an external library in my plugin (intellij) and im not really sure how it works.
If I add it as a dependency in gradle.build do I also need to add it as a module or?

granite valve
#

No. If you add it to the build file, just refresh gradle in your IDE

hard moss
#

ah thx

hard moss
proud maple
hard moss
#

nice, thx

karmic grove
#

is there a way to add a directory src/main/template as a java source in my IDE, but not have gradle actually compile the files there?

full stump
#

why?

smoky violet
#

look at what we do for the mcdev sources in paperweight

#

project-util.kt

oak copper
#

Hey I am creating my own fork but I am getting Project with path ':pufferfish-api' could not be found in project ':myfork-server'.

#

I know it is not there

#

But at what step of paperweight should it be created and why wasnt it when there is no error

#

The same was happening for me with paper

#

I use the example configuration of forktest just edited the upstream to pufferfish

main mica
#

How did you edit the upstream?

#

For an upstream that isn't Paper you have to use a different syntax

oak copper
#
paperweight {
    serverProject.set(project(":fork-server"))

    remapRepo.set(paperMavenPublicUrl)
    decompileRepo.set(paperMavenPublicUrl)

    useStandardUpstream("pufferfish") {
        url.set(github("pufferfish-gg", "Pufferfish"))
        ref.set(providers.gradleProperty("pufferfishRef"))

        withStandardPatcher {
            apiSourceDirPath.set("Pufferfish-API")
            serverSourceDirPath.set("Pufferfish-Server")

            apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
            serverPatchDir.set(layout.projectDirectory.dir("patches/server"))

            apiOutputDir.set(layout.projectDirectory.dir("fork-api"))
            serverOutputDir.set(layout.projectDirectory.dir("fork-server"))
        }
    }
}
main mica
#

yeah that seems correct, hmm

oak copper
#

I used Petal as reference

#

So I was sure I use it correctly

main mica
proud maple
#

you need to edit the build.gradle.kts in -Server to point to myfork-api

oak copper
#

I thought it is going to use both

#

Oh I see how this work

#

Yeah thanks

#

I thought it is going to do that automatically

proud maple
#

other than that changing the api path in org.bukkit.craftbukkit.util.Versioning is the only required change you need to make, anything else comes down to branding

karmic grove
#

for future reference

plugins {
    id("idea")
}

extensions.configure<IdeaModel> {
    module {
        sourceDirs.add(file("$projectDir/src/main/templates"))
    }
}
pure fern
#

I've been converting my maven project to gradle, took a while but it mostly works now, except for publishing to maven local. When I build, there are two jars, core-0.1.2.jar and core-0.1.2-dev.jar. Using maven-publish, if I run gradle publishToMavenLocal, only the second jar gets copied to the .m2 folder. The plugin integrating the library is using maven, 0.1.1 works fine, but when I switch to 0.1.2 it can't find it (Could not find artifact dev.michaud.greenpanda:core:jar:0.1.2 in papermc-repo).

brave widgetBOT
gentle viper
#

If I run my server using runDev, plugins such as NBTAPI cannot find the jar version, so will not load, is there anything I can do to run my server in dev mode while specifying a real version that plugins can detect?

bronze ember
#

runDev doesn't obfuscate the source so that plugins that hack into internals get what they expect

#

Either those plugins need to be updated to also work with Mojang mappings or you need to runObf

gentle viper
#

So my real issue is I want to be able to hotswap my forks code, so far I've been running in dev mode and rebuilding, is this the best way to do that, or is hotswapping unsafe?

bronze ember
#

No that's fine

#

Isn't nbtapi open source? Just patch mojmap support into it

gentle viper
gentle viper
bronze ember
#

Yes, dev mode doesn't do relocation and reobfuscation

shut hamlet
#

is it possible to make paperweight userdev use yarn mappings without generating reobf mappings in paperweight core / patcher while publishing the dev bundle?

#

(or maybe it doesn't use exactly reobf mappings for providing the source?)

#

oh, I see that it generates mappings in SetupHandler for remapping

#

but there is still a need for reobf mappings to reobfuscate a jar while building

bronze ember
#

But why

shut hamlet
#

I am making my own gradle plugin based on paperweight

#

I am porting the ability of paperweight to provide paper source to fabric loom, and I need to support other mappings than mojang (making mod dev possible for paper sources)

dense vessel
#

Is there a way to get runMojangMappedServer to use a specific paper version? With runServer you can use build() but this doesn't seem to do anything with runMojangMappedServer

glass warren
#

Depends on the Paper version probably. IIRC mojmaps are only recently available.

dense vessel
#

i was testing it against a version only a couple days old (1.19.4 build 520)

karmic grove
#

is there any way to get kotlin to work with JVM 20? trying to build a project which targets java 20 and I only get:

> Could not create task ':ignacio-api:compileKotlin'.
   > Unknown Kotlin JVM target: 20
distant mango
#

need to use a beta version of kotlin iirc

karmic grove
#

So I'm guessing I need to use 1.9.0-Beta, but that isn't a version on the gradle plugin portal

#

I think I got it to work, I added this repository to both my build source and projects

maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev") // Kotlin Beta
#

That has version 1.9.0-Beta-104 (the current latest version) of the kotlin plugin and stdlib and whatever

distant mango
#

I'm having a really weird issue, I have 3 dependencies axel-common, axel-bukkit and axel-velocity in my common module I have compileOnly(libs.axel.common), which works, in my bukkit module I have
api(projects.malibuCommon) and compileOnly(libs.axel.bukkit), the bukkit module only has access to the axel-common stuff

#

but my velocity module, which only has compileOnly(libs.axel.velocity)can access the velocity stuff

#

I'm guessing that somehow axel-bukkit is not getting published right but doesn't make sense why axel-velocity would work

verbal skiff
distant mango
#
dependencies {
//    compileOnly(libs.axel.bukkit) // doesnt have access to the bukkit stuff, only the common stuff
    // compileOnly(libs.axel.velocity) // has access to velocity stuff & common stuff
}
#
axel-common = { module = "org.minearcade.axel:axel-common", version.ref = "axel" }
axel-bukkit = { module = "org.minearcade.axel:axel-bukkit", version.ref = "axel" }
axel-velocity = { module = "org.minearcade.axel:axel-velocity", version.ref = "axel" }
verbal skiff
#

i cant find it

distant mango
#

private plugin

#

1 seec

#

It worked before so idk why it randonmly stopped working now

verbal skiff
#

where is it published?

#

are you using maven local?

distant mango
#

my own maven repo

#

https://repo.deltapvp.net

verbal skiff
#

maybe try (just to debug) publishing to maven local

#

also, do you see the axel-bukkit module in the repo online?

distant mango
#

yes

#

ok I think I see something?

#

for velocity .jar is getting published but bukkit not

#

could be due to paperweight though

#

hmm okay that works

#

I think

#

Yeah local publish works

oak copper
brave widgetBOT
oak copper
#

Can someone help what is wrong?

brave widgetBOT
oak copper
#

Nevermind I fixed that

distant mango
verbal skiff
distant mango
#

If it's something with my repository that wouldn't explain why the velocity module works

#

And indra hasn't changed anything with publishing to my knowledge

last spade
#

@smoky violet Would it be ok if I PR'ed a change to expose the lib jars from downloadSpigotDepencencies to forks? Paperweight already exposes the source jars of those libraries, I was thinking it wouldn't hurt to do the same for the lib jars themselves since they can be pretty useful for forks down the line [I also kind of need them too ;-;]

distant mango
#

Still can't figure out my issue

main mica
#

Maybe take a look at the decompileMinecraftServerJar.log mentioned in the error, that could contain a more helpful error message

inland wadi
#

Is there a site where I can find a free towny pack?

main mica
#

what 👀

karmic grove
#

can I exclude dependencies from being remapped with reobfJar?

lament scarab
#

Probably not

#

Like, depends don’t really exist there

karmic grove
#

could I include a dependency into the jar after reobfJar is done?

lament scarab
#

Well, yea

#

It’s gradle, you’d “just” add a task that hooks reobjJar and bundles it in

karmic grove
#

Is there a way to get all the class files that a dependency has?

#

I'm not sure how to go about copying the classes into the jar

bronze ember
#

Can't you just run shadow again but with a different config?

prime cliff
#

Doesn't reobfjar executes shadowJar automatically? Just define your dependencies as implementation.

lament scarab
#

they want to include stuff in after reobfJar

#

guessing from their discussion elsewhere its cos they're using java 20 and the remapper doesn't support that atm

prime cliff
#

So basically more a xy-problem. Fixing the remapper to support J20 is the better solution.

karmic grove
#

so in the meantime I need a workaround

prime cliff
#

Just, fork, update dependency, see how good it is working out, pr.
If it takes them to long -> deploy plugin to local maven repo and use it for the meantime.
From my perspective the workaround you trying is more complex.

karmic grove
#

problem is, I did try that, but because I don't know what I'm doing it didn't work

#

cloned tiny-remapper, updated the asm version and published to maven local; cloned paperweight, updated the asm version, couldn't find where the tiny-remapper version is defined, publised to maven local, and had the same error

#

where does paperweight get its tiny-remapper version from?

karmic grove
#

so I got lorenz-tiny working, now denwav/hypo relocates its own version of asm, 9.2, into

Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 64
    at paper.libs.org.objectweb.asm.ClassReader.<init>(ClassReader.java:199)

and I can't update that because it uses some sort of reflection which is illegal in versions above java 17

smoky violet
#

only tiny remapper version is relevant here

#

if you modify/build tr locally iirc there's a configuration you could add resolution restrains to in userdev projects

#

to make it resolve a local version

#

and hope it doesn't break paper patches applying

karmic grove
#

I think I've found it,

tasks {
    reobfJar {
        this.remapper.setFrom("$PATH_TO_LOCAL/tiny-remapper/build/libs/tiny-remapper-0.8.6+local-fat.jar")
        this.remapper.forEach { println("> file $it") }
    }
}

but I don't know if this actually works, since I still get this error:
https://paste.gg/p/anonymous/2d32b801fd5947fa950ae228c6c9a8ce

#

and this error seems to come from dev.denwav.hypo.asm, which uses a relocated version of asm at paper.libs.org.objectweb.asm

smoky violet
#

you probably need an older runtime for gradle still

#

from context i assumed you were shading some dep compiled for java 20 and the remap failed, that error is during mappings gen probably reading jdk classes

dusky anvil
#
plugins {
  `java-library`
  id("io.papermc.paperweight.userdev") version "1.5.5"
  id("xyz.jpenilla.run-paper") version "2.0.1" // Adds runServer and runMojangMappedServer tasks for testing
  id("com.github.johnrengelman.shadow") version "7.1.2"
}

group = "me.godofpro"
version = "1.0.0-SNAPSHOT"
description = "SupperHopper plugin for skyblock"

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

repositories {
  mavenCentral()
  maven("https://jitpack.io")
}

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

  implementation("dev.triumphteam:triumph-gui:3.1.2")

  compileOnly("com.github.MilkBowl:VaultAPI:1.7")
}

tasks {
  assemble {
    dependsOn(reobfJar)
  }

  compileJava {
    options.encoding = Charsets.UTF_8.name()

    options.release.set(17)
  }
  javadoc {
    options.encoding = Charsets.UTF_8.name()
  }
  processResources {
    filteringCharset = Charsets.UTF_8.name()
    val props = mapOf(
      "name" to project.name,
      "version" to project.version,
      "description" to project.description,
      "apiVersion" to "1.19"
    )
    inputs.properties(props)
    filesMatching("plugin.yml") {
      expand(props)
    }
  }

  shadowJar {
    fun reloc(pkg: String) = relocate(pkg, "me.godofpro.superhopper.dependency.$pkg")

    reloc("dev.triumphteam.gui")
  }
}

#

when i added vault api this happened

lament scarab
#

exclude bukkit from vault

dusky anvil
real fable
#

A project that worked out of the box on my last windows 10 installation no longer seems to work, and I'm not sure why, and I have no clue what to do to fix it.
These are my dependencies, am I doing something wrong?

distant mango
#

.2 isn’t supported

#

also that’s the spigot name not mojang name

real fable
#

right okay

#

that's still very strange but thanks

#

so you're saying this is unrelated to paper?

distant mango
#

I'm saying you're using the wrong class name

#

BlockPosition is from spigot's mappings

#

not mojang's

real fable
#

the strange part is that this worked fine literally 1 hour ago

#

but I'll change it to blockpos, thanks

prime cliff
real fable
#

decompiled plugin that was compiled with BlockPosition & paperdevbundle

prime cliff
real fable
#

maybe im just stupid and dont know how compilation works

#

but going from blockposition -> blockpos worked so thanks guys

prime cliff
open verge
#

hey i'm trying to publish my own version of paper to my local maven repo, but it fails every time at the generating java doc section... how can i fix this?

bronze ember
#

Start by showing the error

open verge
bronze ember
#

That is useless

#

Show the actual error above it, lol

#

You have a javadoc error, Most likely introduced via your own changes, the log will tell you what is wrong

open verge
#

cant find it...

#

prob looked over it multiple times

open verge
#

fixed it

#

thx

open verge
#

i'm stuck on something again

#

and that is when i manually add the jar file of my modified paper api in intellij, if i try to get my api as a dependency it wont recognize it

#

this is the error i get when i want to use the build.gradle file

granite valve
#

well you should absolutely be adding it as a gradle dependency

#

did you add your local maven repo as a repository?

open verge
#

yes, this is my build.gradle

#

i have checked the file path and everything looks right to me

granite valve
#

did you specify a valid java version? make sure you are using java 17 in the build.gradle (idk what gradle defaults to)

#

cause you obv can't include a dependency built on a higher java version

open verge
#

let me try real quik

granite valve
#

ok, so my next thing, is that you need more repos, cause you don't have all the transitive deps installed into your local maven repo

#

like adventure for example

open verge
#

would it be possible to just grab them from mavenCentral?

granite valve
#

yeah, just add mavenCentral to your repositories in the build.gradle

open verge
#

okok

granite valve
#

actually, idk if they are all in central?

#

you might have to just use paper's maven repo

open verge
#

oh wait

#

that did it

granite valve
#

now make sure its using your modified api

open verge
#

i just added the mavenCentral( ) line and it build the artifact

#

i think so yeah because i used some things i modified obviously and it still worked

#

or isnt that a sign its using my modified api

granite valve
#

yeah, it should if you used the stuff you modified in the plugin

open verge
#

that was what i was thinking yeah, ok let me start my server haha

#

now i finally can test

#

thx a lot!! i've been struggling way to long with this

leaden grail
#

I've been getting into NMS to modify mob AI, and I feel like I've written a plugin that should work, but after I build it and try to test it on my localhost the server console gets an error saying that it can't find any class from NMS. I've tried following the paperweight/paperweight-test-plugin githubs for what to do, but nothing's changed

#

Is it a matter of what mapping is being used?

main mica
#

The error does not look like an NMS/mapping issue.
Looks like you registered a custom entity and then try to use the API getEntity method on it. Which won't work because there is no API representation of that entity.
Also why is everything in the io.papermc package 👀

leaden grail
main mica
#

certainly makes a it a bit confusing. But yeah, its an issue with the way you create your zHorse, not NMS or the paperweight plugin

leaden grail
#

I fixed that, and now I'm getting the error (I guess two now) I originally got

proud maple
#

make sure you're building via the reobfJar task

distant mango
#

nvm I messed up something for a repo

viscid ledge
#

Hello, how can I do that in my plugins the ä is displayed?

distant mango
#

use UTF-8

viscid ledge
distant mango
#

ideally everything

balmy pelican
proud maple
#

you have 366 errors and that screenshot shows exactly 0

#

the full output would be useful

balmy pelican
brave widgetBOT
balmy pelican
#

@proud maple

#

all i did was remove 2 server patches

golden seal
#

you cannot randomly yank some patchees and assume it works

balmy pelican
#

but now i removed the sand duping patch + bedrock breaking and it doesnt

#

how can i enable those things without breaking it

north flume
#

gravity control + setting the config

balmy pelican
#

i wanna do it by removing the patch

#

can you tell me how to do it that way?

north flume
#

make other patches not depend on it and then remove it

#

good luck Okay

balmy pelican
#

how can i figure which depend on it?

proud maple
#

by dropping the patch in the right way and resolving any conflicts that may arise

balmy pelican
#

whats the right way

proud maple
#

git rebase -i base in the Paper-Server and changing pick to drop

#

but you really shouldn't care this much about the few kilobytes of ram a single plugin takes, even if you run a "low ram" server

#

there's a class in the game that allocates 10MB worth of nothing

main mica
#

You will save more ram by unloading one chunk than by not using that plugin

woeful gate
#

Hey, I've bit problem with building MojangAPI, here's gradle configuration, in attachments is error

plugins {
    `java-library`
    `maven-publish`
}

java {
    withSourcesJar()
    withJavadocJar()
}

dependencies {
    implementation(project(":paper-api"))
    api("com.mojang:brigadier:1.0.18")

    compileOnly("it.unimi.dsi:fastutil:8.5.12")
    compileOnly("org.jetbrains:annotations:24.0.1")

    testImplementation("junit:junit:4.13.2")
    testImplementation("org.hamcrest:hamcrest-library:2.2")
    testImplementation("org.ow2.asm:asm-tree:9.4")
}

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

val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) {
    badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;")
    jarToScan.set(tasks.jar.flatMap { it.archiveFile })
    classpath.from(configurations.compileClasspath)
}
repositories {
    mavenCentral()
}
tasks.check {
    dependsOn(scanJar)
}
brave widgetBOT
woeful gate
#

Okay, issue is, C:\Users\James\IdeaProjects\PaperFork\Paper\.gradle\caches\paperweight\taskCache\decompileJar.jar doesn't exist.

#

How can I fix that?

granite valve
#

Run applyPatches first

woeful gate
thin umbra
#

Hi I'm currently trying to backport my plugin BigDoorsPhysics but I am running into an issue with gradle.

The problem is I use the new teleport flags api whenever possible (I have abstracted my implementation behind an interface depending on the version of mc that is loaded) This works great for versions going back to MC1.17 however since I need to compile the subprojects for J17 I can't go back to MC1.16 because it maxes out its java version at J16. Is there an accepted way to compile different gradle subprojects at higher java versions than the primary project? I have tried messing around with toolchain but it always gives me an error about how a dependency is compiled for a higher version of Java

My project structure is this

- main
  - versions
    - v1_17
    - v1_19
    - v1_19_3

Any ideas what I may be missing?
Or does someone know of a project with a similar structure that I can learn from?

lament scarab
#

There was a disable auto target thing in gradle config for disabling their validation stuff which lets you have more control over the compiler levels iirc

thin umbra
#

I'm not seeing anything like that in the gradle docs. Do you remember if it was a plugin?

#

I didn't post the error initially because it is ungodly long, but here it is for more clarity

brave widgetBOT
granite valve
#

yikes, please paste site

#

or upload file so pencil does it for you

thin umbra
#

yeah I thought discord would message.txt it

#

then it didnt

granite valve
#

what's your settings.gradle file look like?

thin umbra
granite valve
#

I don't think you should change the name like that? doesn't that change the actual name, like the :versions:v17 stuff?

#

then you are referencing it by the old name

#

I'm not a gradle expert, but maybe don't change the name of each submodule in the settings file

thin umbra
#

honestly not sure, I kind of stumbled my way though until it produced a .jar that worked 😛

#

I'll try to clean up and remove that stuff, but I don't think that is causing my root issue

granite valve
#

oh you also seem to have a java version mismatch?

#

like your root project is java 16

#

but some versions are java 17

thin umbra
#

correct that was the issue i was reporting

#

I'm trying to backport to 1.16, but if running on 1.19 I want to use the new teleport api

#

but since 1.16 tops out at J16 the root project needs to be J16 compatible

granite valve
#

maybe you need to set the compile target version to 16 in the java 17 versions

#

javac can compile java for a lower version (assuming you don't use any java 17 specific stuff)

#
tasks.compileJava {
  options.targetCompatibility = "16"
}
``` I think
thin umbra
#

that seems to have moved the problem a bit. Now instead of it complaining my modules are set the wrong version it is compaining about the paper dependency https://pastes.dev/klrZZgxf7y

#

I know the versions need to be compatible for it to compile, but given it is abstracted behind an interface and will only be loaded if a compatible version of java is present. It feels like it should be possible

granite valve
#

maybe set options.sourceCompatibility = "17" too?

#

I think it should be possible too, just gotta find the right combo of settings

thin umbra
#

intellij wasn't a fan of the options. but I'll try it with it now

granite valve
#

on the docs for the java plugin, the compileJava task

thin umbra
#

yeah I saw that too

granite valve
#

oh wait, yeah its not in options.

#

it is just top level like you have

thin umbra
#

It would be janky, but I'm wondering if I could nuke the subproject depenencies and instead compile them separate, shade them into one jar, then use reflection to discover the implementations of the interface at runtime

Edit: this actually worked #build-tooling-help message

#

because as much as this feels like something gradle should be able to do, I'm going through a ton of plugins source rn and they all seem to either not use the new api, or cut off support at MC1.17

#

but I am way too tired to rewrite my entire gradle build sequence rn. So I'll have to pick this back up tomorrow.

#

Thanks for the help Machine Maker ❤️

#

I suppose I could also make a separate git branch for 1.16 and just distribute multiple jars, but where is the fun in that

verbal skiff
#

in fact, you probably should because java 16 is long out of support

cold flame
#

https://paste.helpch.at/tefisubaxe.bash

  bad class file: /home/jitpack/.m2/repository/io/papermc/paper/paper-api/1.19.3-R0.1-SNAPSHOT/paper-api-1.19.3-R0.1-SNAPSHOT.jar(/org/bukkit/plugin/java/JavaPlugin.class)
    class file has wrong version 61.0, should be 54.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
how can I fix this error?```
I am getting this error while publishing my github repository on jitpack
any solutions?
raw gust
#

Also the error seems quite clear, use the correct java version to build it with

#

(As modern Minecraft versions require java 17, not 10 which you try to use)

lament scarab
#

Configure jitpack properly

#

They use an outdated version of Java by default

thin umbra
verbal skiff
#

java 16 hasn't been getting any updates (including security updates) for a few years now

lament scarab
#

They did

#

Paper added a thing to bypass that check at some point

shell leaf
#

It is possible to reuse a Paperweight Gradle Module in a other one ?
For ex:
Folia 1.19.4 -> Paper 1.19.4

To override only folia specific stuff

distant mango
#

what

#

apply@paperweight to root project

#

then use the folia dev bundle for folia module?

shell leaf
#

@distant mango I do adapter loading in that project where i am working.
Means i have a Interface strcuture and loading different adapters for different NMS code Versions.
Now the plan is to use the Paper 1.19.4 Adapter and override in Folia the changed methods

lament scarab
#

Basically, no

#

You can use something like templates to generate source, but, the expectation is generally that one source tree is one source tree

#

You could maybe try to make the folia project depend on the paper one and exclude the paper dependency, but last I knew ides get weird about that

thick turret
#

what is the CI download url? im trying to make a script to auto update paper

bronze ember
#

Don't access our CI directly

glass warren
#

Many builds could be shipped that are incompatible with plugins you have or cause breaking changes. You want to know what you're updating, not do it automatically.

cobalt lava
#

Having issues using gradle to grab the graal js engine, no idea why this is happening, not too experienced with gradle, but i successfully included the libraries

implementation("org.graalvm.js:js:22.3.1")
implementation("org.graalvm.js:js-scriptengine:22.3.1")```
Now i am getting a NoClassDefFoundError when trying to reference the classes (GraalJSScriptEngine), and ScriptEngineManager().getEngineFactories() is not finding the "graal.js" option.  
any help appreciated, thanks
proud maple
#

You need to shade the libraries into your jar using the shadow plugin

rancid wigeon
#

would it be possible to just add it to the classpath instead of shading it?

golden seal
#

sure

rancid wigeon
#

kk

golden seal
#

could potentially use the library loader spigot adds too

rancid wigeon
#

sounds good

#

just to confirm, this is the libraries option in plugin.yml?

#

man I can't help but get excited and feel like I've missed out by not staying up to date since 1.12 lol

scarlet talon
#

So to get the Bukkit-1.19.4 snapshot downloaded into my local maven repository, what should I do?

#

I have run ./gradlew publishToMavenLocal

#

I presume this'll do it

#

No, no it did not

#

Whoops

proud maple
#

that'll publish a mojang mapped server jar to your local repo

#

just use paperweight userdev or see if the "how to nms dev" pin in #paper-dev still works if you don't want to use paperweight for some reason

scarlet talon
#

I can't seem to work out the command to just get it to output the remapped jar

#

I need to compile a plugin that's dependent on the Bukkit remapped jar

#

holomobhealth

scarlet talon
#

Ignore me worked it out

granite valve
#

is there a way for gradle to ignore some modules for a task? like applyPatches on paper... if you have some changes to the Paper-API/build.gradle and the Paper-Server/build.gradle that rely on files in different modules, if those don't exist when you change branches, applyPatches fails until you remove those changes

#

can also just rm -rf the api and server dirs, but its kind of annoying

bronze ember
#

There are individual tasks for server and api patches iirc

granite valve
#

but they still seem to require gradle to resolve valid api and server modules

#

like this, I added a line to the paper-api build.gradle to depend on a non-existent-module

#

this would be fixed by apply patches, or applyApiPatches

#

but I have to manually remove that line in order to run either task to overwrite that change

main wolf
#

What could possibly cause this (in a fork using paperweight):
Caused by: io.papermc.paperweight.PaperweightException: Upstream data file does not exist.

distant mango
#

try a clean build

rare phoenix
#

How can i switch my plugin from spigot to paper api?

distant mango
#

change the api dependency

rare phoenix
#

Whats the 1.19.3 one?

brave widgetBOT
rare phoenix
#

Couldnt find a list

glass warren
rare phoenix
#

Alright ill ask there

glass warren
#

If you're looking for basic API changes

distant mango
oblique sun
#

https://sourceb.in/khotkC1Zd7

Cannot set the value of property 'downloadService' of type io.papermc.paperweight.DownloadService using a provider of type io.papermc.paperweight.DownloadService.

distant mango
#

send build log with --info and/or --stacktrace

oblique sun
lament scarab
#

sigh

#

if you're dealing with a multimodule project, it's generally an idea to like, point that out

#

due to a gradle limitation, you can only add the paperweight plugin to your project once

#

so, do it in the root module with apply = false

#

and then set it up in the relevant children

oblique sun
#

i mean i only had this issue when updating to 1.20

#

i was using 1.19.2

#

also in my root module my gradle kts file is this

import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper

plugins {
  kotlin("jvm") version "1.8.20"
  id("com.github.johnrengelman.shadow") version "8.1.1"
}

group = "net.mysterio"
version = "1.0-SNAPSHOT"

allprojects {
  apply<KotlinPluginWrapper>()
  apply<ShadowPlugin>()

  repositories {
    mavenCentral()
    mavenLocal()
  }

  kotlin.sourceSets["main"].kotlin.srcDir("./src/")
  sourceSets["main"].resources.srcDir("./resources/")

  tasks {
    shadowJar {
      configurations = listOf(project.configurations["shadow"])
      destinationDirectory.set(rootProject.file("./jars"))
      relocate("kotlin", "net.mysterio.kotlin")
    }

    compileKotlin {
      kotlinOptions.jvmTarget = "17"
    }

    compileTestKotlin {
      kotlinOptions.jvmTarget = "17"
    }
  }
}```
distant mango
#

add the plugin to the root module

#

and apply false

oblique sun
#

wdym I'm a bit lost

oblique sun
#

what about my other modules?

distant mango
#

https://github.com/PaperMC/paperweight-test-plugin#notes-read-these

Due to a gradle bug, independently applying paperweight-userdev to multiple projects in a build can result in errors. To work around this, apply paperweight-userdev to the root project with apply false (i.e., id("...") version "..." apply false in Kotlin DSL), and then when applying paperweight-userdev to subprojects don't include a version specification. A more advanced solution would involve adding paperweight-userdev as a dependency to your build logic, see reflection-remapper and the source-remap branch on this repo for examples of this.

oblique sun
#

wait so do I have to add paperweight to the other modules if i'm doing the main one

distant mango
#

add dit to the root project with apply false

#

then add it to whatever module you need it in as well

oblique sun
#

do i put apply false to both id(...) version ... apply false

distant mango
#

only apply false on the root project's build.gradle.kts

oblique sun
#

where do I put it in the root project

distant mango
#

then in wherever you need it just do id("io.papermc.paperweight.userdev") or whatever its called

#

plugins { ... }

oblique sun
#

i'm lost

distant mango
#

under shadow

#

root

plugins {
  kotlin("jvm") version "1.8.20"
  id("com.github.johnrengelman.shadow") version "8.1.1"
  id("io.papermc.paperweight.userdev") version "1.5.5" apply false
}

other module:

plugins {
  id("io.papermc.paperweight.userdev")
}
oblique sun
#
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper

plugins {
  kotlin("jvm") version "1.8.20"
  id("com.github.johnrengelman.shadow") version "8.1.1"
  id("io.papermc.paperweight.userdev") version "1.5.5" apply false
  id("xyz.jpenilla.run-paper") version "2.0.1" apply false
}

group = "net.mysterio"
version = "1.0-SNAPSHOT"

allprojects {
  apply<KotlinPluginWrapper>()
  apply<ShadowPlugin>()

  repositories {
    mavenCentral()
    mavenLocal()
  }

  kotlin.sourceSets["main"].kotlin.srcDir("./src/")
  sourceSets["main"].resources.srcDir("./resources/")

  tasks {
    shadowJar {
      configurations = listOf(project.configurations["shadow"])
      destinationDirectory.set(rootProject.file("./jars"))
      relocate("kotlin", "net.mysterio.kotlin")
    }

    compileKotlin {
      kotlinOptions.jvmTarget = "17"
    }

    compileTestKotlin {
      kotlinOptions.jvmTarget = "17"
    }
  }
}```
#

so like so?

distant mango
#

I believe yes

oblique sun
#

and then my other modules would be this

fun DependencyHandler.shadowApi(notation: Any) {
    shadow(notation)
    api(notation)
}

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

group = "net.mysterio"
version = "1.0-SNAPSHOT"
description = "A base module containing FlashAPI"

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

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
    archiveFileName.set("FlashAPI.jar")
}

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.2")
    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.2")
    compileOnly(kotlin("stdlib-jdk8"))
    shadow(kotlin("stdlib"))
    compileOnly("com.mojang:authlib:3.16.29")
    paperweight.paperDevBundle("1.20-R0.1-SNAPSHOT")
}

tasks {
    assemble {
        dependsOn(reobfJar)
    }

    compileJava {
        options.encoding = Charsets.UTF_8.name()
        options.release.set(17)
    }
    javadoc {
        options.encoding = Charsets.UTF_8.name()
    }
    processResources {
        filteringCharset = Charsets.UTF_8.name()
        val props = mapOf(
            "name" to project.name,
            "version" to project.version,
            "description" to project.description,
            "apiVersion" to "1.20"
        )
        inputs.properties(props)
        filesMatching("plugin.yml") {
            expand(props)
        }
    }
}
distant mango
#

yes

#

try it

oblique sun
#

it's gonna be a while gotta update all my modules before i can update

#

wait how do I add cmds to the build file like so

bukkit {
....
    authors = listOf("devan_mysterio")
    commands.create("help") {
        aliases = listOf("holohelp")
        usage = "/holohelp <args>"
        description = "The main command of FlashDisplays Plugin."
    }
    permissions.create("flash.plugin.holo.admin") {
        description = "Allows players to use FlashDisplays Admin Commands"
    }

    permissions.create("flash.plugin.default") {
        description = "Allows players to see the version after using '/holohelp'"
        default = BukkitPluginDescription.Permission.Default.TRUE
    }
}
distant mango
teal helm
#

I want to change the upstream of a Paper fork from Paper to Purpur. My current solution is to create a normal "GitHub fork", edit the upstream target and then modify the patches so they are compatible with Purpur. Is there any less hacky solution to this problem?

bronze ember
#

do you use paperweight patcher?

#

or is it a literal fork?

teal helm
#

The latter, I didn't find how to change the upstream's upstream from paperweight.

bronze ember
#

use paperweight patcher

teal helm
bronze ember
#

well, that already uses paperweight patcher

#

so just change the upstream and fix conflicts

teal helm
#

I mean yeah, that's what I'm doing

#

I have a fork of the repo with changed upstream and modified patches

#

I'm just asking whether there's a way to achieve this with paperweight

bronze ember
#

no, you cant change the upstream as a downstream

teal helm
#

So, back to my current approach. Is there a way I can separate my "compatibility" patches from the ASP patches? If I understand it correctly, if ASP changes anything in their patches, I will have to do my process again.

#

My only idea was the following:

  • Create a literal fork of ASP
  • Change the upstream to purpur
  • Create a paperweight fork of my fork
  • Add patches to fix compatibility
bronze ember
#

I cant think of a good solution

teal helm
#

ikr? It's horrible!

bronze ember
#

I dont think its worth the effort tbh, but am obiously biased

#

but yeah, your proposal is prolly the best way, but you gonna get merge conflicts in patch files

teal helm
bronze ember
#

but the ASP patches will not apply on a different upstream

teal helm
#

won't they? I just thought they won't compile.

#

Well, I'm going to try it and see.

bronze ember
#

they could

teal helm
#

Yeah, they don't merge

#

gonna try applyPatches and then rebuildPatches on the "literal fork"

#

But I am aware that I will get conflicts when upstream changes, at least it shouldn't be that hard to fix.

#

Yeah that won't work at all

#

Back to the original approach I guess

north briar
#

how can i build folia??

dusky anvil
#
  `java-library`
  id("xyz.jpenilla.run-paper") version "2.0.1"
  id("com.github.johnrengelman.shadow") version "7.1.2"
}

group = "me.godofpro"
version = "1.0.0-SNAPSHOT"
description = "Ranks Plugin"

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

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

dependencies {
  compileOnly("io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT")
  implementation("org.mongodb:mongodb-driver-sync:4.9.1")
}

tasks {
  compileJava {
    options.encoding = Charsets.UTF_8.name()

    options.release.set(17)
  }
  javadoc {
    options.encoding = Charsets.UTF_8.name()
  }
  processResources {
    filteringCharset = Charsets.UTF_8.name()
    val props = mapOf(
      "name" to project.name,
      "version" to project.version,
      "description" to project.description,
      "apiVersion" to "1.19"
    )
    inputs.properties(props)
    filesMatching("plugin.yml") {
      expand(props)
    }
  }

  runServer {
    minecraftVersion("1.19.4")
  }

  shadowJar {
    fun reloc(pkg: String) = relocate(pkg, "me.godofpro.ranks.dependency.$pkg")

    reloc("org.mongodb")
  }
}
``` not sure if it is because i am shading wrong
#

it happens on this line

statsManager = new StatsManager(this);

which is this

public StatsManager(Ranks plugin) {
    Bukkit.getPluginManager().registerEvents(new StatsListener(plugin), plugin);
  }
bronze ember
#

Make sure to restart the server properly

dusky anvil
bronze ember
#

Something is messing with the jar

dusky anvil
# bronze ember Something is messing with the jar
plugins {
  `java-library`
  id("xyz.jpenilla.run-paper") version "2.0.1"
  id("com.github.johnrengelman.shadow") version "7.1.2"
}

group = "me.godofpro"
version = "1.0.0-SNAPSHOT"
description = "Ranks Plugin"

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

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

dependencies {
  compileOnly("io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT")
  implementation("org.mongodb:mongodb-driver-sync:4.9.1")
}

tasks {
  compileJava {
    options.encoding = Charsets.UTF_8.name()

    options.release.set(17)
  }
  javadoc {
    options.encoding = Charsets.UTF_8.name()
  }
  processResources {
    filteringCharset = Charsets.UTF_8.name()
    val props = mapOf(
      "name" to project.name,
      "version" to project.version,
      "description" to project.description,
      "apiVersion" to "1.19"
    )
    inputs.properties(props)
    filesMatching("plugin.yml") {
      expand(props)
    }
  }

  runServer {
    minecraftVersion("1.19.4")
  }

  shadowJar {
    fun reloc(pkg: String) = relocate(pkg, "me.godofpro.ranks.dependency.$pkg")

    reloc("org.mongodb")
  }
}
#

here is the build file

dusky anvil
#

fixed the issue

drifting torrent
#

any clue why this is output when building my plugin when paper-api is set to 1.20?
tried spigot 1.19.4, paper 1.19.4, spigot 1.20 and paper 1.20
it only appears when paper 1.20 is used

some plugins still build fine, but some fail to build due to it it seems pepothink

bronze ember
#

post your whole pom

#

you have something that is broken

#

but its not related to paper

#

something to generate the plugin.yml I guess?

drifting torrent
#

that would be true yes, but this happens on projects without it aswell

#

the plugin.yml plugin has always had that error, doesnt seem to be related to the maven provider one

#

thought it might be because of multi-module projects that it straight up fails to build, but seems not

https://github.com/MineInAbyss/Looty/blob/develop/settings.gradle.kts this project fails to build whilst the one above does not

versionCatalogs {
        create("libs"){
            from("com.mineinabyss:catalog:$idofrontVersion")
            version("minecraft", "1.20-R0.1-SNAPSHOT")
            version("nms", "1.20-R0.1-SNAPSHOT")
        }
        create("myLibs").from(files("gradle/myLibs.versions.toml"))
    }
``` changing it to this gives this

Task :compileKotlin FAILED
1 actionable task: 1 executed
[Fatal Error] maven-resolver-provider-3.9.2.pom:2:1: Content is not allowed in prolog.
[Fatal Error] maven-resolver-provider-3.9.2.pom:2:1: Content is not allowed in prolog.
[Fatal Error] maven-resolver-provider-3.9.2.pom:2:1: Content is not allowed in prolog.
[Fatal Error] maven-resolver-provider-3.9.2.pom:2:1: Content is not allowed in prolog.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileKotlin'.

Could not resolve all files for configuration ':compileClasspath'.
Could not resolve org.apache.maven:maven-resolver-provider:3.9.2.
Required by:
project : > io.papermc.paper:paper-api:1.20-R0.1-SNAPSHOT:20230611.012227-12
Could not resolve org.apache.maven:maven-resolver-provider:3.9.2.
Could not parse POM https://repo.maven.apache.org/maven2/org/apache/maven/maven-resolver-provider/3.9.2/maven-resolver-provider-3.9.2.pom
Content is not allowed in prolog.
Could not resolve org.apache.maven:maven-resolver-provider:3.9.2.
Could not parse POM https://repo.papermc.io/repository/maven-public/org/apache/maven/maven-resolver-provider/3.9.2/maven-resolver-provider-3.9.2.pom
Content is not allowed in prolog.
Could not resolve org.apache.maven:maven-resolver-provider:3.9.2.
Could not parse POM https://repo.maven.apache.org/maven2/org/apache/maven/maven-resolver-provider/3.9.2/maven-resolver-provider-3.9.2.pom
Content is not allowed in prolog.
Could not resolve org.apache.maven:maven-resolver-provider:3.9.2.
Could not parse POM https://repo.papermc.io/repository/maven-public/org/apache/maven/maven-resolver-provider/3.9.2/maven-resolver-provider-3.9.2.pom
Content is not allowed in prolog.

#

the actual "Fatal Error" is present on all projects, but doesnt stop the Blocky one I first linked

bronze ember
#

no clue

#

maybe go to your local maven repo and nuke maven resolve provider folder?

drifting torrent
#

after nuking this it still spits the error, some projects fail some dont

bronze ember
#

idk

#

there is an invlaid xml file somewhere

#

make sure your maven is up to date I guess?

#

or gradle?

#

idk

drifting torrent
bronze ember
#

oh theres some whitespace

#

find that pom on your disk and see if you can add a whitespace after the first line

#

like a empty line

drifting torrent
#

well if im not using mavenLocal as a repo would that matter?

lament scarab
#

Try running the clean task

#

Afaik, those files are valid

#

It’s pretty weird that you have multiple repos reporting the same error

drifting torrent
#

same thing, clean task doesnt fix it

lament scarab
#

But, I mean, that would in part make sense as we literally just mirror central there

#

There was an extra flag to tell it to refresh dependencies

#

Clean and then build with that flag

#

2 second google is mostly just pointing to a mangled gradle caches dir

drifting torrent
#

same thing aaaa

lament scarab
#

Try yeetimg the gradle caches folder

drifting torrent
#

ok wiping my entire gradle cache seems to have fixed it

#

thanks ❤️

drifting lagoon
#

My build always fails when I try to build it on Jenkins:

17:34:40 Execution failed for task ':reobfJar'.
17:34:40 > io.papermc.paperweight.PaperweightException: Execution of 'net.fabricmc.tinyremapper.Main' failed with exit code 1. Log file: /var/jenkins_home/workspace/PaperLib/.gradle/caches/paperweight/taskCache/reobfJar.log Classpath: /var/jenkins_home/.gradle/caches/modules-2/files-2.1/net.fabricmc/tiny-remapper/0.8.6/a584208ddeebec2eb210aaa2a6f8622052c07132/tiny-remapper-0.8.6-fat.jar

The log file contains the following:

Command: /var/jenkins_home/tools/hudson.model.JDK/Java_17/zulu17.42.21-ca-crac-jdk17.0.7-linux_x64/bin/java -Xmx1G -classpath /var/jenkins_home/.gradle/caches/modules-2/files-2.1/net.fabricmc/tiny-remapper/0.8.6/a584208ddeebec2eb210aaa2a6f8622052c07132/tiny-remapper-0.8.6-fat.jar net.fabricmc.tinyremapper.Main /var/jenkins_home/workspace/PaperLib/build/libs/PaperLib-1.20-v1.0.0-dev-all.jar /var/jenkins_home/workspace/PaperLib/build/libs/PaperLib-1.20-v1.0.0.jar /var/jenkins_home/workspace/PaperLib/.gradle/caches/paperweight/setupCache/extractDevBundle.dir/data/mojang+yarn-spigot-reobf.tiny mojang+yarn spigot /var/jenkins_home/workspace/PaperLib/.gradle/caches/paperweight/setupCache/applyMojangMappedPaperclipPatch.jar --threads=1
Can't read input file /var/jenkins_home/workspace/PaperLib/build/libs/PaperLib-1.20-v1.0.0-dev-all.jar.

Does anyone know whats wrong?

lament scarab
#

work out why it can't read that file

#

does it exist?

drifting lagoon
#

No sorry, forgot to add that. The directory is empty :/

#

But only if I execute it on the jenkins. On my computer everything works fine.

compact stirrup
#

Hi so long story short I asked for help in wrong channel before so I will just re-asked here..

so I am having an issue with importing paperweight dependency to my plugin I am relatively new to gradle so I don't know a lot about it and the example plugin is using .kts on build.gradle "config" so I would need a little bit of help on this part 😅

lament scarab
#

I mean, what issue?

compact stirrup
#

so I am not sure how to implement paperweight dependencies into "normal" gradle build config ...

lament scarab
#

Basically, the example plugin iirc notes the required tweaks to the format required for a groovy plugin

#

the kotlin build scripts are generally replacing the groovy ones within the community, and so you're not going to get too much support using groovy

compact stirrup
#

ohh i see so its low key recommended to switch to kotlin build scripts?

lament scarab
#

yup

compact stirrup
#

ahhh oki will do that then .. thanks :)

compact stirrup
#

ok so i somehow managed to get project with kotlin build script.. just for referace I took test plugin code for example just to see if I did everything right and code wise it looks like I did but when it comes to loading the plugin on the server I cant manage to get it working...

this is the error I am getting

[21:37:15 ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'TestTest-1.0.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.2
        at org.bukkit.craftbukkit.v1_20_R1.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:382) ~[paper-1.20.jar:git-Paper-9]
        at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:119) ~[paper-1.20.jar:git-Paper-9]
        at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.20.jar:git-Paper-9]
        at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.20.jar:git-Paper-9]
        at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:39) ~[paper-1.20.jar:git-Paper-9]
        at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.20.jar:git-Paper-9]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.loadPlugins(CraftServer.java:431) ~[paper-1.20.jar:git-Paper-9]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:273) ~[paper-1.20.jar:git-Paper-9]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1103) ~[paper-1.20.jar:git-Paper-9]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[paper-1.20.jar:git-Paper-9]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
lament scarab
#

quote the api-version in your plugin yaml file

compact stirrup
distant mango
#

why does paperclip still use java 6

bronze ember
#

it doesnt

#

its a multi module jar

#

the java 6 module is onyl fallback, to provide user friendly error messages if you dont use 17+

distant mango
#

dont suppose that could be bumped up to 7 or even 8?

#

since new gradle versions don’t support java 6?

#

as a release

bronze ember
#

oh

#

ye if nessasary thats what we should do

distant mango
#

my pr probably failed to build

#

could also have been because i set the toolchain to 17

#

oh it is

distant mango
#

How do you choose what repository paper gets paperclip from so i can test a local build of pc?

bronze ember
#

Doesn't paperweight does that?

#

Oh

#

Read wrong

bronze ember
#

yeah, just change the version their and add mavenLocal to your repositories I guess?

distant mango
lament scarab
#

6 was just like, the "default" version back when we tried to push for 8, and so having the bootstrap class at 6 allowed us to tell people off

dusky anvil
#

i have 1 of my own plugin running on the server and i am creating another plugin to hook into that. how can i do that ?

bronze ember
#

Just add a dependency on that plugin, then you can use it's classes

dusky anvil
bronze ember
#

Well, ideally you don't want to use a libs folder

#

But publish to a proper maven repo, or your local one I guess

dusky anvil
#

alright thanks

cinder ember
#

Hi, how can I add some plugins to my server?

wraith cave
#

you... put them in the folder called plugins

proud jay
cinder ember
#

and where can you add fashion to the server?

distant mango
#

what

devout ledge
#

wat

cinder ember
#

modifications

devout ledge
#

Do you mean fabric?

arctic haven
ripe zephyr
#

im trying to migrate from groovy gradle to kotlin gradle but i have some errors and know nothing about kotlins' gradle anyone can help with the bottom error?

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

Val cannot be reassigned

distant mango
#

change var to val

#

change toolchain.languageVersion = to toolchain.languageVersion.set(..)

twin bison
viral bay
#

How do I shade the kotlin stl into my plugin? I use gradle
java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics

smoky violet
#

using shadow

brave widgetBOT
smoky violet
#

kotlin-reflect doesn't like being relocated with vanilla shadow tho

latent plank
#

any gradle pros here? Is there any way to prioritize the already compiled classes over all dependencies when compiling incrementally? (Other than manually rewriting the javac classpath arg?)

short trench
#

Struggling-

java.lang.NoClassDefFoundError: javax/websocket/DeploymentException
        at io.github.haappi.duckvelocity.Chat.SendDiscordHandler.<init>(SendDiscordHandler.java:19) ~[?:?]
        at io.github.haappi.duckvelocity.DuckVelocity.onProxyInitialization(DuckVelocity.java:33) ~[?:?]
        at io.github.haappi.duckvelocity.Lmbda$1.execute(Unknown Source) ~[?:?]
        at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:56) ~[server.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
        at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:597) ~[server.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
        at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:478) ~[server.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1589) [?:?]
Caused by: java.lang.ClassNotFoundException: javax.websocket.DeploymentException
        at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass0(PluginClassLoader.java:87) ~[server.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
        at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass(PluginClassLoader.java:64) ~[server.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
        ... 9 more

build.gradle: https://hastebin.com/share/uhipimamew.java

#

wait its in libs i didnt have that opened oopsie

#

resolved lol

drifting torrent
eager tide
#

hello! i just want to stream on tiktok while [playing minecraft and have people control my world. need someone to guide me on how

#

i know ill do that

#

but like with java 17

#

oh

#

where

#

thank u

sweet orbit
#

i am confused fr.... installed adoptium java added it in path of user and system variable (also with JAVA_HOME) variable.... but the result... looks like above.

#

no error but no response too

#

fixed it nvm..
problem was C:\Program Files (x86)\Common Files\Oracle\Java\javapath

keen halo
#

||I'm a bit rusty with building java stuff so please excuse any silly mistakes or misunderstandings 🙈 ||
Is there anything I have to specially consider when working with external dependencies in Velocity plugins?
https://docs.papermc.io/velocity/dev/dependency-management#external-dependencies does not mention anything besides shading & relocating which I've done
But using e.g. StringSerializer.class.getName() I still get a Class me.cryne.common.serialization.StringSerializer could not be found despite it being present in the plugin jar

lament scarab
#

generally, no

#

if you're using shade + relocate, only guess would be make sure you grabbed the correct jar, otherwise, provide the logs

keen halo
#

Yep, I checked the hashes and the right jar is loaded… which logs would you need? I've also quickly created a git repo at https://gitea.cryne.me/Paddi/VeloTrack with so everyone can see me messing around with kafka

keen halo
#

The decompiled JAR seems to be correctly built too 🤔

lament scarab
#

the log from the proxy where stuff supposibly blew up

keen halo
#

Oh well… this seems to rather be some issue of Kafka for whatever reason not finding the class

VeloTrack.logger.info(Class.forName(StringSerializer.class.getName()).getCanonicalName());

works fine so I guess the class technically is present

keen halo
#

Okay, the longer I look at this the less this seems to really be an issue with Velocity/my build setup and more like a quirk of Kafka.
Despite the docs https://kafka.apache.org/35/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html saying that the class name should be put in the props, as far as I was able to tell from the actual source, the actual class should be put there. And when I did put the class in the props it worked the error at least changed to something unrelated to classloading.
Soooo thank you but also sorry for kind of wasting your time?!

keen halo
#

After some more adjustments it's working now, so yeah it was no paper/building problem to begin with, sorry

granite valve
#

this isn't a marketplace and this wouldn't be the channel if it was

cinder ember
#

oh okay

#

my bad

distant mango
#

any gradle experts able to help me with something? in build-logic i have a file called extensions.kt with

fun Project.channel(): String {
    return if (project.version.toString().endsWith("-SNAPSHOT")) {
        "Beta"
    } else {
        "Release"
    }
}

and in my build.gradle.kts I have

        channel.set(project.channel())

results in https://i.imgur.com/AIVLVd0.png

distant mango
#

nvm

quick oyster
#

I just reset my PC, and paperweight-userdev is having issues with patches/git, any ideas on how I can fix this?

#

I'm also using my own paper fork dev bundle

distant mango
#

try directly on D:

quick oyster
#

nope, same issue

distant mango
#

that’s not directly on the d drive

quick oyster
#

shouldn't be an issue... one sec

distant mango
#

windows has path limits

#

else try in wsl

quick oyster
#

sadly WSL doesn't work well with our firewall, can't fix it

#

I have the LongPathsEnabled registry key set to 1

distant mango
#

also need to do something in git for that iirc

quick oyster
#

yup, that command's also done

#

Same thing, now on the root of the drive

distant mango
#

¯_(ツ)_/¯

#

does paper itself work?

quick oyster
#

building my paper fork works, will test with paper

#

testing w/ default paper dev bundle

#

weird... that works

#

i'll clear my caches so it pulls from the repo, I prob screwed something up

quick oyster
#

worked

next oracle
#

Hi sorry if this is a dumb question, but does anyone know if I can use velocity on java, to add ram from my pc to a hosted server that i own. Its just a small private server with 1GB, its fine most of the time, but when we are 3 people on it, it lags. So it would be usefull if i could then get the server to also use some of my pc's ram.

golden seal
#

that's not how it works

#

that's not how any of this works

#

wrong channel aswell

next oracle
#

oh sorry.

golden seal
#

it's not possible to do what you're asking and even if it was, RAM is supposed to be extremely fast, having that over the network would break everything

next oracle
#

Ok, thanks for the help.

plucky radish
#

can someone help me with shading my kotlin stdlib

bronze ember
plucky radish
#

a lot but i starred yesterday with makking mod packs

#

if i run shade:shade i get the error message
Failed to create shaded artifact, project main artifact does not exist.

cosmic garden
#

Anyone could help me configuring Kotlin KSP on my velocity plugin? I have set up this on build.gradle.kts:

#

But when I try to build it:

lament scarab
#

I don’t think we use ksp?

#

If we did, that would be in the 3.2.0 snapshots if that was merged

cosmic garden
#

It is necessary to use an annotation processor in kotlin to generate the plugin .json file, I thought

lament scarab
#

Use kept

#

Kapt

cosmic garden
#

I avoided it because of this:

lament scarab
#

Idk, as said, kapt should work

#

Ksp was brought up, but, idk if support for it was merged

cosmic garden
#

All right! I am trying it

#

Thank you!

lament scarab
#

So, not merged

#

Just, also, use the 3.2.0 snapshot builds, 3.1.1 is severely outdated

cosmic garden
lament scarab
#

3.2.0-SNAPSHOT iirc

#

Otherwise, see the maven repo browser thingy

cosmic garden
#

thank you!

#

All working now!

verbal skiff
distant mango
#

I did not, thanks!

cinder ember
#

I was pointed to this channel, so I'll try to ask a question here. What am I doing wrong here:
#velocity-dev message ? (Link so as not to rewrite all the information again)

lament scarab
#

idk if children classloaders have their services registered, afaik they don't

#

you'd need to Class.forName the Driver class from mysql, or use the non registering driver class directly

cinder ember
#

I tried using Class.forname("com.mysql.cj.jdbc.Driver) and Class.forname("com.mysql.jdbc.Driver"), also tried to go without it and without registration, but the error still appears.. exactly the same code works correctly in the paper plugin, where just a dependency is used in maven, but not in velocity, although I shaded the connector as you said.

lament scarab
#

are you sure that you're registering the driver before you try to use jdbc?

#

and, yea, ofc it works perfectly in paper, paper bundles the driver

cinder ember
#

Yes, the error occurs because of this try-catch, and in it the plugin registration is written "higher" than connection=DriverManager.getConnection(). Sorry for so many questions, I just want to calmly write my db-related plugins, but the errors don't even let me start:(

lament scarab
#

what error does that return?

cinder ember
#

java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/

#

And name of db

lament scarab
#

not too sure, outside of "make sure that you don't have any weird spaces in there or something", idk

#

I'd need to have a means to test locally and I really don't have the will to

errant shale
#

does anyone know if i can configure paper settings to make a string dupe work? on minehut

lyric viper
#

anyone know why im getting this error:

:cubed:test: Could not resolve io.papermc.paper:paper-mojangapi:1.20-R0.1-SNAPSHOT.
Required by:
    project :cubed
    project :cubed > io.papermc.paper:paper-server:userdev-1.20-R0.1-SNAPSHOT

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

my build.gradle.kts

https://pastebin.com/P9MGJSkq

coarse ginkgo
#

how can I fix this? trying to build a fork of a fork of Paper

#

had a DNS issue with piston-meta.<something> in the previous build attempt

lament scarab
#

Did you apply patches?

coarse ginkgo
#

yes

#

I already ran createReobfPaperclipJar several times today, it worked, and now it suddenly stopped working

lament scarab
#

Best guess would be to do a clean build

lyric viper
#

i suck at gradle so idk

smoky violet
#

copy the release & toolchain stuff from the test-plugin build.gradle.kts and add the plugin from it's settings.gradle.kts

lyric viper
#

kk ill try

lyric viper
shrewd glen
distant mango
#

does paperweight-userdev do anything with maven publish?

smoky violet
#

no

#

if you want to publish the reobf artifact you need to configure it yourself ```kotlin
publications {
register<MavenPublication>("maven") {
from(components["java"])
artifact(tasks.reobfJar) {
classifier = "reobf"
}
}
}

#

theres a comment somewhere on the paperweight repo about why doing something automatically is complicated

#

and if you need the reobf artifact to be resolved by default don't add the java components

distant mango
#

alright ty, but I"m a little confused. I have 3 projects, project A and B both use paperweight-userdev, project B depends on project A which works, project C without userdev depends on both B & A but is unable to access any of projects A's classes

odd warren
obsidian moat
#

Heya i cant seem to get paperweight to work when i build i get this error:

brave widgetBOT
lament scarab
#

Did you apply patches?

obsidian moat
#

Not yet

lament scarab
#

That would be why

obsidian moat
#

Dont have any options in my IDEA:

distant mango
#

use gradle

#

in terminal

obsidian moat
#

Sorry im not used to gradle. I ussaly use maven. do i execute the gradlew or the one in /gradle/wrapper

distant mango
#

./gradlew

obsidian moat
#

Thx

woeful gate
#

Could someone help me with using shadowJar for HikariCP?

distant mango
#

implementation("hikari cp dependendy")

#

then use the shadowJar task

minor temple
#

Do you know if there is a dependency for paperweight 1.8.8

proud maple
#

no, paperweight wasn't a thing yet back in 1.8

woeful gate
distant mango
#

./gradlew shadowjar

woeful gate
#

task("shade")?

#

well in configurations I can't run it?

distant mango
#

wdym

woeful gate
#

oh waiit

distant mango
#

you just do that command and it'll generate the shadowjar jar

woeful gate
#

there?

distant mango
#

yes or in the intellij menu thing

woeful gate
#

this is that menu?

distant mango
woeful gate
#

oh I see

distant mango
woeful gate
woeful gate
odd warren
#

looks so windows 11 like

woeful gate
distant mango
#

intellij

woeful gate
#

theme

distant mango
#

material darker theme

odd warren
#

it's so polish

#

so curvy

woeful gate
odd warren
woeful gate
#

yes

woeful gate
distant mango
swift cedar
woeful gate
#

I'm gonna look on it when I will be at home, thank you again

verbal skiff
woeful gate
#

Yep I already found if but thanks

distant mango
rancid basalt
#

idk how to do that i cant find any tutorials about shading or adding lib can someone help pls ?

#

Pls help

lament scarab
#

as I said, it depends on the build system you're using which you've not clarified

#

using the library loader or shading is a personal choice of which there is documentation for, once agian, depending on the type of plugin, which you've not clarified

rancid basalt
#

its a paper plugin

lament scarab
#

so, paper-plugin.yml?

rancid basalt
#

plugin.yml

lament scarab
#

so, not a paper plugin

rancid basalt
#

But wdym ? its paper

lament scarab
#

plugin.yml is a bukkit plugin

#

paper-plugin.yml is a paper plugin

rancid basalt
#

oh ok

#

so what now ?

lament scarab
#

I mean, see the link?

#

you add the kotlin stdlib into that section

#

you might wanna use the maven central search thingy to get the artifact coords

rancid basalt
#

wtf

#

i dont understand a single thing

#

pls help

main mica
#

a bit of googling might help. You need to figure out what the artifact coords for the kotlin standard lib are, and then you need to add those to the section that cat mentioned

#

artifact coords are something like io.papermc.paper:paper-api:1.20-R0.1-SNAPSHOT

rancid basalt
#

do i add this one ?

#

anyone ?

distant mango
#

yes

obtuse mural
#

With paperweight, how do I fix the error: Unable to resolve class data binding for 'java/lang/Record' which is listed as the super class for 'zl'? (Full error: https://bytebin.lucko.me/cJgxC8MzQB)
Tried with java 17 and 19 ```kt
id("io.papermc.paperweight.userdev") version "1.5.5"

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}

dependencies {
paperweight.paperDevBundle(getVersionString("1.20.1"))
}

lament scarab
#

that would scream that your jdk setup is busted

obtuse mural
#

atm using ```
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)

lament scarab
#

idk, that generally means that theres something weird with the environment

#

like, it's saying that it can't find the Record class, which is 100% bundled with the jre

obtuse mural
#

wdym environment?
Just tried to reinstall JDK but it won't work
I'll try an IntelliJ-installed JDK

#

hm

#

oh I think I might've been using java 8 accidentally?
idk but I removed everything from my build.gradle.kts besides paperweight, and then put it back together and it works now 🥴

lament scarab
#

because we now push the plugin to the gradle plugin repo instead

obtuse mural
#

ohh so the repo in settings.gradle.kts is no longer needed?

#

nice

pulsar herald
#

Is it worth it trying to get paperweight (userdev) setup with maven if I prefer maven, or is gradle kind of all that is supported

granite valve
#

paperweight userdev doesn't support maven at all

#

there is a 3rd party maven plugin out there that does, to some extent at least, what userdev does, but it isn't supported here

pulsar herald
#

Thanks, since I'm less familiar with gradle, is it as simple as editing the build.gradle on a regular papermc plugin (eg generated with the minecraft dev plugin for intellij) to switch to using paperweight to start learning lower level parts of plugin dev

granite valve
#

You should look at

echo kilnBOT
granite valve
#

Specifically the build.gradle(.kts) and settings.gradle(.kts)

pulsar herald
#

Cheers will do

distant mango
#

Anyone's ever had an issue where if you have 2 project with a build-logic and libs.versions.toml that it uses the other projects libs instead of it's own?

cinder ember
#

Hello I have a multiproject gradle and I want import paperweight in my subprojects so I have put this in the main build.gradle:

plugins {
    id "org.hidetake.ssh" version "2.10.1"
    id 'com.github.johnrengelman.shadow' version '7.1.2'
    id("io.papermc.paperweight.userdev") version "1.5.5" apply(false)
    id 'idea'
}

and in my subproject:

plugins {
    id 'java'
    id("io.papermc.paperweight.userdev")
}

repositories {
    mavenLocal()
    mavenCentral()
    maven { url 'https://jitpack.io' }
    maven { url 'https://repo.kryptonmc.org/releases' }
    maven { url 'https://repo.papermc.io/repository/maven-public/' }
}

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

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}
compileJava.getOptions().setEncoding("UTF-8")

compileJava {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}

dependencies {
    implementation project(path: ':UAAPI')
    compileOnly group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.15.2'
    paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:1.19.4-R0.1-SNAPSHOT")
    compileOnly 'org.spigotmc:spigot:1.19.4-R0.1-SNAPSHOT'

    compileOnly group: 'redis.clients', name: 'jedis', version: '4.4.3'
    compileOnly group: 'com.squareup.okhttp3', name: 'okhttp', version: '5.0.0-alpha.11'
}

But when I refresh the gradle project, I have:

> Task :prepareKotlinBuildScriptModel UP-TO-DATE

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.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 3s

with an error Argument for @NotNull parameter 'module' of com/intellij/facet/FacetManager.getInstance must not be null and NMS isn't mapped

distant mango
#

try doing apply plugin: “…”

#

idk if it matters but that’s what I do

#

also remove your spigot dependency

distant mango
#

nvm

full stump
#

How do I create multiple projects for a plugin? I would like to have a common library and implementations, however I'm not sure how to create a project like that. I am hoping to use Gradle with Kotlin DSL

full stump
#

So I'd have a common library, then a paper plugin, then a velocity plugin.

granite valve
#

yeah, you can have submodules with gradle

#

you just have to add them in the root settings.gradle.kts

#

you can use intellij's "add module" thing to see what it does automatically and go from there

distant mango
#

can also look at paper

#

or any other plugin like essentials or luckperms

full stump
#

hm, okay. i'll try that

#

i'm still finding it kinda confusing- where do i start?

distant mango
#

you define your seperate modules there

#

then you create a directory, for example called "paper" and put a build.gradle.kts in there

full stump
#

yeah but say i have no project right now. where do i start? do i just create the folder and put the gradle files in myself?

distant mango
#

gradle init

#

just press enter each time

full stump
#

that um failed

#

give me a sec

#
$ gradle init
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().
distant mango
#

output of gradle -v

full stump
#

oh. 4.4.1

#

that's some ancient version

distant mango
#

update to 8.2

#

yes

full stump
#

okay great i've got my project

#

in IDEA can i just right click the root folder and press new module?

#

provided i've defined it in the settings.gradle.kts

distant mango
#

uh

#

create a directory, put a build.gradle.kts in there

#

then reload gradle

#

is what I do

full stump
#

okay

#

got it

#

then what

#

do i just create my module folders and start writing code?

distant mango
#

yes

#

i can send you a template (it's on github just not public yet) if you want

full stump
#

if you can that would be great

#

this is what mine looks like right now

distant mango
#

looks good

full stump
#

in terms of naming, for groupId do i just use com.domain.projectname and then for artifact id can i use paper,api,common,velocity

#

orr?

distant mango
#

that's what I usually do, or com.domain,projectname as group then artifact as projectname-submodule

full stump
#

okay

#

if i want to use the same group for all submodules how do i do that

#

without having to redefine in every project file

distant mango
#

either gradle.properties or put it in the allprojects { block

#

in the main build.gradle.kts file

full stump
#

okay got it

distant mango
#

dm'd you something also

full stump
#

yeah got it

#

in that repo, where does the libs.<library> come from?

distant mango
#

gradle/libs.versions.toml

full stump
#

god i'm so confused as to what i need to set up

distant mango
#

well you'll need to apply the "java" or "java-library" plugin

#

f you want to shade, the shadow plugin

full stump
#

under which gradle files

distant mango
#

your main build file

oak copper
#

Can someone please link me an example of multimodule gradle project using paperweight-Userdev

distant mango
oak copper
#

Thanks

#

Btw is it bad practice to put build logic into root

distant mango
#

not sure

#

i like it seperate

lone carbon
#

getting this error.

distant mango
#

you're not properly shading it in

lone carbon
#

this is me pom.xmlhttps://pastebin.com/fRez6QA2

#

what do i need to fix?

distant mango
#

try without minimizing

lone carbon
#

?

distant mango
#

<minimizeJar>true</minimizeJar>

#

remvoe