#build-tooling-help

1 messages · Page 1 of 1 (latest)

lean craterBOT
cinder ember
#

Period .

proud maple
#

incredible

novel knoll
#

first

cinder ember
#

Maybe pin this?

smoky violet
whole brook
#

How do I automatically run buildtools to get the latest spigot jar on startup?

granite valve
#

ban

cinder ember
#

!ban @whole brook treason

loud cloak
#

I'd cry from laughing if the bot would ignore the backslash

iron talon
heavy ginkgo
#

someone know how to compile a plugin using kotlin in maven? because with the default maven with the dependecys i need my source is missing in the jar

lament scarab
shut hamlet
#

I'd like to know how exactly reobfuscation mappings are generated in paperweight and why it requires Hypo. (a library by DenWav) I want to generate spigot -> yarn / mojang, yarn / mojang -> spigot mappings and use them in a fork of fabric loom for a mod development using paper sources and reobfuscate the build output back to spigot. (I've already implemented fabric loader for paper)

lament scarab
#

hypo is probably needed because spigots mappings are broken

bronze ember
#

Hypo cleans the generated mappings

#

Mostly of inheritance errors

#

We had to do that because the mappings were broken in subtitle ways and we couldn't figure out how to fix the cadix libs

#

(we did fix a bunch of stuff in the cadix libs)

smoky violet
#

@dusky anvil what would be the point of using paperweight if you don't need server internals?

dusky anvil
#

and i would have the option to add nms if it's needed whenever

smoky violet
#

The whole point of pw is to use internals, if you add an option to disable that you're basically doing the same thing as not applying the plugin

#

I think just having the test plugin checked out locally is the simplest thing

#

you could use a gradle included build if you want to have the test plugin and it's deps show up in your ide

#

in your settings script includeBuild("path to test plugin")

#

and if you want that locally but not comitted to the repo you can do something like what we do in the Paper repo for it's test plugin project

dusky anvil
smoky violet
#

shouldn't need to make any changes to the test plugin

#

just include the build and when you sync the ide it'll attach everything

dusky anvil
#

alright thanks

smoky violet
#

just tested it myself to make sure there's no issues with userdev and included builds, never tried it before, looks good though

#

Can reference the same test-plugin dir from multiple projects to reduce setup time, recent paperweight will properly handle concurrent instances

distant mango
glass warren
distant mango
#

#

pw 1.5.2,
paperweight.paperDevBundle("1.19.3-R0.1-SNAPSHOT") in my dependencies build.gradle

#

using the groovy dsl

already tried ./gradlew cleanCache then ./gradlew clean build

smoky violet
#

do you happen to be using or have a jdk >= 19 installed

distant mango
#

i have my min toolchain set to 19 with indra

#

targetting 17

tender edge
#

is this a "I should poke shrimp about that FF branch" thing?

distant mango
#

So is the solution to use java 17 as toolchain orrr?

tender edge
#

that would probably fix things

#

longer term I need someone to, like, degauss my brain so I can actually do things

distant mango
#

what "FF branch"

#

and okay i'll switch back to 17

tender edge
#

forgeflower

smoky violet
verbal remnant
heavy ginkgo
#

i cloned the geysermc repo and im using lang level 17 so WHY is this error?

#

even if i click set language level to 14 nothing is changed

distant mango
#

it’s set to 8

heavy ginkgo
#

no

distant mango
#

yes

#

screenshot ur modules

heavy ginkgo
distant mango
#

click on parent

#

and then main

heavy ginkgo
#

its always 17

distant mango
#

all of them?

heavy ginkgo
#

ye

distant mango
#

so if you click on spigot then on spigots main it’s also 17?

heavy ginkgo
#

but why is intellij not changing it on click set language level to 14

verbal remnant
#

u might need to change what JDK gradle is using, its Settings -> Build Tools -> Gradle -> look for something that says like SDK / JDK near the bottom

#

@heavy ginkgo

heavy ginkgo
#

but its fixed now

heavy ginkgo
verbal remnant
#

hmm

#

dont laugh or get mad at this, but have u tried r restarting intellij

harsh stone
#

Any clue why I am getting this

class io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject cannot be cast to class io.papermc.paperweight.userdev.internal.setup.UserdevSetup (io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @1813c18a; io.papermc.paperweight.userdev.internal.setup.UserdevSetup is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @5889322b)
#
    apply plugin: 'io.papermc.paperweight.userdev'
    apply plugin: 'com.github.johnrengelman.shadow'


    shadowJar {
        zip64 = true

        // Relocations


        dependencies {

        }
    }

    dependencies {
        if (findProject(":shared") == null) {
            api project(":libraries:shared")
        } else {
            api project(":shared")
        }

        paperweight {
            paperDevBundle "1.19.3-R0.1-SNAPSHOT"
        }

        compileOnly libs.protocollib
    }

    build {
        dependsOn("reobfJar")
        dependsOn("shadowJar")
    }
trim mesa
#

I've just tried to switch my project to use userdev, but it seems to be missing stuff like Player#sendMessage(Component), PersistentDataContainer and other stuff.

plugins {
    id("java")
    id("com.github.johnrengelman.shadow") version "7.1.2"
    id("io.papermc.paperweight.userdev") version "1.5.2"
}

group = "cx.leo.prison"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
    maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
    maven("https://jitpack.io/")
}

dependencies {
    // PaperMC-API
    paperweight.paperDevBundle("1.19.3-R0.1-SNAPSHOT")

    // PlaceholderAPI
    compileOnly("me.clip:placeholderapi:2.11.2")

    // Vault
    compileOnly("com.github.milkbowl:VaultAPI:1.7")

    // https://search.maven.org/artifact/dev.triumphteam/triumph-gui/3.1.3/jar
    implementation("dev.triumphteam:triumph-gui:3.1.3")
}

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

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()
    }
    shadowJar {
        fun reloc(pkg: String) = relocate(pkg, "${project.group}.library.$pkg")
        reloc("dev.triumphteam.gui")
    }

    build {
        dependsOn(shadowJar)
    }
}
distant mango
#

vault might be imcluding bukkit api

#

check it's transitive dependencies

trim mesa
smoky violet
smoky violet
#

@muted gazelle you need to use the shadow plugin, see the shadow branch of the test plugin for an example

golden spade
#

i'm trying to use this but "Task with name 'assemble' not found in project ':v1_19_R2'"
how can i fix it and why not found when it exactly exists? named("assemble") also doesn't help

subprojects {
    apply(plugin = "io.papermc.paperweight.userdev")

    tasks {
        assemble {
            dependsOn(named("reobfJar"))
        }
    }
}
smoky violet
#

you're not applying the java plugin

#

which applies the base plugin, which creates those lifecycle tasks

#

or if you are applying java it's in the subproject script and happens in the wrong order

golden spade
#

oh, okay. now I have this. how can I ask shadowJar to include this dependency only after reobfJar task (task only in module :v1_19_R2)?
upd: implementation(project(":v1_19_R2", configuration = "reobf")) - correct?

smoky violet
#

the one in the text block is correct

hollow stump
#

I wrote this on my phone but should be correct

smoky violet
#

you need to resolve this circular dependency

#

looks like you have api depends on main depends on api

#

after fixing that if there's still issues send another scan, this one doesn't have dependency info because of that failure

hollow stump
#

The problem is in FlowCoreModeration

smoky violet
#

well, your build is broken, can't debug anything else until the circular dep is fixed

#

if you look in the dependencies tab you'll see it's empty, the failure was before any resolution could happen

hollow stump
#

Aha

smoky violet
#

so I can't inspect your dependencies for your issue, not sure how intellij even imported the project (unless it was imported before it broke)

hollow stump
#

Well the API doesn't need to depend on the main, but the main does depend on the API

hollow stump
smoky violet
#

sometimes intellij does weird things with broken gradle builds

#

like hiding errors or half importing

#

so yeah, just remove the dependency on core from api, and if the issue persists after refreshing the project send another scan

hollow stump
#

I actually realized that API does depend on the main class of the main module (the initial plugin)

#

I will try my best to make the API standalone actually

#

Could be my bad

#

Don't know what I was thinking

smoky violet
#

the hacky way can be with reflection, but in the end you just need to get rid of the circular dep one way or another

#

better way is restructuring things so its not needed

hollow stump
#

I probably don't need reflection

#

Yeah I'm gonna restructure things

hollow stump
#

Restructured 100%

#

Well not 100% because I made an API class and a lot of classes depend on that now

#

Activated

#

Also please don't look at my infastructure

#

If you do then you will be more than excited with an Intel core i3 with 4gb ram laptop

#

IFlowCore is an abstract class

smoky violet
#

it only resolved the deps for api

#

since the rest depends on api and you don't have parallel on

#

which parallel will exit once api fails anyways, so probably wont resolve still. need to fix the code first

willow shard
#

can someone help me out? ive been stuck on this error for a couple hours now while trying to fork a paperweight project

main mica
#

does the fork itself build?

willow shard
main mica
#

did you run applyPatches?

willow shard
main mica
#

just run the command from the command line instead of your IDE (gradlew applyPatches)

smoky violet
#

that looks like it might be a bug

#

but you would have to be realizing the generateDevelopmentBundle task early for it to show up

#

@willow shard try with 1.5.3-SNAPSHOT (needs the paper repo in settings)

willow shard
smoky violet
#

I just use linux :p

#

(the error, not wsl)

rapid fractal
#

jmp iz gradle wizard AYAYARie

smoky violet
willow shard
smoky violet
#

surprising no other forks reported it

#

I'll push 1.5.3 sometime soon with that fix

golden spade
#

I wanna publish my project to my local repo. trying this but "Unresolved reference: maven/mavenJava" happens. (kotlin DSL)

plugins {
    ...
    `maven-publish`
}

publishing {
    repositories {
        mavenLocal()
    }
    publications {
        mavenJava(MavenPublication) {
            from(components["java"])
        }
    }
}

fixed with:

create<MavenPublication>("maven") {
   from(components["java"])
}
golden spade
static urchin
#

Sources jar only won't get you anywhere?

golden spade
static urchin
#

The sources jar is an additional artefact to the compiled dependency

#

You don't depend on "just" the sources

#

Concerning that usually you cannot compile against just the source

golden spade
#

sooo, I did it and it works perfectly. I can see comments and javadocs

plugins {
    `maven-publish`
}

java {
    withJavadocJar()
    withSourcesJar()
}

publishing {
    repositories {
        mavenLocal()
    }
    publications {
        create<MavenPublication>("maven") {
            from(components["java"])
        }
    }
}
static urchin
#

Yea thy deploys the binary, the javadocs jar and the sources jar

smoky violet
#

@wanton cargo paperweight doesn't auto update unless you used + in your version declaration

#

the dev bundle is a snapshot though, you can either pin specific snapshots or use ```kotlin
configurations.paperweightDevelopmentBundle {
resolutionStrategy.cacheChangingModulesFor(3, "days")
}

#

in general the updates won't take more than a couple seconds, when the decompiler, mappings, or ats change it can take longer, which in the last version the decompiler changed

wanton cargo
#

I needed to open the task manager and kill the proccess

smoky violet
#

like I said, pin a specific snapshot, or set a resolution strategy

wanton cargo
#

because it was using 100% of my cpu

smoky violet
#

I mean, it's decompiling

#

it takes some horsepower

#

it only decompiles again when it needs to, see the conditions I mentioned above

wanton cargo
#

this is my build.gradle

#

I am using a multi modular project

smoky violet
#

you're like, 6 versions out of date on paperweight (latest is 1.5.3)

#

but I already gave you two solutions and linked the docs

#

if you have more specific questions I can answer them

wanton cargo
#

and how I pin a specific snapshot?

smoky violet
#

open the paper repo in your browser, and locate the dev bundle

#

it will show a bunch of versions with timestamps instead of -SNAPSHOT

#

pick one

#

in 1.5.3 paperweight.paperDevBundle 'version' will also work in groovy

#

for the bundle dep declaration

smoky violet
#

you have paperweight on the classpath twice somehow

wanton cargo
#

maybe it is because I have it in 2 modules?

smoky violet
#

create a build scan and send the link after you activated it

wanton cargo
smoky violet
#

you're applying different versions, you need to only declare the version in the root project like described in the test plugin readme

wanton cargo
#

ohhh

#

I have so many modules that I forgot to update their build.gradle

#

thanks

willow shard
#

is there any way to import all minecraft classes to a fork?

granite valve
#

you don't want to do that. you will have to fix a 1000 decompile errors in order to compile

#

they should be available as sources tho

willow shard
granite valve
#

I think paperweight only supports 1 per line in the configured file for dev imports

willow shard
granite valve
willow shard
#

thank you

granite valve
#

would be epic if that supported regex... ||jmp||

#

oh @smoky violet was looking at the pw mc dev stuff, we don't need the banned classes stuff anymore, that is all in the io.papermc package now

#

also, I would totally work on adding regex support for dev-imports if you'd accept it, I'd find that really useful for some things. (mainly like NOT typing out the full name for classes that def only have one named that)

granite valve
shut hamlet
#

does paperweight have an ability to generate a remapped patched server jar and add it as a dependency without decompiling it?

smoky violet
#

java has api for doing it on Paths

smoky violet
#

for a variety of reasons it's not really an advertised feature or something we want to support outside of ci

#

but, nothing stops you from setting the property

#

just no guarantees it will stay there or have notice when/if it's removed, but I don't see it being removed in the foreseeable future

shut hamlet
#

thanks

smoky violet
#

also for pre-1.18 bundles it will have to decompile regardless

#

iirc

#

might be wrong on that one though

shut hamlet
lament scarab
#

Because you can't ship that stuff publically

misty night
#

When I use paperweight-userdev, gradle says that it misses a lot of dependencies such as fastutils and authlib, how do I fix this?

distant mango
#

share log

misty night
# distant mango share log
:Spoof-Spigot-19r3:test: Could not resolve com.mojang:authlib:3.16.29.
Required by:
    project :Spoof-Spigot-19r3 > io.papermc.paper:paper-server:userdev-1.19.3-R0.1-SNAPSHOT

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

distant mango
#

can you send your build files

lean craterBOT
#

Please send large files/logs to a pastebin

distant mango
#

Make sure you're applying user-dev at the root project

misty night
#

thanks

#

@distant mango

#

doesn't work

#
pluginManagement {
    repositories {
        gradlePluginPortal()
        maven { url "https://repo.papermc.io/repository/maven-public/" }
        maven { url "https://libraries.minecraft.net/"}
    }
}

plugins {
    id("io.papermc.paperweight.userdev") version "1.5.2" apply false
}
#

Added the plugin like that

distant mango
#

might need to add it in the root build.gradle(.kts)

misty night
#

oh shit

misty night
smoky violet
#

Variant 'apiElements' capability io.papermc.paper:paper-api:1.19.3-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 17 and the consumer needed a component, compatible with Java 8
#

you need to set java 17

#

same error for authlib

#

and dfu

misty night
#

ahh

misty night
#

all SDK's are set to coretto 17

#

and I have added java { toolchain { // Defines project's jvm build version. If its not found on the system it downloads it from the internet. languageVersion = JavaLanguageVersion.of(17) } }

#

to all scripts

smoky violet
#

also add the release.set part from the example script

smoky violet
#

I mean, now you just have compile errors

#

is your code already for 1.19.3?

#

and just using spigot mappings?

#

or is it for an older version as well

misty night
#

didn't realize that

#

😂

#

thanks jmp

smoky violet
#

there is an auto source remapper

#

thats why I asked those questions

misty night
#

@smoky violet one last thing, the userdev doesn't come with craftbukkit

#

how would I import that?

smoky violet
#

it does

static urchin
misty night
#

sorry new to gradle 😅

smoky violet
#

you probably have the wrong version import

misty night
#

i do

#

you are so right

#

omg

dull inlet
#

Jmp is generally so right omg

violet talon
#

I'm trying to publish my packages to maven central through github ci which auto build the code and publish them. I'm using kyori indra publishing plugin, and I'm using in-memory pgp keys by using the gradle signing plugin:

signing {
    val signingKey: String? by project
    val signingPassword: String? by project
    if (signingKey != null) {
        useInMemoryPgpKeys(signingKey, signingPassword)
    }
}

on ubuntu this works fine, on windows and macos the signing fails: https://paste.gg/p/anonymous/453017646ab74b95a3b69fcb14b243d5

lament scarab
#

gpg: signing failed: No secret key

#

I'm going to place a guess, and guess that you don't have your secret key installed on there

violet talon
#

I pass the key in through GH actions:

      - name: "Publish release"
        if: ${{ env.version_type == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
        run: ./gradlew -PforceSign=true publishToSonatype closeSonatypeStagingRepository
        env:
          CI_PUBLISH_CORE: ${{ matrix.publish-core }}
          ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
          ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
          ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
          ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}

I've tested if signingKey is not null by adding a println inside the != null block, and I do get output there during the build. So signingKey is passed in, and I'm assuming useInMemoryPgpKeys is also called therefore, but gpg just doesn't find it

#

On whatever runner that CI_PUBLISH_CORE is set, the run will work fine. If on that runner that variable isn't set, it fails to sign.

lament scarab
#

signing key being not null, and your gpg secret key being installed, are two entirely different things

violet talon
#

Which is weird, because that core variable has nothing to do with signing

violet talon
lament scarab
#

that message is coming from gpg

#

gpg is saying that there is no secret key

violet talon
#

Yes, but I've never installed a secret key on any machine, and it ran fine on the ubuntu runner before

#

I just pass the key and pwd in through environment variables, and use useInMemoryPgpKeys

granite valve
#

do I have to do anything special to get a fork's devbundle to to be used from maven local? when I try to refresh the gradle project using the dev bundle it says there are bunch of patch apply failures. I looked at the patchedSources.jar.log and its over 1000 hunks failed

#

ok, updating the decompiler/rempapper fixed a bunch, now only 47 hunks aren't applying

#

bleh, it works with the paperweight-examples right away. so I guess I have some small thing mis-configured

granite valve
main mica
#

that still looks like an old decompiler version to me (?)

#

Paper is at 627.2 and you are at 605.1

#

(and thats what caused random dev bundle issues in the past for me at least)

granite valve
#

oh I just used what's in paperweight-examples. I didn't even think to check if paper was newer than that

#

yeah, that was it. confused as to why I was getting it to work with the fresh paperweight-examples then, but whatevers

bronze ember
#

Somebody should update that then and we should remember updating it when paper updates

granite valve
#

there's so much stuff like that that needs to be auto updated, but its all in different formats and stuff

#

like updating both paperweight-examples and paperweight-test-plugin

#

it'd be easier if updating paper or paperweight auto opened issues requesting an update on all the places

bronze ember
#

Alternatively we do what we do at work and have patch days, every X weeks, make sure x y z are fine

#

And just have a list you check every X weeks

granite valve
#

yeah, that'd work too

weary jay
#

I keep getting this error

org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/gradyn/McsMigrationManager/McsMigrationManager has been compiled by a more recent version of the Java Runtime (class file version 63.0), this version of the Java Runtime only recognizes class file versions up to 61.0

I dont even have java 19 installed.

#

im even building with the same JDK that im running paper with

#

still dont know what the issue was but i deleted target and ran package again from scratch and now its working thisisfine

toxic plover
#

My only Suggestion: did you trie to set Version 17 in the pom.xml?

#

I got the same error a few hours ago and this was the Problem.

dense leaf
#

I sadly run into an error when using paper patcher in our custom fork of paper when upgrading from paperweight 1.4.1 to paperweight 1.5.X. The build scripts have not been touched between versions, I can provide a gradle build scan: https://scans.gradle.com/s/2qaqpajyujino

Does anyone know what Project : declares a dependency from configuration 'serverRuntimeClasspath' to configuration 'consumableRuntimeClasspath' which is not declared in the descriptor for project :. could mean?

main mica
#

try using 1.5.4 instead of 1.5.3. There was a very similar looking bug that jmp fixed a few days ago, maybe its that

smoky violet
#

1.5.3 was the fix for that

#

need to see the scripts like I said on github

dense leaf
#

alright. Is it ok if I send them as PM?

smoky violet
#

what do you need to hide in your build script

dense leaf
#

not really that much. Its just technically bound by an NDA

smoky violet
#

I mean I didn't sign the NDA either lol

dense leaf
#

I know - whatever I'll just send it to you. Its not a significant portion of code or any creative thing anyways

#

also no use in sitting on code that does not work 😄

distant mango
#

try replacing -SNAPSHOT with 5.0.0-SNAPSHOT in build.gradle.kts for protocollib

shell leaf
#

How i set the slug/owner for the hanger paper publish grade plugin ?

smoky violet
#

update to 0.0.4 for the examples from the readme to work

left laurel
#

Hi, not sure if this is the right place to ask, but I was wondering if there was any way to import minecraft's own data files (the json files found in data/minecraft, for example data/minecraft/dimension_type/overworld.json) to a fork so I can edit them. Putting the file name in dev-imports.txt doesnt seem to work.

granite valve
#

No, not supported by paperweight atm. There’s an open issue tho. You can just make a datapack to override those files

left laurel
#

ok, thanks

sharp trellis
#

hi, i have multimodule project, and i'm trying to implement one of modules that uses paperDevBundle, and unfortunately, it's only executing jar, not assemble

#

how can I fix this

smoky violet
#

the question doesn't fully make sense but I am guessing you want to depend on the reobf configuration of the paperweight module

sharp trellis
#

if i correctly understand you, yes

#

now i have implementation(project(":v1_19_R2"))

#

but it runs jar task instead of reobfJar or assemble

smoky violet
#

project(path, configuration)

sharp trellis
#

project(":v1_19_R2", "reobfJar") like this?

smoky violet
#

the outgoing config is just reobf

#

reobfJar is the task

sharp trellis
#

it works, thanks!

smoky violet
#

yw

full stump
#

Hi, trying to set up https://github.com/HangarMC/hangar-publish-plugin, getting:

org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'io.papermc.hangar-publish-plugin'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)```
#

in plugins i have id("io.papermc.hangar-publish-plugin")

smoky violet
#

(plugin dependency must include a version number for this source)

full stump
#

it wasn’t able to find 0.0.4 either

smoky violet
#

I mean, it's a standard publication on the plugin portal

#

did the action not go for 0.0.4 maybe

#

apparently github does not trigger release action for pre releases

#

I was gaslighted last time

#

now 0.0.4 is published

shell leaf
#

It is possible to disable re-obfuscation for own compilation

proud stirrup
#

for a plugin using userdev or paper/a fork?

#

or something else?

shell leaf
#

paperfork

#

Just for internal testing of our team

#

Will never be publish public

proud stirrup
#

you can use the task createMojmapBundlerJar

#

or potentially createMojangMappedBundlerJar. I don't quite remember which is used there. one or the other. check ./gradlew tasks

shell leaf
#

Thanks thats was i searching for

shell leaf
#

It is possible to install devBundles locally ?

prime cliff
#

Yeah, at least I did it once.

granite valve
shell leaf
#

Thanks, also make compile able

full stump
#

If I have two publications, and don't want to redefine apiKey and platforms across both of them (they're identical), how would I avoid having to do that?

#

do i set io.papermc.hangar-publish-plugin.default-api-key as an environment variable?

median stratus
full stump
#

Could you reword that? Not sure what you mean.

prime cliff
median stratus
#

I created a Simple Gradle project on Intellij and after adding the lines from website:

#

Unresolved reference: toolchain
Unresolved reference: JavaLanguageVersion

full stump
#

send error and your gradle project

prime cliff
#

It's something that changed with Gradle 8 if I remember right.

median stratus
median stratus
#

Is there a simple way to add it like spigot?
Or an alternative like it?

bronze ember
#

Not really, no, we recommend getting comfortable with maven or Gradle

dusky timber
#

Adding dependencies that way is the least "simple" way :)

smoky violet
#

and publications is a NamedDomainObjectContainer, you can use all of the standard methods to configure things (ie configureEach)

median stratus
# dusky timber Adding dependencies that way is the least "simple" way :)

I don't know. For my seams more simple to add just one file and has all in it what I need. Than wait for Maven to download resources and to edit the pom every time and to press Install Changes.
For my seams more time spend to setup than 2-4 clicks and is done.
Maybe because I never used.
But if I want to update some mods I need to change many things.
Not just remove the spigot and add paper.

dusky timber
#

Maybe because I never used.
That is the issue.

smoky violet
#

mhm, if you don't know how to operate a tractor using hand tools will seem simpler

#

learn to use proper build tooling, you'll thank yourself later

sharp trellis
#

what versions does paperweight support?

smoky violet
#

1.17.2+

sharp trellis
#

okay, thx

lean craterBOT
smoky violet
#

or it might be 1.17.1+

#

I forget

#

its .1+ then

tawny horizon
#

all other modules are working fine, but 1.19.4 module can't find the dependency

#

wait what paperDevBundle is deprecated now?

smoky violet
#

can you build with --scan and activate/send the link

tawny horizon
#

sure

smoky violet
#

paperweight.paperDevBundle

#

it uses gradle extensions instead of top level kotlin functions now so it works on groovy

tawny horizon
#

why dont you just tell groovy users to suck it?

#

(i haven't updated all of mine to kotlin yet but a couple days ago i just got chatgpt to do it all for me)

smoky violet
#

even with the difference outlined in the build script it was still a common thing people ignored and asked about in discord

#

many times a week

tawny horizon
#

pain

smoky violet
#

easier to just make it work

tawny horizon
#

i guess yeah but i dont see a reason to deprecate it

smoky violet
#

will get removed in 2.0

tawny horizon
#

oh for fucks sake building with a scan is building everything again

smoky violet
#

top level extensions are super hacky

tawny horizon
#

oh

#

wouldn't it just be DependencyHandlerScope.paperweight()? what's weird about that?

smoky violet
#

putting things in the root package is just bad practice

tawny horizon
#

alright

smoky violet
#

was a hack I did before I knew you could add extensions to the dependency container

tawny horizon
#

oh so it wasn't defined as DependencyHandlerScope.paperweight()?

smoky violet
#

it was, just in the root package so you don't have to import

tawny horizon
#

oh i see, never knew that was considered bad practice

#

looks like its managing to find 1.19.4 now

smoky violet
#

interesting

full stump
#

anyone know what's going on here?

#

i can't reproduce that error locally

lament scarab
#

See the "Try" section?

smoky violet
#

eah

#

yeah

lament scarab
#

The thing provided literally 0 useful information

smoky violet
#

add --stacktrace

full stump
#

not sure what that means either

smoky violet
#

try updating gradle

#

at least to latest 7 but ideally latest 8

full stump
#

wait i have something in mind

smoky violet
#

Oh, I think it's your version.set(version)

full stump
#

oh

#

oops

smoky violet
#

yeah the inner scope takes priority in name shadowing

full stump
#

intellij should have screamed at me for that

#

and it worked locally too

#

odd

smoky violet
#

the publications are only realized if needed

#

since you use register not create

full stump
#

ah

#

okay thats on me

smoky violet
#

register is what I would do too, just explaining

full stump
#

yeah but i made the mistake of not realising that i wasn't testing publish 🤷

smoky violet
#

fair because the error was in configuration not execution

#

it didnt say it happened in the publish task

hardy tendon
#
com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not create task ':paper-server:runDev'.
Caused by: java.lang.UnsupportedOperationException

Is this a Gradle bug or something? I tried pulling the dev branch but it fails to sync

smoky violet
#

need to delete outdated server dir

hardy tendon
#

ah, ty 👍

granite valve
#

aha, yeah I guess I could do it that way

tawny horizon
#

1.19.4 issues

smoky violet
#

just compile errors

#

e: /Users/will/IdeaProjects/eco/eco-core/core-nms/v1_19_R3/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_19_R3/CommonsInitializer.kt: (159, 43): Unresolved reference: ServerGamePacketListenerImpl
e: /Users/will/IdeaProjects/eco/eco-core/core-nms/v1_19_R3/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_19_R3/CommonsInitializer.kt: (159, 74): Unresolved reference: Channel

#

you probably have the wrong version import

tawny horizon
#

ive added them as imports now

#

still not being very happy

#

ill clear caches... again

#

nothings importing at all according to intellij, doesnt recognise anything bukkit/paper/nms

#

just nothing

#

other modules are fine

#

ill go again

#

WHY IS IT BUILDING FINE THEN

#

IVE CLEARED CACHES OVER AND OVER AND INTELLIJ STILL DOESN'T RECOGNISE IT

smoky violet
#

if its building fine but intellij is dying not much I can help with PepeLa

tawny horizon
#

yeah but it's not fine because i was told you need to reflectively get the channel from ServerPlayerConnectionImpl or whatever its called now

#

so i can't just merge, push, and worry about it later

#

thanks though jmp you've been a great help

smoky violet
#

paper has mappings in the jar, can use my reflection-remapper lib to read them, on spigot glhf

tawny horizon
#

we ball

#

ill just wait

#

wont affect anyone whether eco has 1.19.4 support today or if it has it tomorrow

smoky violet
#

was able to avoid using names though

tawny horizon
#

wait why dont you just merge that into paper and make an api for it?

#

also the chad .coerceInRange() over clamp

lament scarab
#

It's one of those APIs which spigot has some work on for a good while now

#

(part of their "don't treat the API enums and enums warning)

smoky violet
#

also that code is not paper-specific

#

same code runs on forge/fabric/sponge

#

I could use AT/AW/Mixin on those other platforms but easier to just always use reflection

tawny horizon
#

fair

#

yeah i have zero experience with mixins they scare me

lament scarab
#

mixins are sexy

north flume
#

Mixins 😍

runic aurora
#

had a quick maven question. someone told me that my plugin source is getting compiled into my jar.
Is there some sorta flag or something I can set in my pom files to sort this out?

lament scarab
#

er

#

depends on what they mean by that

runic aurora
#

sorry I should shared what they said

#

one moment

lament scarab
#

if you mean the .java files are being copied in there, see your pom file and make sure that you're not copying them in there

#

I mean, look in the jar, see if .java files exist

runic aurora
#

yes that's what it is, they were saying that the .java files were being included in the .jar

#

comments and everything

runic aurora
lament scarab
#

I mean, if that's happening is cos your pom is configured to do that

runic aurora
#

yes you're totally correct, I'm not trying to deny that. I'm just saying at first glance I don't see anything that's like <copyAll.JavaFilesIntoTheSourceJar> (obv this is a joke)
So lemme throw these poms into a paste and I'll share that. Unless there's a specific config option that you know off the top of your head might be causing this

lament scarab
#

there are several dozen ways to do it, singling one out would be a waste of time

runic aurora
#

I'm not exactly a maven guru so I appreciate any help 🙂

lament scarab
#

line 315

runic aurora
#

ohh thank you! Lemme see if I can find the answer I need from here! I'll let you know if I'm stumped

#

okay so I just added <exclude>*.java</exclude> and it seems to have worked!
I got an exception at server startup but that's just cause I didn't implement bstats properly (bStats Metrics class has not been relocated correctly!)

granite valve
#

I had to do a bit of weirdness to make sure they had final newlines, I guess they initially don't

#

maybe that part would be better to have elsewhere, like when first decompiling the jar or smth

#

unfortunately, this much work in kotlin has made me really, really like the closure stuff and all the super nice stuff kotlin has

granite valve
#

also did the glob stuff

#

whichever one is merged first, the other will need to adapt to its changes

harsh stone
bronze ember
#

show your build script

#

that looks really wrong

harsh stone
#
plugins {
    alias libs.plugins.paperweight
    alias libs.plugins.shadow
}

shadowJar {
    archiveFileName.set("Libraries-Bukkit-Plugin.jar")
}

dependencies {
    paperweight {
        paperDevBundle "1.19.3-R0.1-SNAPSHOT"
    }
}

// ========== Build ==========

tasks {
    assemble {
        dependsOn reobfJar
    }

    reobfJar{
        archivesBaseName = "Libraries-Bukkit-Plugin.jar"
    }
}

dusk quail
#

getting this error trying to use 1.18.1 user dev in a module, using user dev 1.5.3, it has teh repo

dusk quail
#

fixed it

sharp trellis
#

Hi, what if should i do if i want to use nms from version below 1.17.1 with paperweight (i need it to work with jitpack, so paperweight is the only solution i think)

proud maple
violet talon
#

I'm trying to build a project with java 20 and I have a build-logic folder which uses kotlin-dsl. I'm getting this error:

* What went wrong:
Execution failed for task ':build-logic:compileKotlin'.
> Error while evaluating property 'compilerOptions.jvmTarget' of task ':build-logic:compileKotlin'.
   > Failed to calculate the value of property 'jvmTarget'.
      > Unknown Kotlin JVM target: 20
sharp trellis
dusk quail
#

add the paper repo

smoky violet
#

@harsh stone unspecified is the version of your project. I do not recommend messing with artifact names for a variety of reasons but how to do so for reobfjar is covered in the test plugin script

smoky violet
sharp trellis
#

Like?

#

Idk, is codemc better? I've never used it

prime cliff
sharp trellis
#

So, what should i use

lament scarab
#

I mean

#

generally, outside of setting up your own private maven repo/CI server, you're fucked

sharp trellis
#

Oh

#

And what should i do if i don't have money for a vps?

lament scarab
#

if you have a credit/debit card, theres a few companies like oracle, AWS, etc, who offer always free tiers

#

otherwise, your only option is to rely on services like codemc, etc

#

Not ideal, but, they exist

prime cliff
#

Or use paperclip below 1.17 with the install option. Not efficient but works.

sharp trellis
#

Okay, thx

smoky violet
#

you could have gradle run the paperclip install for you when on ci

#

if you use run-paper you could use it's stuff for resolving paperclips

smoky violet
#

check for snapshots or open issues, I guess

runic aurora
#

Quick maven question. So I'd like to be able to just set my plugin version in my maven pom.xml and have that number be used inside of the plugin. Is there some sorta placeholder I can use which maven would replace with the correct value on-compile?
I see ${project.version} used a lot. Is there a way to use this in my java code too?

#

my alternative was to just use a .env file and then call that from the code

lament scarab
#

basically, there are templating plugins for that stuff

runic aurora
lament scarab
#

yup

bronze ember
#

Using property files and filtering them is a way nicer solution

runic aurora
#

So last night I was trying to compile and test a new feature. But I started getting a Compilation Error. That's basically it it didn't give me much information other then that.
https://pastebin.com/Y88zBCDq

I saw the part about re-running with the -e switch but I couldn't find where/how I would set that in InteliJ? Cause it's not like the terminal let's me run mvn commands. All the maven stuff is just UI for me

#

I figured I'd ask, maybe the log has more useful information for someone more understanding of the build processes

#

I'm currently trying to recreate it on an older commit version

#

okay so the cause of this seems to be these two new Brigader commands I have added

#

when I have the class files included the entire thing fails to compile, but without it seems good. Let me verify...

#

okay! yeah it's just those two Brigader commands. Even tho there's no syntax errors, something is causing the compiler to totally eat shit. I think I should be able to debug from here actually

#

it was cause my dumbass had the @Plugin annotation above my commands. I have no clue why. Maybe cause of some moron on stack overflow lmao

silk latch
granite valve
#

You need to install maven then

silk latch
#

?

distant mango
#

what don't you understand about that lol

silk latch
#

how is it not installed? ive literally been coding on this plugin for months

icy fiber
#

you're using intellij bundled maven

granite valve
#

You need to navigate to the download side for a program called maven. This is in a browser which can search through the internet

runic aurora
#

I get the same thing when I try to use terminal commands

granite valve
#

But yeah, IntelliJ comes with bundled maven for its tool windows. Always a good idea to have it installed on the side so you can run it via cli if needed

silk latch
#

i restarted intelli and now it works

granite valve
#

Or via the maven wrapper which for some reason isn’t anywhere near as popular as the gradle wrapper

short trench
#

I know this is velocity, but I'm strugglign to shade the Jedis dependency into my plugin-

[03:01:49 ERROR]: Exception in thread "main" com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: redis/clients/jedis/JedisPool
[03:01:49 ERROR]:       at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049)
...
```https://paste.md-5.net/vuwozebike.cs
build script
smoky violet
#

use implementation for things you want to include in the jar

#

also relocate

short trench
short trench
#

(it didn’t work)

median stratus
#

How I speed up maven build? Why takes too long like 7 seconds. The spigot with the shadow.jar takes like 3 seconds to build the aterfact

bronze ember
#

what maven build?

median stratus
#

Package

bronze ember
#

no like on what project? what pom? what is it doing?

#

there are plenty things to speed up maven

#

but maven is inherently slower than for example gradle because of how gradle caches things

median stratus
#

Oh, so gradle is faster. Good to know now

median stratus
#

Is possible to skip the "The process cannot access the file because it is being used by another process" in gradle?

bronze ember
#

No, that's a windows thing

#

Use bukkits update folder to update the plugin

#

Gradle does have a runPaper plugin tho, that will allow you to compile and restart paper in one go without having to copy files

median stratus
#

ok, thanks

ember topaz
#
name: SkillsLibrary2
version: ${version}
main: me.xemor.skillslibrary2.SkillsLibrary
api-version: 1.16
authors: [ Xemor_ ]

I have a plugin.yml like this and am using kotlin gradle for compilation, but it caches the plugin.yml even when the version number is incremented. Does anyone have any idea for preventing this?

distant mango
#

send your build.gradle(.kts)

lean craterBOT
#

Please send large files/logs to a pastebin

static urchin
#

the version should be expanded to project.version iirc

#

instead of just version

ember topaz
#

that's what it's like for maven, but that wasn't working, when I dropped the "project." it worked on gradle

#

It just only works once as it caches the plugin.yml in the build folder, if I delete this cache, it generates with the latest version

hardy needle
#
    processResources {
        filesMatching("plugin.yml") {
            expand("version" to rootProject.version)
        }
    }

This is what we typically use

#

What's your gradle.properties file looking like?

static urchin
#

yea that would actively expand it to version

#

up to you what you want 😅

ember topaz
open sentinel
#

project root

#

if you have one

hardy needle
#

If you don't have one then it won't be what I'm thinking. There's some args in there for caching and it can sometimes cause that.

ember topaz
open sentinel
ember topaz
distant mango
#

just making sure, is the plugin.yml in /src/main/resources?

open sentinel
hollow monolith
#

So how does gradle shadowing work? Do I need to first update gradle to 8.0?

#

I think I have 7.x

hollow monolith
#

oh nvm I have 8

distant mango
hollow monolith
#

org.gradle.api.GradleException: This version of Shadow supports Gradle 8.0+ only. Please upgrade.

#

but

#

------------------------------------------------------------
Gradle 8.0
------------------------------------------------------------

Build time:   2023-02-13 19:02:29 UTC
Revision:     <unknown>

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          17.0.6 (Oracle Corporation 17.0.6+10)
OS:           Linux 5.15.102-1-MANJARO amd64
distant mango
#

./gradlew -v

hollow monolith
#

sane output

#

just says Gradle 8.0

distant mango
#

try upgrading to 8.0.2

hardy needle
#

If that doesn't work try shadow 7.1.2, and reload the project and make sure it runs, and then update to the 8.x shadow version

smoky violet
#

try inputs.property("version", rootProject.version) in processResources

#

for @ember topaz

ember topaz
#

I just worked out my solution

outputs.upToDateWhen { false }

inside tasks.processResources

#

basically invalidates the cache every time

smoky violet
#

thats not a solution its a hack

#

and the proper hack would be doNotTrackState("can't figure out how to make it track inputs properly") not outputs.upToDateWhen { false }

#

but I think what I sent will work

smoky violet
ember topaz
#

ahh

hollow monolith
smoky violet
#

@near oar run gradle build from terminal to get the full error

#

likely wrong java version

hollow monolith
#

Ok so I have noticed 1 thing now, the file size went up from 15KB to 4MB, is there a way to just filter the dependencies I need?

#

or is the dependency I have included, in this case mariadb Driver class that large?

#

I'm not exactly still sure what was packaged in that jar

smoky violet
#

jars are zips, you can open them up with 7zip and look

#

mariadb driver is pretty large last I checked though

#

just use implementation for things to include, and compileOnly for things you don't want to

#

and make sure to relocate

#

if you're shading sql drivers you might also need mergeServiceFiles() in the shadowJar configuration

hollow monolith
#

Well it worked, even without mergeService you mentioned

#

I no longer have an issue with class not found exception that I had earlier

smoky violet
#

if you don't relocate it won't be needed

#

but you should relocate everything you shade

near oar
#

what do i have to do?

near oar
brave widgetBOT
near oar
#

i just wanted to use NMS with a gradle setup

smoky violet
#

you need to read

#
  • Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 16
#

set your toolchain and release to 17 like in the test plugin

brave widgetBOT
near oar
#

plugins{
id("java-library")
id("io.papermc.paperweight.userdev") version "1.5.3"
}
java {
// Configure the java toolchain. This allows gradle to auto-provision JDK 17 on systems that only have JDK 8 installed for example.
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}

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

smoky violet
#

@short walrus running the reobfJar task will put two jars in build/libs, use the one without -dev

short walrus
#

Thanks. 🙂

smoky violet
#

if you're still having trouble send over your build files in a paste

short walrus
#

Will do.

near oar
smoky violet
#

search for "release.set" in the build.gradle.kts

lean craterBOT
near oar
short walrus
#

Having another issue where all of my external libraries such as the ones that Kotlin needs (using due to stuff such as data classes and string templates) and other external libraries such as Jackson aren't in the jar file.

#

Ah.

#

Seems like for some reason the Shadow plugin had apply false set for it.

smoky violet
#

yeah that would do it

#

would recommend updating gradle & your gradle plugins, especially paperweight

#

also you don't need to add paper api yourself, the dev bundle depends on it transitively

verbal skiff
#

then kotlin can take advantage of new bytecode magic

smoky violet
#

(which actually is a regression when writing gradle plugins PepeLa)

short walrus
#

Ah, I never knew that.

#

It's generated a 20 MB file.

smoky violet
#

since it starts using invokedynamic instead of generated classes for lambdas and gradle can't serialize it anymore (like java lambdas)

#

you're probably pulling in kotlin reflect somewhere

#

it's massive

short walrus
#

Probably.

verbal skiff
short walrus
#

My original project was using Maven before I moved over to Gradle with Kotlin.

smoky violet
#

up to date checking

verbal skiff
#

ah right, i thought it was just task inputs/outputs

smoky violet
#

iirc there was an open issue for this, will probably be a compiler flag gradle sets for scripts eventually

#

(and plugin authors could use)

short walrus
#

Hopefully this new file has the class not found errors fixed too. (It kept saying it couldn't find a Jackson module for Kotlin) :/

verbal skiff
#

you may wanna look into kotlinx serialization btw

#

specifically made for kotlin

short walrus
#

Never heard of that.

smoky violet
#

I would also tell you to relocate everything you shade but I know kotlin stuff likes to break especially kotlin-reflect PepeLa so might be an idea to use the PluginLoader api to download these from maven at runtime

short walrus
#

Kotlin seems to be weird with Gradle apparently lol

#

Ahh

verbal skiff
#

it offers some benefits such as additional compile-time safety

short walrus
#

Yeah, I've only recently started using Kotlin.

verbal skiff
#

it is a noble journey

smoky violet
#

only thing is you can't use the commands in the yml with paper plugins, which isn't a problem for me since I use cloud and haven't touched the commands section of yml in ages, but might be an issue for you

short walrus
#

I've made progress, It's just saying that some of my json files haven't been found. (because I forgot to create them)

#

Seems to be working now.

#

Thanks for all of your help. 👍

#

Yeah, All of the previous errors are now fixed, Now I've got to fix my JSON system but it's all working now other than that, Again, Thanks for your help. 🙂

smoky violet
#

even if the error are resolved I would still look into either relocating or using the library loader, could easily run into issues if other plugins shade the same thing without relocating

granite valve
#

something recently has made applying the server patches on my macbook take WAY too long. It sits Creating Paper-Server from remapped source... for minutes before importing the vanilla/library files and applying the patches

smoky violet
#

haven't seen it on my m2 pro troll

granite valve
#

its not all the time either, like just ran it again, 30 seconds for the whole applyPatches task

smoky violet
#

no messages about locking?

granite valve
#

no, am not seeing anything

smoky violet
#

thats the only thing I can think of, ij running another instance and it locks the dirs

granite valve
#

I think its gotta be related to that, this is all in intellij

smoky violet
#

but the locking logic is meant to log when its waiting on a lock

granite valve
#

yeah, I don't see anything about that

#

it'd just be in the intellij build window right?

smoky violet
#

the one that would log would be the one that's waiting

#

but yeah if the ij instance is waiting it should show up in the window, if not in the root log when you click the top thing

granite valve
#

its happening again, I just switched branches, and ran applyPatches, breezed through the first bit, then stuck on the same thing

smoky violet
#

if you know what I mean with the weird interface

granite valve
#

yeah, ik what you mean but there's nothing showing up

#

it seems to be only the first apply after having the patches change

smoky violet
#

one of the gradle flags should print some info about what its doing

#

maybe gradle is fingerprinting them or smth

granite valve
#

Yeah, I think it’s reliable reproducible for me. Lemme try not running it via a run configuration but just in the IntelliJ terminal

#

IntelliJ doesn’t show that it’s doing anything, like the progress bar in the bottom right, but idk if that’s definitive

smoky violet
#

it's either --debug or --info

#

they dump a massive amount of info but might be able to find something in there

granite valve
#

Wow, ok, running it via the terminal does not have the same issue

smoky violet
granite valve
#

Or maybe I spoke too soon

#

Tried a totally separate branch, and it’s happening

smoky violet
#

oh wait, it wouldn't be gradle snapshotting if you get that log message

#

the stuff after that log message is literally the calls to git

granite valve
#

trying witout intellij running now

#

ok, so actually it has nothing to do with intellij

#

just in a regular console window its taking forever at the exact same step

smoky violet
#

set the debug property to get git output

granite valve
#

the paperweight one?

smoky violet
#

it's the git operations, thats all there is after that log message

#

yeah

granite valve
#

well there's the importing of the vanilla files right?

#

those messages show up, "Imported 238 vanilla files" or whatever and "Imported 7 library files"

smoky violet
#

that further indicates its the git ops

#

unless your machine is hanging on reading a json file

granite valve
#

its -Ppaperweight.debug=true right?

smoky violet
#

I think -D

#

system prop

granite valve
#

oh yeah -D

#

this is where its stuck

#

git -c commit.gpgsign=false -c core.safecrlf=false gc

#

is this maybe because I have like 90 branches checkout locally?

#

yeah, and then the next logged lines are the Imported msgs, and then it applies and is done

smoky violet
#

I guess when you switch branches to something different enough it has to gc a lot

granite valve
#

lets try on a fresh clone of the repo I guess

smoky violet
#

rm -rf the server dir would probably have the same effect

#

it won't have much to gc in a fresh clone

granite valve
#

I need to stop abusing stash then

#

I've got like 5 things stashed in server, api and root each

smoky violet
#

is that with apple git or normal git?

#

because I haven't seen this before

#

I guess I don't use stash that much in server

granite valve
#

should be normal git, how would I check?

smoky violet
#

git -v

granite valve
#

git -v just returns 2.40.0, I assume if its apples there'd be some other info?

smoky violet
#

yeah thats normal

#

yea apple one has apple or mac or something in the version string

#

and they arent on .40 yet

#

but yeah stashing stuff and then applying again probably does lead to more garbage

#

since it has to retain refs for the stashes

granite valve
#

yeah, fresh clone and everything is fine.

smoky violet
#

could maybe add something to only gc once per day?

#

and then that system could also be used for your pruning PR

#

so we can have that automatic without nuking apply times every time

#

and obviously a prop or something to disable it

granite valve
#

heh rm -rf Paper-Server took a solid 15 seconds

#

and yeah, works fine now

steel bough
smoky violet
#

outdated gradle

near oar
#

and how to reobfuscate my plugin to make it work on normal spigot/paper jar (not mojmap version)?

#

plugins{
id 'io.papermc.paperweight.userdev' version '1.5.3'
}
dependencies {

compileOnly("io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT")
paperweight.paperDevBundle("1.19.4-R0.1-SNAPSHOT")

}

shadowJar {
}

lament scarab
#

run the reobfJar task I think it was

near oar
#

/* reobfJar { // This is an example of how you might change the output location for reobfJar. It's recommended not to do this // for a variety of reasons, however it's asked frequently enough that an example of how to do it is included here. outputJar.set(layout.buildDirectory.file("libs/PaperweightTestPlugin-${project.version}.jar")) } */
so the comment on paperweigth-plugin
i see also
assemble { dependsOn(reobfJar) }
where should i put the reobf in a multiple NMS project with modules?

#

how does it catch the version to use for reobfuscation?

lament scarab
#

I mean, you can only have a singular nms version in a project, you can't define multiple different versions of a dependency

#

what you generally do is have multiple submodules, and then use the reobf configuration from them

#

theres probably a few examples out there that exist, idk of any simple ones off the top of my head and too tired to go over it from top to bottom

violet talon
#

I think worldedit uses multiple NMS modules

#

That's not exactly simple, but it's a starting point at least

lament scarab
#

WE uses a somewhat more complex build setup, so not sure they're a good reference

main mica
#

I'm having an issue with building a fork (again!).
For some reason the entire API project is missing from the paperclip or bundler jars. All patches are applied cleanly and the project builds fine, though suspiciously quick. My first build showed a large number of errors due to missing API, but still succeeded (???). Now when doing a clean build it doesn't even do that anymore, it just builds fine.

I checked the build files and they look fine, with the -server project depending on -api. I didn't make any changes to them. The fork is on Github here: https://github.com/DRE2N/Papyrus
I'm really confused whats going on

granite valve
#

when you look in the bundler jar, you are looking in the libraries folder right?

main mica
#

yes, no bukkit there.
It also doesn't start (can't find craftbukkit.main) and is way too small

lament scarab
#

no gradlewrapper

main mica
#

I'm also pretty sure it shouldn't build, I haven't finished fixing up the patches

#

Does it need the wrapper?

lament scarab
#

well, no; but I'm not going to try to test locally if I gotta mess around

#

nothing stands out from a quick glance as being wrong

main mica
#

Wrapper should be there now

#

mystery solved: the toolchain was set to failOnError = false for some reason, thats why the build "succeeded" even though the API didn't compile. Everything works now

near oar
#

i'll hit the wall harder with my head

near oar
#

i got it!

#

i only need
implementation project(path: ':NMS1_19_4', configuration: 'reobf')
on the build.gradle where i need NMS1_19_4

#

is dev bundle available only for 1.17+?

distant mango
#

yes

near oar
#

thanks guys. finally i can do a multi-NMS project without complications of any sort

#

paperweight is COOL

#

would you like to make a github gradle project template with multiple NMS versions?

#

we can even do a 1.13 to 1.19.4 plugin template

distant mango
#

well 1.13 isn't supported by PW so no

#

1.17+

near oar
#

but there are spigot mappings

#

1.13 to 1.16.5 with spigot mappings

distant mango
#

that wouldn't fall under paperweight

near oar
#

1.17 to 1.19.4 with paperweight

#

you're right

#

ok then from 1.17 to 1.19.4

#

who has the power to add a branch in paperweight-test-plugin?

distant mango
#

core & maintainers i believe

near oar
#

jmp

sharp trellis
#

Hi, how can I compile multimodule project (1.17, 1.18 and 1.19 nms are in separate modules) with java 16, while minecraft 1.19 requires java 17?

granite valve
#

You can set different Java versions for each module with gradle

#

The same way you set the Java version for other things

sharp trellis
#

how? I use intellij module settings to set java version

#

and I can't set different java version for specific module

granite valve
#

Are you using gradle or maven at all?

sharp trellis
#

i'm using gradle

granite valve
#

Cause IntelliJ module settings isn’t how you set the version gradle/maven use to compile the project

sharp trellis
#

so how can I do it

sharp trellis
#

so now, I need to set toolchain.languageVersion.set(JavaLanguageVersion.of(16)) in all modules except 1.19 (where I need to set toolchain.languageVersion.set(JavaLanguageVersion.of(17)))?

granite valve
#

If you wanted to always compile with 17, but output bytecode for 16

sharp trellis
#

so I just need to set options.release.set(16) everywhere?

#

I mean in every module

granite valve
#

Depending on how your project is setup, that would be one way. You could also do it just once in your root build.gradle skipping over sub projects that are 17

#

Then use IntelliJ module settings to s t the language version for each module, so IntelliJ warns you when you use a feature that is only available in a newer version

sharp trellis
#

okay, I'll try it

#

thanks

#

Unfortunately, I have an error:

No matching variant of io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT:20230312.180621-141 was found. The consumer was configured to find a library for use during compile-time, compatible with Java 16, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
distant mango
#

what does it say after the but

sharp trellis
brave widgetBOT
distant mango
#

1.19 requires 17

sharp trellis
#

I know, see messages above

distant mango
#

send your build.gradle's

lean craterBOT
#

Please send large files/logs to a pastebin

distant mango
#

try setting release to 17

#

also the error & build file don't match

#

error says 1.19.3 build i 1.19.4

sharp trellis
#

oh, I think I pasted wrong file

#

nvm, I think I fixed it

muted acorn
#

Hello, i recently updated one of my plugins from gradle 7.6 to gradle 8, which works perfectly fine except for building on jitpack.io.
It's like it's failing to find the java version for the paperweight part.
Here is the error: https://pastebin.com/UiXWs8m4
Here is the project location where it points the issue: https://github.com/Chronoken/MagicSpells/blob/main/nms/v1_19_R1/build.gradle

GitHub

The MagicSpells plugin for Bukkit. Contribute to Chronoken/MagicSpells development by creating an account on GitHub.

lament scarab
#

No matching toolchains found for requested specification

#

your erm, build environment doesn't have a jdk that supports java 17

muted acorn
#

So i have to manually set it?

lament scarab
#

You can tell gradle to automatically pull a JDK

muted acorn
#

Because from what i see jitpack gets java 8

lament scarab
#

I think that was what the foojay conventions plugin is for

muted acorn
#
0m4.142s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~16.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
Getting tasks: ./gradlew tasks --all
Tasks: 

lament scarab
#

either get gradle to pull 17, or tell jitpack to use 17

muted acorn
#

Pointed jitpack at jdk 17 and everything works fine 🙂

frank quarry
#

Now asking here

frank quarry
#

Still not building

lament scarab
#

Not really much to go on

#

it's saying that the plugin infofile is apparently empty? maybemake sure that you don't have the filedangling on the disk, and mae sure that the annotation processor is running?

distant mango
#

if you're using kotlin you need to use kapt

lament scarab
#

they're using maven

smoky violet
#

@grand sorrel did you get it working?

#

what I meant by not randomly changing stuff is things like in that snippet you sent, in general you only need to change enough so the syntax is valid groovy

#

the repo is added by the plugin, and the dependency is the same

grand sorrel
#

no i havent got it working yet, im about to go for 30min and then ill ask here if im still having issue

grand sorrel
#

if i want NMS support, should I only be setting up paperweight-userdev? by adding to plugins id "io.papermc.paperweight.userdev" version "1.5.3" & to dependencies paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:1.19.4-R0.1-SNAPSHOT")

grand sorrel
#

i got NMS working but im struggling w a library (unnamed's hephaestus engine), they have a test plugin (https://github.com/unnamed/hephaestus-test-plugin/blob/dadd2ce888d0ef05f73fa5e65e03cbb39d08a95d/src/main/java/team/unnamed/hephaestus/plugin/CustomModelEntity.java) but copying things gives me problems with NMS, I know this should be in their discord not here but was just wondering if someone here has any ideas what the problem is / how to fix. Other than the override registerGoals says that it is not overriding anything either. Is there a different implementation of net.minecraft.world.entity.EntityInsentient? Not entirely sure what the problem is tbh

plucky stirrup
#

anyone can tell me why this build script isn't building a jar with everything?

#

im only getting the META-INF folder

distant mango
#

go to common/build/libs

plucky stirrup
#

what

#

it has the 2 jars from the shadow

#

common is a standalone piece of code which is shared across 2 other modules

verbal skiff
#

next, you should be using the shadowJar task, build may work but shadowJar will definitely produce the correct result

#

and then iirc the jar ends with -all.jar

#

and to continue point 2: you dont need a special shadow configuration at all in this case

smoky violet
#

and if you're depending on their code and not just copying it into your project, you'll also need to depend on their mojang mapped artifact

violet talon
#

buildtools is a spigot tool

lean craterBOT
smoky violet
#

userdev is our supported way of using server internals, you're already using gradle, might as well switch to it and remove the buildtools step

plucky stirrup
#

i applied to the following

granite valve
#

Are you running the shadowJar task?

#

I dont think “build.finalizedBy(shadowJar)” is correct. You probably want tasks.assemble{ dependsOn(shadowJar) }

smoky violet
#

you probably also only want shadow on the root project shading the others

#

or maybe not

#

multiplatform jars are just cursed

#

you probably don't want it on common at least

quartz wharf
#

Context: My code has Mojang NMS and in order to remap it into obfuscated NMS I am using the paperweight project which was built for paperspigot.

Question: Is it possible to rename the output of paperweight reobf jar? The jar output format is project.name + "-" + project.version + ".jar". But I dont want the project version to be included in the jar output. Any solutions? Basically I'm looking for a paperweight equivalent of shadowJar's "archiveFileName" option.

#

(Please feel free to ping me if you know the answer)

smoky violet
#

read the comments in the test plugin build script

lean craterBOT
smoky violet
#

@quartz wharf

quartz wharf
#

oh

#

in the comments

#

its commented out

#

I see it

#

thx a bunch

#

Hey, another question:
Is there anyway to configure the maven-publish plugin to publish the output of paperweight instead of the output of shadowJar?

wild tree
#

I have some weird bug, I'm using gradle with KTS, and it seemingly breaks the communication of the version to my plugin.yml.

My plugin.yml is simply

name: StormTesting
author: Stormsly
version: "${version}"
main: me.stormsly.stormtesting.StormTesting
api-version: 1.19
depend: [ProtocolLib]

And in my build.gradle.kts

group = "me.stormsly"
version = "1.0.0-SNAPSHOT"
description = "Stormsly's Testing Plugin."

However when starting my server.

#

My whole build.gradle.kts is essentially the same as the example paper weight plugin, I'm trying to experiment and test out NMS for the first time.

distant mango
#

you need to use the replace resources thing

lean craterBOT
static urchin
#

Please send the file

distant mango
#

has an example i believe

static urchin
#

The example repo uses a plugin to generate the plugin.yml

#

You presumably aren't

wild tree
#

You want me to send my whole build.gradle.kts?

distant mango
#

yes

lean craterBOT
#

Please send large files/logs to a pastebin

wild tree
#

Okay one second.

#

im not using the plugin they used to auto build the plugin.yml mainly because I had issues with it outright not functioning.

#

and i prefer doing it myself

static urchin
#

You can either construct your own map or just pass project.properties

#

Latter would have the effect of the version being keyed with project.version

wild tree
#

Im lost

static urchin
#

I'm on my phone sadly maybe someone can spoon-feed real quick

#

You just call expand in the process resources task configuration block

wild tree
#
filesMatching("**/plugin.yml") {
  expand(project.properties)
}
#

i wasnt asking for a spoon-feed, i was asking for an elaboration

static urchin
#

Oh

wild tree
#

would that be correct usage?

static urchin
#

Looks promising yea

wild tree
#

ill update you then

static urchin
#

Make sure to update the plugin yml to

wild tree
#

gotcha

#

nope

#
[StormTesting] Loading server plugin StormTesting v${project.version}
#

is it because I have it inside a string? in my plugin.yml

#

should it just be

version: ${project.version}
#

okay that worked lol

#

thank you lynx

opal patrol
#

(i apologise if this is the incorrect channel) anyone know if theres any known collision between paperweight and shadowJar? this is my current build.gradle ```gradle
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'io.papermc.paperweight.userdev' version '1.5.4'
}

build.dependsOn(shadowJar)
assemble.dependsOn(reobfJar)
jar.enabled = false

group 'com.ankoki'
version '1.0-DEVELOPMENT'

repositories {
mavenCentral()
maven { url 'https://hat.lordoftherin.gs/releases/' }
}

dependencies {
compileOnly 'org.projectlombok:lombok:1.18.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'
compileOnly 'org.jetbrains:annotations:24.0.1'
implementation 'com.ankoki:Roku:1.0-dev'
paperweight.paperDevBundle '1.19.4-R0.1-SNAPSHOT'
}

shadowJar {
relocate 'com.ankoki.roku', 'com.ankoki.sunriseslaughter.libs.roku'
archiveName 'Sunrise-Slaughter.jar'
}``` yet however whenever i build it, it doesnt remap the classes, throwing a ClassNotFoundException with net.minecraft.server.level.ServerPlayer, but my other project is just fine without shadowJar, this didnt happen until i updated to 1.19.4
ive also tested removing my assemble.dependsOn to no avail

#

pls ping me if you have any idea ^^

proud maple
#

you should only really need the assemble.dependsOn(reobfJar), paperweight automatically picks up on shadow if it's present iirc

#

also probably an obvious question, but make sure you're using the jar without the -dev classifier

#

if that doesn't work then I don't know, someone else might though

opal patrol
#

yeah i am using the jar without the -dev, quite confused because it works on other projects haha

shell leaf
#

How can i make a fork of paper like folia with automated Updates of Paper it self

bronze ember
#

You can't really automate upstrem updates

shell leaf
#

How does Folia ?

dusky timber
#

Folia doesn't do automated updates of paper

shell leaf
#

That means. Spotted or someone else update it self

bronze ember
#

Just like we manually update spigot changes

#

I think airplane has a neat script for paperweight forks

shell leaf
#

Where is airplane ?

shell leaf
granite valve
main mica
#

Pufferfish has that script too. Not sure if the airplane repo still exists

daring trail
#

the script in question btw

bronze ember
#

Right that's what I meant

#

Doesn't Gradle has a way to dump them per task?

#

Paperweight doesn't use the paper API?

#

Do you mean the dev bundle? That's just normal Gradle dependency resolution

#

It's not using the paper API

#

It's just a maven dependency

#

I still don't get the XY, is something too slow?

#

That seems wonky

#

I have never used user dev but those things should be cached

#

Like the vanilla jar didnt change

#

Open an issue about that I guess, i looked at the code and stuff looks much different since I last touched paperweight

#

Don't mention paper API tho

#

"vanilla jar cache seems to expire after a few days" or something

#

No, this is all before the dev bundle

#

Shouldn't be, it should never redownload the vanilla jar

#

But am also confused why those aren't tasks, idk

#

Jmp needs to take a look, I assume am stupid

#

Well, duh

#

Lol

#

What is the output when it's doing more than you think it should be doing?

lament scarab
#

Things are cached

#

But it's just a standard maven dependency

#

Idk how often gradle will cache by default

#

🤷‍♂️

#

No idea how that stuff works, tbqh

#

all I know is that it's just a standard maven dependency and so pw isn't really the thing in control here for that aspect

distant mango
#
configurations.paperweightDevelopmentBundle {
    resolutionStrategy.cacheChangingModulesFor(3, "days")
}
lime junco
#

Hi, I'm developing a plugin using gradle and paperweight. How can I use mojang mappings in reflection? Paperweight doesnt seem to convert these strings when building. I've read all the forum posts I could find and somebody mentioned that I should use yarn parameter mappings but I could not find more information on what these are and how to use them. Do I need to configure something?

brave widgetBOT
verbal skiff
#

not necessarily related directly to paper but I don't know where else to ask short of SO: I'm using kotlin multiplatform and am looking for a configuration similar to compileOnlyApi that comes with the java-library plugin - something like jvmMainCompileOnlyApi. I've tried using compileOnlyApi but that doesn't seem to be declaring the kotlin jvm transitive dependency correctly when I import my KMP library

plucky horizon
#

how do i fix this error when setting up a paperweight plugin project?

Caused by: paper.libs.dev.denwav.hypo.core.HypoException: Unable to resolve class data binding for 'jdk/jfr/Event' which is listed as the super class for 'net/minecraft/util/profiling/jfr/event/WorldLoadFinishedEvent'
    at paper.libs.dev.denwav.hypo.asm.AsmClassData.computeSuperClass(AsmClassData.java:165)
    at paper.libs.dev.denwav.hypo.model.data.LazyValue.getOrThrow(LazyValue.java:121)
    at paper.libs.dev.denwav.hypo.model.data.LazyClassData.superClass(LazyClassData.java:168)
    at paper.libs.dev.denwav.hypo.hydrate.DefaultClassDataHydrator.hydrate(DefaultClassDataHydrator.java:59)
    at paper.libs.dev.denwav.hypo.hydrate.DefaultHydrationManager.hydrate(DefaultHydrationManager.java:91)
    at io.papermc.paperweight.tasks.GenerateMappings$GenerateMappingsAction.execute(GenerateMappings.kt:172)

java version:

openjdk 17.0.6 2023-01-17
IBM Semeru Runtime Open Edition 17.0.6.0 (build 17.0.6+10)
Eclipse OpenJ9 VM 17.0.6.0 (build openj9-0.36.0, JRE 17 Windows 11 amd64-64-Bit Compressed References 20230117_367 (JIT enabled, AOT enabled)
OpenJ9   - e68fb241f
OMR      - f491bbf6f
JCL      - 927b34f84c8 based on jdk-17.0.6+10)
proud stirrup
#

can't use openj9. doesn't implement jfr

distant mango
#

happening on all projects

chrome vector
#

Probably a setting somewhere

distant mango
#

well where then

chrome vector
distant mango
#

because it's also happening when its looking for gradle provided jdks

chrome vector
#

I assume there

distant mango
#

this is gradle not maven

chrome vector
#

Oh right

#

hold on xD

distant mango
#

look at my screenshots