#build-tooling-help

1 messages · Page 4 of 1

distant mango
#

you need to shade in kotlin std

south fossil
#

how do i do that

distant mango
#

are you using maven or gradle

south fossil
#

gradle

brave widgetBOT
devout adder
#
val dirPaths: List<String> = listOf(
    "E:\\USER\\APPLICATION\\50 I HOST\\JARS",
    "E:\\USER\\APPLICATION\\50 I HOST\\MCHost\\servers\\Flag\\plugins"
)
var validPaths: List<String> = getTheDir()
tasks.register("copyToAll") {
    doLast {
        validPaths.forEach { dest ->
            copy {
                from(tasks.shadowJar.flatMap { it.archiveFile })
                into(dest)
                rename { "$jarName.jar" }
            }
        }
    }
}

tasks.register("Build") {
    group = "{ FLAG }"
    description = "Builds the Flag Jar"
    dependsOn(tasks.shadowJar, tasks.getByName("copyToAll"))
    doLast { validPaths.forEach { path -> println("Built in: $path") }; println("Completed.") }
}

fun getTheDir(): List<String> {
    var validPaths: List<String> = emptyList()
    dirPaths.forEach { dir -> if (file(dir).exists()) validPaths = validPaths.plus(dir) }
    return validPaths
}

im trying to move the jar to multiple paths after its finished building using shadowjar is there a better way then this? this kinda works but im curious if theres a better way🙏

#

The paths wont always exist so thats why i check if they exist ^

smoky violet
#

have copyToAll depend on shadowJar, delete the "Build" task, and log those messages in the copyForAll loop instead

#

also don't call the method to filter the dirs until you're actually in the doLast block, so it won't run for builds where the task isn't run

#

and as far as that method pretty sure you can just return dirPaths.map { file(it) }.filter { it.exists() }

devout adder
#

oooh i see i see thanks for the help neko_nod i changed it as you suggested its a lot cleaner now :D

woeful gate
#

I have there these tasks:

tasks.register('createProperties') {
    doLast {
        def details = versionDetails()
        new File("$buildDir/resources/main/version.properties").withWriter { w ->
            Properties p = new Properties()
            p['version'] = project.version.toString()
            p['gitLastTag'] = details.lastTag
            p['gitCommitDistance'] = details.commitDistance.toString()
            p['gitHash'] = details.gitHash.toString()
            p['gitHashFull'] = details.gitHashFull.toString() // full 40-character Git commit hash
            p['gitBranchName'] = details.branchName // is null if the repository in detached HEAD mode
            p['gitIsCleanTag'] = details.isCleanTag.toString()
            p.store w, null
        }
        // copy needed, otherwise the bean VersionController can't load the file at startup when running complete-app tests.
        copy {
            from "$buildDir/resources/main/version.properties"
            into "bin/main/"
        }
    }
}

classes {
    dependsOn createProperties
}

(versionDetails() is from gradle plugin id 'com.palantir.git-version' version '3.0.0')
How to make it run only on shadowJar/build? Because jitpack is screaming error at me

* What went wrong:
Execution failed for task ':createProperties'.
> java.io.FileNotFoundException: /home/jitpack/build/build/resources/main/version.properties (No such file or directory)

Can be found at https://jitpack.io/com/github/ExperiencePowered/StaffProtect/d7606a04ea/build.log

lament scarab
#

I mean

#

you made the classes task depend on that task

#

if you want that task to only run when shadowJar is run, then you'd make it depend on shadowJar

woeful gate
#

okay thanks

teal helm
#

From the paperweight-userdev test plugin:


dependencies {
  paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
  // paperweight.foliaDevBundle("1.20.1-R0.1-SNAPSHOT")
  // paperweight.devBundle("com.example.paperfork", "1.20.1-R0.1-SNAPSHOT")
}

Can you depend on another project in a gradle multi-project setup?

lament scarab
#

what?

teal helm
#

I have a monorepo which contains both my plugin and my custom paper fork

lament scarab
#

Basically, no

#

paperweight expects to ingest a dev bundle which is designed to be published

teal helm
#

So, I have to build my fork, publish it to a repo and then use it in paperdev?

lament scarab
#

you could depend on the -server project if you're gonna run mojmap

#

but, otherwise, we expect published dev bundles, and I doubt that there is much of a way around that which isn't "deal with it yourself"

teal helm
floral whale
floral whale
#

Yes... I know, but it doesn't explain what actually is wrong

#

I'm not used to maven, just gradle, so not sure how to troubleshoot it

verbal skiff
#

same

#

so why dont you just use gradle?

floral whale
#

An old project from someone else

verbal skiff
#

they should show up somewhere in intellij

#

the errors

floral whale
#

There's nothing, other than the error I sent

verbal skiff
#

it might be in a different menu

floral whale
#

Wdym?

verbal skiff
#

check the build button

#

not just the terminal output

floral whale
#

Nothing there

verbal skiff
#

i can only guess

#

without seeing anything

#

send a screenshot of the whole window

floral whale
verbal skiff
#

yeah so click on the different red menu items on the left

#

and then scroll in the window on the right

#

where the error is

#

probably if you click the bottom one "Compilation failure" you'll see something on the right

floral whale
#

Nothing there really

verbal skiff
#

i wonder why tf you have a .iml if this is a maven project

floral whale
#

Other than the error I sent

floral whale
#

I might just convert it to gradle tbh

#

Maven is so bad imo

verbal skiff
verbal skiff
floral whale
verbal skiff
#

have you tried cleaning and trying again?

floral whale
#

Yup

verbal skiff
#

yeah idk män

floral whale
#

Aight np, I'll just try and convert it ig

verbal skiff
#

.iml is for intellij build system

#

which you shouldnt be using if its a maven or gradle project

floral whale
#

Any idea why this doesn't work? compileOnly(files("AdvancedEnchantments:8.7.4.jar"))

Error: Cannot convert URL 'AdvancedEnchantments:8.7.4.jar' to a file.

lament scarab
#

because it expects a file name, not whatever you tried to do there

odd tulip
#

what's with this error? trying to add shadow plugin to my auto generated gradle project (gradle init) from maven

#

nvm think its a kotlin thing

#

using kotlin to generate the project means shadow plugin uses different syntax

lament scarab
#

Some stuff still only documents the groovy syntax

#

but most folk here kind moved away from groovy as it's a lot more, how to say, fragile

odd tulip
#

how do I shadow dependencies with kotlin?

#

i cant find any examples or docs

lament scarab
#

exact same as with groovy, just marginally different syntax, but these days you use the plugins block rather than buildscripts

#

advice in part is to look at other projects

odd tulip
#

like this maybe?

odd tulip
lament scarab
#

I mean, yea, that would work

#

no need to set the base name

odd tulip
#

I need to figure out how to relocate it too

#

or how to even run this task in the first place (i think gradlew shadowJar maybe?)

#

and how to copy the built jar to the plugins dir

#
tasks {
    named<ShadowJar>("shadowJar") {
        dependencies {
            include("de.tr7zw:item-nbt-api-plugin:2.11.3")
        }
        relocate("de.tr7zw", "thirdparty")
    }
}```
#

where does it build to by default so i can copy the file back out ?

#

I found some plugins using the kotlin build file but they all seem very different and complicated, they must be usin their own custom stuff

#

basically I want my gradle project to act the same, which is

  • shade nbt api
  • apache commons io is also a dependency, same with lombok (idk if it needs to be shaded but i did that previously)
  • build and move the final jar into "E:\MINECRAFT TEST SERVER\plugins"
lament scarab
#

you'd run the shadowJar task directly, or basically tell assemble to depend on that task

#

you can also add a task to copy the final jar to somewhere

odd tulip
#

I'm asking chatgpt to write that copy task for me, then I'll make sure assemble depends on shadow

#

then, I use assemble to make my plugin

odd tulip
#

I fixed it! Got it all working

#

now I've fully moved over to gradle, how can I remove the maven project and have everything nicely set up for idea?

lament scarab
#

you should just be able to delete the pom files

#

I've generally had better luck in just deleting the .iml file and .idea folder, but it shouldn't technically be needed

#

ofc, thats where your project settigns exist, so...

odd tulip
#

jesus christ gradle is SO MUCH FASTER

#

I knew it would be faster but sweet lord it's instant

golden remnant
#

Every day I have to delete my papermc folder in m2 for maven so that it can resolve dependency.
I run 'clean install -U' and it doesnt force an update or something, Is their anything else I could try?

lament scarab
#

"resolve dependency" - er?

arctic ocean
#

does anyone know why for when i run the command "java -jar BuildTools.jar" in git bash nothing happens and i get no output?

lament scarab
#

We don't provide support for spigots software

odd tulip
#

I found that changing lombok to be a compileOnly was the right call

floral whale
#

Is this the most optimal way of copying the output jar?

    register<Copy>("buildVald") {
        dependsOn(shadowJar)
        from(shadowJar)
        into("C:\\Users\\Valdemar\\Desktop\\mc\\Advancius\\builds")
    }
boreal marsh
floral whale
#

Ahhh yeah, I could also base it of a propery in gradle.properties maybe

#

The path I mean

boreal marsh
#

How you deal with the path string is up to you

floral whale
#

Is gradle.properties generally ignore from git?

#

Because I'm creating a build task so different users can have different destination directories

boreal marsh
#

I'm not sure, but you can just remove the part in your .gitignore that ignores the gradle.properties file if you want to keep it

#

The gitignore created by the minecraft dev plugin doesn't seem to include gradle.properties

floral whale
#

Alright

lament scarab
#

I mean, because properties are generally shared with the project

quaint raven
#

You can also set properties in ~/.gradle/gradle.properties. but that's global and can modify/conflict with other projects

floral whale
lament scarab
#

it's all injected in the exact same

timid mauve
#

w/ paperweight

paper kestrel
#

looks like gradle doesnt even finish parsing. try running ./gradlew build in terminal (or gradlew.bat build on windows)

#

also maybe try renaming your project to not have "." in the name?

timid mauve
static urchin
#

I mean, not much beyond, run with --info and provide the logs

timid mauve
static urchin
#

Ehhh, what java version are you running ?

timid mauve
#

17

static urchin
#

mb that was in the log skully

paper kestrel
#

what have they done with hastebin

timid mauve
timid mauve
static urchin
#

how much memory do you have left ?

#

I have not encountered the error, no idea what causes it

distant mango
#

also try doing it directly on G:

static urchin
#

stack overflow suggests it might be memory missing

timid mauve
static urchin
#

that should be plenty skully

timid mauve
timid mauve
#

I have this error for 3 days 😭

paper kestrel
#

do you have wsl installed?

timid mauve
#

no, i think

distant mango
static urchin
#

the gradle wrapper etc is intact yea ?

#

have you yanked the local gradle cache ?

timid mauve
#

yep, if I disable paperweight its ok

timid mauve
static urchin
#

which one ? both the project local and system wide one ?

timid mauve
#

local and system (project and user/.gradle)

static urchin
#

pretty out of ideas then, sorry. Is your developer also using the wrapper or are they using their local gradle install ?

#

could always certUtil -hashfile gradle\wrapper\gradle-wrapper.jar SHA256 to make sure your wrapper jar is intact

timid mauve
lament scarab
#

not exactly

lament scarab
#

sometimes people end up using their systems installed version of gradle instead of the local wrapper

timid mauve
lament scarab
#

No

#

just make sure that they're running the correct command

timid mauve
lament scarab
#

I don't deal with windows

#

some google suggestions suggest stopping the gradle daemon

#

some even suggest toasting the users .gradle if you have nothing in there that you care about

timid mauve
#

I've tried everything possible from google, clear cache, stop the daemon, I've already deleted the project and cloned it again

lament scarab
#

(can maybe just yeet the .gradle/whatever it was that had the gradle dists in

smoky violet
#

yeah do that

#

sounds like a borked install

cinder ember
#

Can anyone send a good gradle beginner guide?

fickle fulcrum
#

wdym with gradle beginner guide

brisk belfry
#

They probably want to start using Gradle. So they ask if there is anything useful to help you with it.

hardy harbor
#

@frozen berry A couple weeks ago, you posted a link to your repo to help with some Gradle configuring. I wanted to thank you again, I finally got a chance to revisit the problem, and your reference helped me in figuring out what I had done wrong.

rapid fractal
#

So wholesome 😭😭😭

cinder ember
#

how do i convert from groovy projectile to kts
and set kts as default in the future
and set default gradle to 8.3

lament scarab
#

there is no "convert"

#

you'd basically need to rename the file and modify it so that it conforms to the correct syntax

cinder ember
#

actually i dont need to convert'

#

but how do i set kts and 8.3 as default

lament scarab
#

you don't, basically

cinder ember
#

whenver i create a project

lament scarab
#

idk if theres maybe an environment variable to do it, but, you can specify the version and such on the cli when you create a project from there

distant mango
#

how are you creating the project

lament scarab
#

idk about IJs UI, probs not in there outside of being able to set the buildscript lang when you create it

cinder ember
distant mango
#

can’t change it to kts

#

not sure about version

#

or well you can change, but not set the default

cinder ember
#

how do you normally create a project?

cinder ember
lament scarab
#

yea, that stuff doesn't support that, idk if it's on their todo list or not, etc

cinder ember
paper kestrel
#

you can either do it that way and upgrade the files

#

(like use the versions from the userdev test plugin)

cinder ember
#

but it would still give me groovy

lament scarab
#

because their templates are groovy

#

best you can do is just create a project manually

#

as said, idk if it's on their todo list or not

cinder ember
lament scarab
#

depends on how much I care

#

for the most part IJs wizard to create a gradle project is fine

#

otherwise you can do it on the CLI and then open it in IJ

cinder ember
#

what do you need to add for a gradle project?

distant mango
#

gradle installed

cinder ember
#

do you need to make a resources/plugin.yml etc?

paper kestrel
#

yeah

cinder ember
#

what more

paper kestrel
#

and for the buildscript to copy it in etc

lament scarab
#

if you create a raw gradle project, you'll need to set all of the regular stuff up manually

#

i.e. adding the paper repo/dependency stuff, creating the metadata file and the main class

cinder ember
#

hm or do i convert groovy to kts

#

do i neeed to change all .gradle files to .gradle.kts

#

and replace '' with ""

distant mango
#

if you want to use kotlin dsl yes

lament scarab
#

I mean

#

potentially more involved than that

#

but, I already said yes

cinder ember
#

whats more?

lament scarab
#

that's on you

#

groovy and kotlin have different syntax, etc

cinder ember
#
plugins {
    id("java")
    id("io.papermc.paperweight.userdev") version "1.5.6-SNAPSHOT" // the latest version can be found on the Gradle Plugin Portal
}

group = "org.lividx"
version = "1.0"

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

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

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

tasks.withType(JavaCompile).configureEach {
    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release = targetJavaVersion
    }
}
tasks.assemble {
    dependsOn(reobfJar)
}

processResources {
    def props = [version: version]
    inputs.properties props
    filteringCharset 'UTF-8'
    filesMatching('plugin.yml') {
        expand props
    }
}

e: file:///C:/Users/Username/IdeaProjects/TestPlugin/build.gradle.kts:22:17: Unexpected tokens (use ';' to separate expressions on the same line)

hardy harbor
#

Another oddball question: Let's say I create a plugin that has at least one reference to an NMS class. This jar runs as an independent plugin, but also provides functionality as a dependency for other plugins. The output jar would get remapped to run on a paper server, but when implementing this plugin as a dependency in another, the obfuscation will still in place. Does the paperdev bundle provide any means for deobfuscating additional libraries with NMS code, or do I need to output two different jars, one that runs reobf and one that does not?

lament scarab
#

No, deobufscation of libraries would be gross as all heck

#

not to mention, the answer is simple, either you ensure that the nms stuff isn't exposed in the api artifact you publish

#

exposing nms stuff would pretty much be a sucky violation of exposing useful API

#

but, if you needed to, then you'd need consumers of your library to have userdev, in which case, you'd just publish the mojmap'd artifacts to a maven repo (i.e. the dev classifed jars that userdev already sets up as the outputs)

zealous owl
#

Hey! When adding the shadow plugin to my paperweight project I get the following gradle error, are they not compatible?

class io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject cannot be cast to class io.papermc.paperweight.userdev.internal.setup.UserdevSetup (io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @6f8c5ec2; io.papermc.paperweight.userdev.internal.setup.UserdevSetup is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @1a744dc3) class io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject cannot be cast to class io.papermc.paperweight.userdev.internal.setup.UserdevSetup (io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @6f8c5ec2; io.papermc.paperweight.userdev.internal.setup.UserdevSetup is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @1a744dc3)

#
    id 'com.github.johnrengelman.shadow' version '8.1.1'
    id 'java'
    id("io.papermc.paperweight.userdev") version "1.5.5"
}

group = 'com.diverge'
version = '1.0.0'

repositories {
    mavenCentral()
    maven {
        name = "papermc-repo"
        url = "https://repo.papermc.io/repository/maven-public/"
    }
    maven {
        name = "sonatype"
        url = "https://oss.sonatype.org/content/groups/public/"
    }
    maven {
        name = "nexus"
        url = "https://mvn.lumine.io/repository/maven-public/"
    }
    maven { url "https://repo.dmulloy2.net/repository/public/" }
}

dependencies {
    implementation 'org.mongodb:mongodb-driver-sync:4.10.2'
    implementation "net.kyori:adventure-text-minimessage:4.14.0"
    implementation "net.kyori:adventure-text-serializer-legacy:4.14.0"
    compileOnly 'com.ticxo.modelengine:api:R3.1.8'
    compileOnly 'net.luckperms:api:5.4'
    compileOnly 'com.comphenix.protocol:ProtocolLib:5.1.0'
    compileOnly 'org.projectlombok:lombok:1.18.28'
    annotationProcessor 'org.projectlombok:lombok:1.18.28'

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

    implementation project(":diverge-api")
}

def targetJavaVersion = 17
java {
    def javaVersion = JavaVersion.toVersion(targetJavaVersion)

    sourceCompatibility = javaVersion
    targetCompatibility = javaVersion

    if (JavaVersion.current() < javaVersion) {
        toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
    }
}

tasks.withType(JavaCompile).configureEach {
    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release = targetJavaVersion
    }
}

tasks.assemble {
    dependsOn(reobfJar)
}```
verbal skiff
smoky violet
#

see the note in the test plugin readme about multi project

hardy harbor
deft atlas
#

Hi all, im currently getting a couple of issues when executing :generateDevelopmentBundle from the patcher. We have just updated our project from 1.19.4 to 1.20.1 and it no longer builds correctly. I get the following: (project name has been replaced by example)

 What went wrong:
Could not determine the dependencies of task ':generateDevelopmentBundle'.
> Could not resolve all task dependencies for configuration ':serverRuntimeClasspath'.
   > Could not resolve project :example-server.
     Required by:
         project :
      > Failed to read upstream data.
``` It worked fine on 1.19.4 but has not worked for 1.20.1
limpid heart
#

Provide build file?

lament scarab
#

Failed to apply patches?

deft atlas
#

It builds ok and apply patches seams to work fine, I'll send the build script and properties later

paper kestrel
#

so im experimenting with some nms while in the main paper repo: what does it mean when certain source files arnt in paper-server, but are in gradle caches (and thats where go-to-source takes me
.gradle/caches/paperweight/mc-dev-sources/net/minecraft/server/packs/repository/ServerPacksSource.java

distant mango
#

only files touched by paper/spigot get added

paper kestrel
#

right. say i wanted to make a patch to an untouched file, how would i start?

paper kestrel
#

ah i didn open that file, just didnt scroll down enough, sorry

shrewd glen
#

I'm unsure what I'm doing wrong here, I'm trying to separate my SQL code in to a separate common library that is hosted on Jitpack but when I pull my library down in StomKor, the SQLWrapper class doesn't seam to exist, would anyone have a clue why?

GitHub

Comman libraries for Endercube. Contribute to Ender-Cube/EndercubeCommon development by creating an account on GitHub.

limpid heart
#

On compile, or when running on the server?

supple olive
#

facker

shrewd glen
glass sable
#

does it work without an external repo and just installing into your local one?

#

because jitpack is weird sometimes

limpid heart
#

Does it work on compile? If it does, then it's an intellij issue - try invalidating caches, reloading the maven project, etc.

rotund hill
#

Can you set the paperweight artifact name?
It's RemapJar task (reobfJar closure) inherits setBaseName(), but that's deprecated and the shadowJar config obv. doesn't work for paperweight

verbal skiff
#

atleast iirc thats the one shadow uses now

rotund hill
#

I know that shadow uses it but paperweight doesn't seem to have it

#

hmmm must've overlooked that

#

creates an extra JAR file but seems to work

smoky violet
#

if you get more jar files than before by changing the name that means your setup was broken before and had outputs overwriting each other

minor ridge
#

i have this code to set my language level:

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

    withSourcesJar()
}

this should yet compilation still fails with (use -source 16 or higher to enable pattern matching in instanceof)

prime cliff
#

Only use the toolchain.

minor ridge
#

pretty sure i got all that

#

its my javadoc plugin failing btw idk if that helps

#

the rest seems to work fine

#

just the javadoc plugin is still under the impression that im using --release '8'

distant mango
#

send your full build.gradle

minor ridge
#

it fail when making the javadocs btw

#

the rest seems to compile fine

lament scarab
#

check your java build version

distant mango
#

also try w/o that lombok plugin

minor ridge
#

the gradle model auto sets language level to 8 btw

#

that aint me

lament scarab
#

No, I mean the gradle settings

#

Because you're not setting a language level

minor ridge
#
rootProject.name = "HopperLevels"

plugins {
    id("org.gradle.toolchains.foojay-resolver-convention") version("0.5.0")
}
include(":plugin")
include(":common")
include(":v1_19")

project(":v1_19").projectDir = file("nms/v1_19")

minor ridge
lament scarab
#

I mean

#

you only set the lang version on the compileJava task

minor ridge
#

and the toolchain as well

#

where else should it be set

#

shoulnt gradle grab it from the toolchain? i though that was its purpose

lament scarab
#

I mean, the toolchain is the toolchain

#

or, wait, er

#

I mean, I have no idea, it's clearly upset that the source level is set to 8 for some reason

minor ridge
#

well yea

#

though i also have no clue where the hell it gets 8 from

lament scarab
#

i'd just maybe see if you can set it on the javadoc task manually shrug_animated

minor ridge
#

i tried looking at that but cant rlly find a way to do so on that task

smoky violet
#

if you're using indra set the target java with that

#

really you shouldn't be using indra if you can't be bothered to read it's docs or know gradle basics

lament scarab
#

oh, lol, indra defaulting to j8 i guess

#

makes sense

#

:L

smoky violet
#

it's conventions for kyori projects, any other use is a nice side effect

minor ridge
#

anyways, thanks so much

shrewd glen
covert horizon
#

basically the lock files dont get deleted so i have to manually close intellij, delete lock file, then open it in order to import a project that uses gradle

#

updating to 8.3 fixed it

covert horizon
#

did not fix it i am still having stuff get locked and not automatically deleted. gradle plz. trying progressively older gradle versions until it goes away

lament scarab
#

windows?

covert horizon
#

windows 11

lament scarab
#

tried adding it to the AV exclusions?

covert horizon
#

i clicked the little popup that happened when i imported the project. i also turned off real time protection but i guess it turned itself back on

#

lemme try that

#

yeah its building now. frustrating

lament scarab
#

part of the issue I'd imagine is that gradle probably doesn't really handle platform oddities, and so there are potential cases where you get like a parallel task which tries to do stuff in there which can cause issues, ik git has had issue with AV software basically causing stupid issues like delaying files from unlocking, etc

#

the entire thing is generally just kinda fragile, ngl

covert horizon
#

thankfully my antivirus protects me from building projects with gradle. thanks cat

golden seal
#

assuming this is windows defender, turning it offis a PITA and gets worse every windows version

covert horizon
#

yes it is, only seemed to begin having this problem upon upgrading to w11. now i know how to avoid it

lament scarab
#

in theory you should just be able to tell it to ignore stuff like the .gradle folder

#

but, idk, as much as I hate myself, I don't do dev stuff on windows

covert horizon
#

i hate myself enough to do it. yeah there is an exclussion that i'll add to it and see how it goes becauses windows defender will just turn itself back on

proud maple
#

1.20.1 is the paper 1.20.1 version

bitter linden
#

Could forks be broken with 1.5.6 paperweight?

 % ./gradlew applyPatches

> Task :paper:applyServerPatches
error: Your local changes to the following files would be overwritten by merge:
        src/main/java/net/minecraft/core/dispenser/DefaultDispenseItemBehavior.java
Please commit your changes or stash them before you merge.

and its a different file every time I run ./gradlew applyPatches
Tried clean'd, cleanCache, and deleted api/server directories.

EDIT: Nevermind, don't move the directory to iCloud Drive

smoky violet
#

@idle jacinth dev bundle gen requires gnu diff

#

and probably won't work on windows even with it

#

so yes use wsl

idle jacinth
#

ok ty

#

🥺

lilac widget
#

Yeah 1.5.6 patcher is broken

prime cliff
#

applyPatches works for me in 1.5.6 but createReobfPaperclipJar has dependency issues. Let's see if it get fixed till the ed of month.

distant mango
#

what?

bronze ember
#

I mean, it's not gonna get fixed automatically

prime cliff
prime cliff
static urchin
#

The fact that I am trying to replicate this and get clapped at Reason: Task ':forktest-server:compileLog4jPluginsJava' uses this output of task ':clonePaperRepo' without declaring an explicit or implicit dependency. for createReobfPaperclipJar

bronze ember
#

Well, that's also a valid replication ^^

static urchin
bronze ember
#

I can't wait for the day when our tooling becomes more simple again

pallid elbow
static urchin
#

Yea we are all suffering KEKW

pallid elbow
granite valve
#

yeah, its something in pw 1.5.6, but idk what it is. not really a gradle whiz

covert horizon
#

so I still have the issue with lock files not being cleaned up when building with gradle. i have the entire directory in my exclusions as well as the project directory. the only way i can get around this is by disabling windows defender, but it turns itself back on after about a week. anyone dealt with and resolved this?

#

it's not even reliably resolved by disabling windows defender, so i don't really know what the cause could be

paper kestrel
#

are apiCoordinates and mojangApiCoordinates generated by paperweight locally, or downloaded from the repo?

#

(for paperweight dev bundle, for userdev)

hardy carbon
#

Ran gradle init on my maven project, did some minor changes and it seems to be throwing a weird error now

bronze ember
distant mango
#

try restarting intellij and building via cli

hardy carbon
#

How do you build via cli... this is from me reloading gradle btw

#

On restarting ij, its the same error

bronze ember
#

That paste site seems bork

#

Ah now it finally loaded, lol

hardy carbon
#

I mean... the error makes no sense its right there in the screenshot that there is a parenthesis there

bronze ember
#

Line 12 misses a closing bracket

hardy carbon
#

Oh.... the error was just massively misplaced

#

Thanks mini

bronze ember
#

Well, not really

#

The compiler can't possibly know where you want to close

#

(else we wouldn't need brackets)

hardy carbon
#

Yeah true ig

bronze ember
#

So it tells you where the first unexpected thing happened and you gotta trace back

long harness
#

not really sure if this belongs here, just asking for a mate. Is there a way to make your servers multiplayer? He's a streamer and would like to have me on but i'm unable to figure out a way to join (fanks xx)

bronze ember
#

you will need to forward your ports in your router and stuff if you host at home

#

but if its a public server you prolly should do that

#

join that channel and explain your problem and people will help

long harness
#

am I able to invite my friend to the server and have him sit in aswell?

bronze ember
#

sure!

echo kilnBOT
#

Please send large files/logs to a pastebin

#

Please send large files/logs to a pastebin

#

Please send large files/logs to a pastebin

untold elbow
#

having issues with my build

paper kestrel
#

click the elephant

untold elbow
#

except

#

the reobfJar

#

I don't get where I'm supposed to get that

#

the wiki says the shadow plugin

#

but I already have that

#

fixed

#

lastlyu

#

how do I know if my jar is obfuscated?

distant mango
#

by not using the jar that ends with -dev

untold elbow
#

alr thanks

untold elbow
#

just use the one with no -dev

#

right?

lament scarab
#

dev-all is still a dev jar.

odd tinsel
#

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem was found with the configuration of task ':forktest-server:compileLog4jPluginsJava' (type 'JavaCompile').
    • Gradle detected a problem with the following location: 'C:\Users\steli\IdeaProjects\paper-1.20.1.gradle\caches\paperweight\upstreams\paper.gradle\caches\paperweight\taskCache\minecraft.jar'.

      Reason: Task ':forktest-server:compileLog4jPluginsJava' uses this output of task ':clonePaperRepo' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

      Possible solutions:

      1. Declare task ':clonePaperRepo' as an input of ':forktest-server:compileLog4jPluginsJava'.
      2. Declare an explicit dependency on ':clonePaperRepo' from ':forktest-server:compileLog4jPluginsJava' using Task#dependsOn.
      3. Declare an explicit dependency on ':clonePaperRepo' from ':forktest-server:compileLog4jPluginsJava' using Task#mustRunAfter.
#

i updated paperweight from 1.4.0 to 1.5.6 and i now get this error

pallid elbow
#

well who broke it >:|

lament scarab
#

Basically, use 1.5.5 and jump back a few paper refs or basically you'd need to revert the change which requires that

#

I mean, basically, either .6 somehow broke it in a weird manner

#

or, it already existed and somehow became more likely to fire

#

afaik they're more betting on the latter; welcome to the joys of tooling doing horrible, horrible things

pallid elbow
#

well i suppose it'll get a lot more attention and quick once 1.20.2 drops

#

well since nobody with a fork can update paper

lament scarab
#

I mean, it's on the todo list

#

It's just literally anything typical of open source efforts, nobody is able to sit around for hours tryna work out how it's gone sideways and to patch it

#

PRs welcome, etc

pallid elbow
#

Sure, I just figure whoever updated paperweight to .6 is probably the person to know the most about what's going on

odd tinsel
#

well I can't build either with 1.5.5 or any other version

lament scarab
#

They already looked over it, basically; they have theories on what borked it, but, yea...

distant mango
#

send error

odd tinsel
#
Script compilation errors:

  Line 210:     classpath(tasks.filterProjectDir.flatMap { it.outputJar })
                                ^ Unresolved reference: filterProjectDir

  Line 210:     classpath(tasks.filterProjectDir.flatMap { it.outputJar })
                                                           ^ Unresolved reference: it

2 errors```
lament scarab
#

delete the api and server folder

#

reapply patches

pallid elbow
#

or if in IJ just revert that gradle build file to before

lament scarab
#

nah, it's probs because they updated PW and still have an old dangling set of configs around as the base

pallid elbow
#

cleanCache probably too

odd tinsel
lament scarab
#

did you delete the API and Server folder?

#

have you updated the paper ref to something recent?

odd tinsel
#

yes to both

lament scarab
#

Okay, and so what's the output of applyPatches?

odd tinsel
#

patches are applied just fine, that error pops up after i run createReobfBundlerJar

#

also here's the paper ref i'm using: 1b1c23010ac55e610e3a36f4e5b93a8198cff69c

pallid elbow
#

yeah you need to rollback to probably about 29d1c7b60244bb002d29a5dcfc9c995019f550ab

odd tinsel
#

e: file:///C:/Users/steli/IdeaProjects/paper-1.20.1/forktest-server/build.gradle.kts:210:21: Unresolved reference: filterProjectDir
e: file:///C:/Users/steli/IdeaProjects/paper-1.20.1/forktest-server/build.gradle.kts:210:48: Unresolved reference: it

still broken

pallid elbow
#

make sure you're not using paperweight 1.5.6

odd tinsel
#

using 1.4.0 right now

#

that error gets fixed with 1.5.6 only

pallid elbow
#

use 1.5.5

odd tinsel
#

same exact error

pallid elbow
#

well your shit is megabroke then :/

bronze ember
#

It's Gradle magic

lament scarab
#

Use 1.5.5, use an earlier paper ref

#

and it should work

pallid elbow
#

check the differences between your fork's various build.gradle.kt files vs paper's

odd tinsel
#

    // In general, keep this version in sync with upstream. Sometimes a newer version than upstream might work, but an older version is extremely likely to break.
    id("io.papermc.paperweight.patcher") version "1.5.5"```
odd tinsel
#

i haven't touched this fork at all yet

#

just can't build it

pallid elbow
#

have you done a cleanCache?

odd tinsel
#

i've invalidated caches numerous times, and quite funnily the same error pops up now with any gradle command

pallid elbow
#

that is not what cleanCache is

#

./gradlew cleanCache

#

run that, then applyPatches then try your reobf

odd tinsel
pallid elbow
#

fully delete the .gradle/ folder imo then try

#

if that doesn't work i got nothin

pallid elbow
lament scarab
#

Welp, slow because macbook air

#

updated gradle

#

updated the paper ref to the one cryptite showed

#

updated pw to 1.5.5

#

updated the patch so that it would apply, and it's currently compiling

static urchin
#

prior we just guessed that its there, which worked well enough but obviously wasn't correct

#

Why the configurations that now have a proper Provider as a dependency don't properly define that as a dependency on the getPaperUPstream task, I have no idea

slate salmon
#

So, I switched to paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT") as my dependency for Paper recently. Since then, I am getting three .jar files everytime I build the plugin.
I get:

  • <plugin-name>-<version>.jar
  • <plugin-name>-<version>-dev.jar
  • <plugin-name>-version>-dev-all.jar

Since the second option is the smallest, I assume this is just the plugin without any shaded dependencies.
As for the other two, I have no idea what these are since they appear to contain the same content when opening them but the -dev-all.jar version is about 100 KB smaller than just the .jar.
Is anyone able to clarify for me if it's intentional that I get three builds and what the difference between the first and third version is?

distant mango
#

the -dev ones are mojang mapped ones (not remapped)

#

the top one is the one you want to use

#

the 2nd one is not remapped and not shaded

#

3rd is a fat jar without remapping

#

1st fat jar remapped

rain pollen
lament scarab
#

I mean, that screams that ther eis a bug in the kotlin stuff

#

first google result

flat badge
#

Is there documentation on how to build folia from source?

loud cloak
flat badge
loud cloak
#

apparently that's not pinned, anyway see Paper's README and do the same on Folia's repo

flat badge
#

Yeah using the papermc commands worked. Thanks!

paper kestrel
#

does paper want a pr for mache updating to 1.20.2, or is it too manual (since you need to create a branch on github to pr to it)

i could pr against 1.20.2-pre2 and change base once the branch is made

lament scarab
#

We need to create a branch, etc

paper kestrel
#

ill create the pr, it can be changed / closed as you want

bronze ember
#

Don't, since we are experimenting with VF 1.10 and your work will be useless

#

We already have rc2 which is code wise the same

cinder moss
#

Could someone explain the difference between implementation and shadow in gradle?
I was previously using shadow but was suggested to use implementation but don't quite understand how to make use of it (if i should be using it)

distant mango
#

make sure you’re using the shadowJar task

#

and the right jar

cinder moss
#

I am using the shadowJar task and am using the jar that is output to my plugin folder:

shadowJar {
        relocate("space.arim", "me.dave.activityrewarder.libraries.paperlib")
        relocate("com.github.CoolDCB", "me.dave.activityrewarder.libraries.chatcolor")

        minimize()

        configurations = listOf(project.configurations.shadow.get())

        val folder = System.getenv("pluginFolder_1-20")
        if (folder != null) destinationDirectory.set(file(folder))
        archiveFileName.set("${project.name}-${project.version}.jar")
    }
#

Appears like when moving to implementation that the destinationDirectory is no longer the correct jar though?

lament scarab
#

I mean

#

piss in the wind

#

but

#
  1. maybe the configurations, but i thought shadow would derive from implementation
#
  1. minimize is sometimes evil
cinder moss
#

piss in the wind? lol

cinder moss
lament scarab
#

generally yes

#

maven shadows minimize jar is at least a bit more smart than shadows

cinder moss
lament scarab
#

I mean removing that line in general and seeing what it picks up

cinder moss
#

The file is now 0kb LOL

lament scarab
#

Welp

#

I'm glad i'm too dizzy to deal with this

cinder moss
#

Take a break I'm sure someone else will have some input!

distant mango
#

remove the destination sir and try again

cinder moss
#

with or without configurations = listOf(project.configurations.shadow.get())?

distant mango
#

without

cinder moss
#

I did that and it outputted a 75,000 kb jar in my build/libs, do i also need to change the first line of this?

java {
    configurations.shadow.get().dependencies.remove(dependencies.gradleApi())
    toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
distant mango
#

you don’t need that

#

the configurations part

cinder moss
#

gotcha

#

removed that and it's still 75,000 kb

#
plugins {
    java
    `kotlin-dsl`
    `maven-publish`
    id("com.github.johnrengelman.shadow") version("7.1.2")
}

group = "me.dave"
version = "2.0.3-BETA"

repositories {
    mavenCentral()
    mavenLocal()
    maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
    maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
    maven { url = uri("https://mvn-repo.arim.space/lesser-gpl3/") }
    maven { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/")}
    maven { url = uri("https://repo.dmulloy2.net/repository/public/") }
    maven { url = uri("https://jitpack.io") }
}

dependencies {
    compileOnly("org.spigotmc:spigot:1.20-R0.1-SNAPSHOT")
    compileOnly("org.geysermc.floodgate:api:2.0-SNAPSHOT")
    compileOnly("me.clip:placeholderapi:2.11.2")
    implementation("space.arim.morepaperlib:morepaperlib:0.4.2")
    implementation(files("libs/EnchantedStorage-2.0.0.jar"))
    implementation("com.github.CoolDCB:ChatColorHandler:v2.1.4")
}

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

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

    shadowJar {
        relocate("space.arim", "me.dave.activityrewarder.libraries.paperlib")
        relocate("com.github.CoolDCB", "me.dave.activityrewarder.libraries.chatcolor")

        archiveFileName.set("${project.name}-${project.version}.jar")
    }

    processResources{
        expand(project.properties)

        inputs.property("version", rootProject.version)
        filesMatching("plugin.yml") {
            expand("version" to rootProject.version)
        }
    }
}

This is what I currently have

distant mango
#

what is it supposed to be

#

also you probably don’t want to shade enchantedstorage?

cinder moss
cinder moss
distant mango
#

open your jar

#

you’re likely including paper or spigot or whatever

cinder moss
#

it's including gradle

#

that seems to be the biggest thing

distant mango
#

can you check what’s in the enchanted storage one

#

since it shouldn’t include gradle either

cinder moss
distant mango
#

weird

cinder moss
#

i'm just messing around with adding/removing lines to see what changes now

#

could it be the version of shadow i am using?

#

hmm not having much luck

daring trail
#

try grabbing a dependency tree? with the jar file in hand you can also probably just rename it from .jar to .zip and check directory sizes?

#

(i think? winrar will show directory sizes if you open the jar with that too but its been a while)

cinder moss
#

yeahh i was having a look, the biggest thing i saw was gradle

cinder moss
#

i just updated to gradle 8 and i think it might've fixed it?

daring trail
#

you shouldn't have to be removing it in the first place lol

daring trail
cinder moss
#

pretty much lmao

#

i'm now back to the point where it's not shading the files in </3

distant mango
#

what task are you using to build

cinder moss
#

shadowJar

distant mango
#

can you send your build script again

cinder moss
#
plugins {
    java
    `kotlin-dsl`
    `maven-publish`
    id("com.github.johnrengelman.shadow") version("8.1.1")
}

group = "me.dave"
version = "2.0.3-BETA"

repositories {
    mavenCentral()
    mavenLocal()
    maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
    maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
    maven { url = uri("https://mvn-repo.arim.space/lesser-gpl3/") }
    maven { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/")}
    maven { url = uri("https://repo.dmulloy2.net/repository/public/") }
    maven { url = uri("https://jitpack.io") }
}

dependencies {
    compileOnly("org.spigotmc:spigot:1.20-R0.1-SNAPSHOT")
    compileOnly("org.geysermc.floodgate:api:2.0-SNAPSHOT")
    compileOnly("me.clip:placeholderapi:2.11.2")
    implementation("space.arim.morepaperlib:morepaperlib:0.4.2")
    implementation(files("libs/EnchantedStorage-2.0.0.jar"))
    implementation("com.github.CoolDCB:ChatColorHandler:v2.1.4")
}

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

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

    shadowJar {
        relocate("space.arim", "me.dave.activityrewarder.libraries.paperlib")
        relocate("org.enchantedskies", "me.dave.activityrewarder.libraries.enchantedskies")
        relocate("me.dave.chatcolorhandler", "me.dave.activityrewarder.libraries.chatcolor")
    }

    processResources{
        expand(project.properties)

        inputs.property("version", rootProject.version)
        filesMatching("plugin.yml") {
            expand("version" to rootProject.version)
        }
    }
}
cinder moss
#

any thoughts? 😅

smoky violet
#

are you building with ./gradlew shadowJar and using the -all jar?

cinder moss
smoky violet
#

-all is the one with everything shaded

cinder moss
#

that one is currently building at 79000 kb when the final build should be 200kb max

smoky violet
#

well, open it and see what's inside

#

jars are just zips

cinder moss
#

Yeahh we were talking about that one earlier but it resolved at one point, it's got pretty much everything in it, gradle and a ton of libs that are packaged within spigot

smoky violet
#

run ./gradlew dependencies and check the dependency tree of implementation

#

you might need to exclude some transitive deps

cinder moss
#

which part of the output is the part I should be paying notice to

smoky violet
#

the tree for implementation

cinder moss
#
implementation - Implementation only dependencies for compilation 'main' (target  (jvm)). (n)
+--- space.arim.morepaperlib:morepaperlib:0.4.2 (n)
+--- unspecified (n)
\--- com.github.CoolDCB:ChatColorHandler:v2.1.4 (n)
smoky violet
#

check runtimeClasspath too

cinder moss
#
runtimeClasspath - Runtime classpath of compilation 'main' (target  (jvm)).
+--- space.arim.morepaperlib:morepaperlib:0.4.2
\--- com.github.CoolDCB:ChatColorHandler:v2.1.4
     \--- org.jetbrains:annotations:23.0.0
#

it all appears correct

smoky violet
#

try removing kotlin-dsl plugin

#

not sure what you need that for

cinder moss
#

that seems more like it :o

#

let me have a peak

#

yeah that seems to have sorted it!

#

thank you!

smoky violet
#

that plugin is for writing gradle plugins

#

adds a bunch of stuff to the class path for that

#

not sure why it didn’t show in dependencies

cinder moss
#

i seeee

#

i honestly had no clue - when i initially started using gradle my friend sent me a build script to start off with and hadn't really had any issues until trying to change stuff

#

do i need to package jetbrains/intellij annotations in the jar or is that something i can exclude

smoky violet
#

it depends if you need to read the annotations at runtime

#

but also I think paper includes it anyways

cinder moss
#

gotcha, that's perfect

#

i'll do that then :)

#

thank you for the help!

crystal nymph
bronze ember
#

That Screenshot is useless, lol

crystal nymph
#

shit

#

giood point

#

I should stop being lazy

#

It does run the reobf task

#

But I get this

bronze ember
#

Can you show the actual stacktrace?

#

Whatever that is looks confusing

crystal nymph
crystal nymph
bronze ember
#

Also, do you actually run the reobfusctated jar?

devout ledge
# crystal nymph

if you click on the images, Dumcord uncrops it. Dumcord's gallery implementation sucks.

crystal nymph
bronze ember
#

That's not the obfuscated jar then

crystal nymph
#

This ismy build.gradle.kts

and then I include it like this

    implementation(project(":paper:nms:nms-core"))
    implementation(project(":paper:nms:nms-v1_20_R1"))
bronze ember
#

What does build in the 1.20 folder produce?

#

I would guess you depend on the wrong jar or something of the subproject

crystal nymph
#

Its producing this

#

So I am kind of lost

#

I'm not sure why its not reObuscating when it does say it is running that task

#

even when I just run the build task I just get the unobuscated version even if it says

#

I even tried with this as my gradle and it produces the same output

bronze ember
#

Your lib folder has multiple jars, no?

crystal nymph
#

they are all the same

#

I decompiled all

bronze ember
#

Try removing shadow

#

Like why do you even run shadow in that subproject?

crystal nymph
#

Is there any way to remove it from a specicic project? Its applied to every sub project

bronze ember
#

Why do you apply to to every subproject?

#

Surely you only want it on core

#

Not on the impl modules

crystal nymph
#

you raise a good point man

#

is there any way to temp remove shadowjar from this sub module while I wait for my team to get back to me

bronze ember
#

Just remove it from all and only add it where needed, lol

crystal nymph
#

Actually after looking further it is getting obuscated

#

nut maybe not obuscating the handle thing? Im not sure whats going on with that

solemn iris
cinder moss
#

oooh

#

thanks for letting me know

bronze ember
#

any gradle pros in the chat? can I run tasks in afterEvaluate?
(I have a task that produces a file as output and I need that file in afterEvaluate to setup dependencies)

paper kestrel
#

I have many gradle cons /s

lament scarab
#

one of them being the configuration

#

you'd wanna pass in reobfJar or might be reobf

bronze ember
#

ended up just doing the work in afterEvaluate without using tasks

prime cliff
#

So paperweight 1.5.7 incoming?

hard dome
#

paperweight 1.5.7-SNAPSHOT already exists eyesSus

static urchin
#

It'll be ready for the release of 1.20.2 I'd hope yea

#

I am looking into a potentially nicer solution today, its been a wild ride

#

otherwise I guess we are stuck with the hack for a bit

smoky violet
#

like what paperweight userdev does

bronze ember
#

will look at that another day

#

just want to get mache to run at all inside paperweight

#

we need to do a hell lot of cleanup anyways because am copy pasting so much code over

cold hedge
#
> Task :paper:applyPatches
> Task :paper:lineMapJar
> Task :paper:prepareForDownstream

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

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':Scissors-Server:compileLog4jPluginsJava'.
> Could not resolve all files for configuration ':Scissors-Server:log4jPluginsCompileClasspath'.
   > Failed to read upstream data.

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

BUILD FAILED in 3m 45s
1:52:36 PM: Execution finished 'createReobfPaperclipJar'.
#

i get this error when trying to run createReobfPaperclipJar on a fork from paperweight (forktest)

#

i dont know how to fix this

#

paperweight is on 1.5.6

prime cliff
cold hedge
#
dependencies {
    remapper("net.fabricmc:tiny-remapper:0.8.8:fat")
    decompiler("net.minecraftforge:forgeflower:2.0.629.1")
    paperclip("io.papermc:paperclip:3.0.4-SNAPSHOT")
}
#

i updated these block of dependencies too and gradle to 8.3 to see if what would change anything

#

i'll try 1.5.7-SNAPSHOT

prime cliff
cold hedge
#

ah didnt know 1.5.6 had issues

#

thought it was just me

#

i thought it was a network connection / DNS issue on my end

prime cliff
#

I'll update to 1.5.7-SNAPSHOT myself and report back.

cold hedge
#

looks like it worked

prime cliff
#

Yeah seems so. Perfect, then I can drop the workaround.

pliant tartan
#

guys im trying to setup a paperweight plugin. i cloned paperweight-test-plugin and opened it with intellij idea and when gradle starts doing its thing i get an error saying that it was unable to get the mappings.

===
There was a failure while executing work items
A failure occurred while executing io.papermc.paperweight.tasks.GenerateMappings$GenerateMappingsAction
Unable to resolve class data binding for 'jdk/jfr/Event' which is listed as the super class for 'net/minecraft/util/profiling/jfr/event/NetworkSummaryEvent'

can someone help me please

prime cliff
#

Which vendor of the jdk do you use?

pliant tartan
bronze ember
#

Cursed

#

IBM stuff doesn't ship jfr it seems

#

Use a supported distribution like from Microsoft or Amazon or something

prime cliff
#

Temurin

agile skiff
#

i just recently switched from maven to gradle and i have been including external dependencies with the gradle shadow plugin. What is the recommended way of including external dependencies?

bronze ember
#

With the shadow plugin

agile skiff
#

so what i am already using is the recommended way?

static urchin
agile skiff
#

alright thanks!

drifting moss
#

Hi I'm going insane and hoping someone with more gradle experience than me can help me out here,

I'm trying to setup a plugin that depends on multiple NMS modules

my dependency setup looks like

dependencies {
    implementation project(path: ':bukkit:core', configuration: 'shadow')
    implementation project(path: ':nms:base', configuration: 'shadow')
    implementation project(path: ':nms:v1_19_R1', configuration: 'shadow')
    implementation project(path: ':nms:v1_19_R3', configuration: 'shadow')
}

I saw [In the pinned comment](#build-tooling-help message) the solution is meant to be to change my configuration from shadow to "reobf" but when I made that change to the nms modules they weren't included in the jar.

I've confirmed that the reobf jar is actually building and in the build folder it's just not being used for the full project jar.

this is what my build.gradle looks like in one of the NMS modules

plugins {
    id 'com.github.johnrengelman.shadow'
    id 'io.papermc.paperweight.userdev'
}

dependencies {
    compileOnly project(':nms:base')
    paperweightDevelopmentBundle 'io.papermc.paper:dev-bundle:1.19.2-R0.1-SNAPSHOT'
}

tasks {
    assemble {
        dependsOn(reobfJar)
    }
}

artifacts {
    archives shadowJar
}
distant mango
#

why are you using such an ancient paperweight version

#

also a horrible name

drifting moss
#

I'm just using the version that was in use when I setup the project originally as a single nms version plugin

#

ill update it, figured it was fine to keep the version consistent to the version of MC it related to

drifting moss
#

I have updated to 1.5.6 and am still facing the same issue unfortunately

drifting moss
#

if anyone is able to assist with this, please ping me if I miss your response as id love to find a way to resolve this! thank you!

devout adder
#

Heyo i previously used intellij and gradle it all worked perfectly fine (still does on windows) but i reacently switched to linux and im getting this error, i have no idea how to fix it please help 🙏

devout adder
#

i stalked some post on https://slack-chats.kotlinlang.org/c/gradle that said they fixed it by deleting ~/.gradle, i tried deleting that as well as the .gradle and gradle inside of my project but that didnt seem to fix it PensiveWobble

lament scarab
#

I mean

#

what the fuck is javasland and why are you pulling it in?

devout adder
#

idk?

#

its just a normal gradle using kotlin

#

@lament scarab sorry for the ping but do you want me to send the screenshot of the gradle file?

rapid fractal
#

no - ping.
Ping anyway Despairge

devout adder
#

shh PensiveWobble

#

im desperate

runic aurora
#

When you ping cat it literally makes it impossible for them to read your message

lament scarab
#

I mean, now that my eye is fully gone, it's not that bad anymore

#

but, i just generally walk out when they pull the "sorry for the ping" thing

next forge
#

Eye is fully gone? Jeez like fr?

slate salmon
runic aurora
frozen berry
#

Heya! I'm writing an API and I've tried putting it on Jitpack with the following code: https://github.com/Artillex-Studios/AxAPI/blob/e8f80954a230a30484b5fc528864f33d09f6824b/build.gradle#L66-L75

I've tried putting the publishing part literally everywhere, yet it doesn't want to work.
This is what I have in the other project: (yes, I do have the Jitpack repo in that project)

implementation 'com.github.artillex-studios.AxAPi:AxAPI:e8f80954a2:all'

And I get the following error:

Could not find v1_20_R1-e8f80954a2.jar (com.github.artillex-studios.AxAPi:v1_20_R1:e8f80954a2).
Searched in the following locations:
    https://jitpack.io/com/github/artillex-studios/AxAPi/v1_20_R1/e8f80954a2/v1_20_R1-e8f80954a2.jar

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

What's really interesting, is that if I change implementation to compileOnly, gradle doesn't yell at me (however I want to shade this API, so compileOnly won't really work)
(I hope this is the appropriate channel for this)

bronze ember
#

Checked jitpack logs?

#

Most likely the build failed

#

Which is why jitpack shouldn't be used, it's not stable

#

You can't rely on it

frozen berry
#

Don't think the build failed

bitter moss
#

I am trying to compile my Velocity branch with the up to date upstream version. I am getting the following build system error:
'```* What went wrong:
An exception occurred applying plugin request [id: 'org.gradle.toolchains.foojay-resolver-convention', version: '0.4.0']

Failed to apply plugin class 'org.gradle.toolchains.foojay.FoojayToolchainsPlugin'.
Could not create plugin of type 'FoojayToolchainsPlugin'.
Could not generate a decorated class for type FoojayToolchainsPlugin.
org/gradle/jvm/toolchain/JavaToolchainResolverRegistry```
smoky violet
#

what do you mean by "compile my Velocity branch with the up to date upstream version"?

#

that sounds like you have an outdated version of gradle or something

bitter moss
#

I have a branch of Velocity with minimal code changes and I merged the 1.20.2 branch.

smoky violet
#

sounds like a bad merge

#

did you use github web ui

bitter moss
bitter moss
#

Does Velocity need a bleeding edge Gradle version?

smoky violet
#

as a troubleshooting step I would git diff against upstream and make sure only the intended differences are there

bitter moss
#

Only 2 source files are changed and one file added.

#

I will try updating Gradle.

#

It is the same version that used to work fine before.

smoky violet
#

the current build should work

#

it's passing ci

#

might just need to nuke gradle caches, updating gradle/foojay conventions could acomplish the same thing

quaint raven
#

you can try to switch to the current build and validate upstream is compiling to make sure it's not caused by your changes

bitter moss
#

I think after deleting Gradle and downloading the newest version it is working now 😒

#

Thank you so much for you help though. It's the kind of things that are difficult to find as a Java toolchain noob.

#

😄

bitter moss
#

Sorry I am back with new problems.

#

It generates a ~1KB jar file 😒

#

I am calling "Gradle.bat build". It builds a lot of things.

quaint raven
#

check the directory proxy/build/libs for velocity builds

bitter moss
#

Yeah

#

there is a single file "velocity-3.2.0-SNAPSHOT.jar"

#

It has 1KB and obviously can't run.

quaint raven
#

delete the build directories from the submodules and try to build it again.

#

oh wait, you're looking in the wrong directory

#

proxy/build/libs is not build/libs

bitter moss
#

Oh yes.

lilac widget
#

Is there a recommended way to run any Gradle tasks on a Paper fork while offline? Most tasks fail on the upstream data tasks which fail without internet

distant mango
#

there’s —offline but I have no idea if that would work

odd tulip
#

why does the run paper server plugin generate a new world every time it starts?

paper kestrel
#

It doesn't?

odd tulip
#

I was spawned into a completely new world when I re-ran the run server task initially but then it stopped... that was weird

#

either that or it teleported me elsewhere and loading chunks is extremely slow., which is likely

smoky violet
#

you have to properly stop the server for it to save

#

rerun will kill it

odd tulip
#

oh thats a shame

#

stopping/rerunning when using the old method did a safe stop

#

is there a way to configure it to safely stop?

smoky violet
#

gradle doesn't give you control over how the kill signal is passed to the child process

#

so not really

agile skiff
dusk quail
#

this is my current project layout, for some reason the build.gradle in ebiclib-nms refuses to pickup the spigot-v1_20-R1 subproject, its registered but no combination of ebiclib-nms and spigot-v1_20_R1 with colons works

shy sage
#

sir this is paper

#

altho I don't know if anyone can help without your build.gradle

#

or whatever you are using

cold hedge
#

I have a completely clean Paper fork with nothing except the default build changes

#

I try and run applyPatches and then build and this test fails

#

Targeting the latest 1.20.2 paper commit (c4ba28a21a923a99c8ef9a9e42b66862c04743f5)

distant mango
#

looks like an encoding issue

cold hedge
#

Not exactly sure how to fix this

#

Because there are zero patches except the build changes

#

from ForkTest

sharp trellis
#

Hi, I'm trying to build paperclip jar in my fork but I have this error:

PS D:\Intellij Projects\TestFork> ./gradlew createReobfPaperclipJar                                                                                                                                                                                                
> Task :testfork-server:compileLog4jPluginsJava FAILED                                                                                                                                                                                                             

FAILURE: Build failed with an exception.                                                                                                                                                                                                                            

* What went wrong:
A problem was found with the configuration of task ':testfork-server:compileLog4jPluginsJava' (type 'JavaCompile').
  - Gradle detected a problem with the following location: 'D:\Intellij Projects\TestFork\.gradle\caches\paperweight\upstreams\paper\.gradle\caches\paperweight\taskCache\minecraft.jar'.

    Reason: Task ':testfork-server:compileLog4jPluginsJava' uses this output of task ':clonePaperRepo' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.    

    Possible solutions:
      1. Declare task ':clonePaperRepo' as an input of ':testfork-server:compileLog4jPluginsJava'.
      2. Declare an explicit dependency on ':clonePaperRepo' from ':testfork-server:compileLog4jPluginsJava' using Task#dependsOn.
      3. Declare an explicit dependency on ':clonePaperRepo' from ':testfork-server:compileLog4jPluginsJava' using Task#mustRunAfter.
sharp trellis
#

nvm, fixed

analog crag
#

how did you fix it? i have the same error

#

paperweight snapshot?

sharp trellis
#

yes, 1.5.7-SNAPSHOT

agile skiff
#

when i try to run runDev i get this error https://pastes.dev/qxoNYPai9X. my JAVA_HOME is set to "C:\Program Files\Eclipse Adoptium\jdk-17.0.8.101-hotspot". Can someone help me?

hollow nest
#

Hello.

I added paperweight dependencies to my project and everything was fine, but when I needed to compile the code, I used shadowJar. But the newly obfuscated NMS code was compiled into a separate .jar, and not into a .jar with the main code.

I read the description, but still couldn't find where to look for information.

Can someone tell me how to make shadowJar immediately include the obfuscated NMS code in the same .jar?

https://github.com/PaperMC/paperweight-test-plugin

GitHub

test plugin for paperweight-userdev. Contribute to PaperMC/paperweight-test-plugin development by creating an account on GitHub.

lament scarab
#

You don’t, reobfJar needs the input from shadow jar to run

#

Best advice if you want the allusion of a single jar would be to move the output folder of shadow jar, but, don’t, that jar is still useful for devs wanting to test stuff

hollow nest
distant mango
#

see the test plugin

hollow nest
#

Sorry, I didn't see this...

outputJar.set(layout.buildDirectory.file("libs/PaperweightTestPlugin-${project.version}.jar"))

echo kilnBOT
rain vessel
#

I got this error when trying to make my plugin publish to the gradle plugin portal, it is erroring when it tries to build and it seems to have to do with paperweight:

Run ./gradlew build
  
Downloading https://services.gradle.org/distributions/gradle-8.3-bin.zip
............10%............20%.............30%............40%.............50%............60%.............70%............80%.............90%............100%

Welcome to Gradle 8.3!

Here are the highlights of this release:
 - Faster Java compilation
 - Reduced memory usage
 - Support for running on Java 20

For more details see https://docs.gradle.org/8.3/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '/home/runner/work/GenesisMC/GenesisMC/mainPlugin/build.gradle' line: 27

* What went wrong:
A problem occurred evaluating project ':mainPlugin'.
> Could not find method pluginBundle() for arguments [build_kdmfo4j5b7rjmii5e6udjk03$_run_closure3@7d3addf8] on project ':mainPlugin' of type org.gradle.api.Project.

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

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':mainPlugin'.
> Failed to notify project evaluation listener.
   > paperweight requires a development bundle to be added to the 'paperweightDevelopmentBundle' configuration, as well as a repository to resolve it from in order to function. Use the paperweightDevBundle extension function to do this easily.

* Try:
> Run with --stacktrace option to get the stack trace.
distant mango
#

send build script(s)

rain vessel
#

K one sec

rain vessel
#

This is the script I changed(one of 3), which is the one I want to publish to the gradle plugin portal

lament scarab
#

I mean

#

you're applying the userdev plugin

#

and so it expects for the userdev stuff to be setup

#

then again, your pluginBundle thing blew up, so I'd guess maybe it janked up and failed to get that far

rain vessel
#

How could I fix it?

lament scarab
#

work out why it blew up tryna call something

#

iirc, generally make sure that gradle is updated along with your plugins

#

No idea why you're tryna pull in plugin-publish though

#

that project looks all forms of janked up

rain vessel
#

Yeah I'm not that good with gradle lol

lament scarab
#

I mean, your paper plugin is generally not going to be a gradle plugin

#

idk why that would ever be the case

#

if you actually have a gradle plugin, seperate it out

rain vessel
#

It's a paper plugin. Is the plugin portal only for gradle plugins?(still kinda new to gradle stuff lol, don't rly work with it much)

lament scarab
#

yes

rain vessel
#

💀

#

Alright well I found the issue now XD
Didn't read that it was meant for gradle plugins
What repository would you recommend for a paper plugin?

lament scarab
#

on what respect?

#

if you just mean a place to publish your plugin for others to use, hangar, modrinth

rain vessel
#

No, for its api. I already have it on Spigot, modrinth, and the hangar(which is rly cool btw)

lament scarab
#

codemc is pretty much the only "central" mc repo, outside of maven central

rain vessel
#

Oki doki, ty :)

rain vessel
lament scarab
#

Yes

#

afaik they still offer public hosting

rain vessel
#

Tysm

rain vessel
#

What does paper use for it to host its build artifacts for the api and userdev? I heard it uses the maven central repository but it made no sense bc they have a notice on their setup page saying that you can't modify/delete published artifacts

#

How do u update ur builds for the api/userdev?

granite valve
#

paper has its own maven repo

#

the userdev gradle plugin is published to the gradle plugin portal, but the API/devbundle artifacts are hosted on paper's maven repo

rain vessel
#

Nice!

#

Ty

quaint raven
#

Does anybody has a workaround for the not responding https://javadoc.io website? I can't compile velocity / paper fully without that.

distant mango
#

remove the javadoc io stuff

bronze ember
#

We are considering to rehost that stuff

zenith flower
distant mango
#

who hosts that?

glass sable
#

it's not like you can't easily host those on github pages 👀

#

but javadocs.dev seems like a nifty tool (even though there is like zero info about it lol)

#

Finally migrated https://t.co/Lm57AfzpOO from Scala 2 + http4s to Scala 3 + ZIO 2 with ZIO Direct & ZIO HTTP. GraalVM Native Image static binary = 14MB container. Running on Google Cloud Run, globally load balanced across 37 regions.

https://t.co/9HcamJ017J

Likes

112

dusky timber
#

Bonus points: It's open source

cedar prairie
agile skiff
#

yep multiple times. doesn't work on the master branch nor any of the patch branches

lament scarab
#

probably a weird windows issue

agile skiff
#

yeah i tried on wsl there it works

lament scarab
#

theres only like 1 person on the team who uses windows though, so

agile skiff
#

do you guys in the team use wsl or directly linux

lament scarab
#

most of us use macOS or linux

agile skiff
#

alright thanks!

agile skiff
distant mango
#

for desktop?

agile skiff
#

i think i will be using wsl

distant mango
#

if you're using WSL ubuntu is fine

#

and the default

agile skiff
#

alright thank you

agile skiff
bronze ember
#

filterProjectDirs didnt consider windows line separators, so runDev was compiling against a jar that contained the unpatched vanilla classes

#

as a bainaid fix, it seems like changing the order of the classPath for the runDev task in Paper-Servers build script (last lines) works

#

cc @hard dome since you ran into this too

smoky violet
#

better bandaid is just bumping pw to 1.5.7-SNAPSHOT until the release

bronze ember
#

or that since jmp just merged the PR

smoky violet
#

:p

hard dome
#

oh awesome, that'll save me having to use a VM

bronze ember
#

(just use wsl)

hard dome
#

tried wsl but it just kept crashing intelliJ

bronze ember
#

heh

distant mango
lament scarab
#

My suggestion would be to get a mac

distant mango
#

with what money

lament scarab
#

I'm too dizzy to come up with an answer which isn't "find a sugar daddy"

bleak cedar
upper monolith
#

Compile using java 17

bleak cedar
#

Where am I using the idea to set it up

bronze ember
#

Set the project SDK

sharp trellis
#

Hi, what's wrong?

com.intellij.openapi.externalSystem.model.ExternalSystemException: Failed to apply dev bundle patches. See the log file at 'D:\Intellij Projects\RoxyItems\.gradle\caches\paperweight\setupCache\patchedSourcesJar.log' for more details. Usually, the issue is with the dev bundle itself, and not the userdev project.
Failed to apply dev bundle patches. See the log file at 'D:\Intellij Projects\RoxyItems\.gradle\caches\paperweight\setupCache\patchedSourcesJar.log' for more details. Usually, the issue is with the dev bundle itself, and not the userdev project.
Operation has non zero exit code: 1
brave widgetBOT
elder vector
#

actually having that exact same problem and log after trying to update the dev bundle from 1.20.1 to 1.20.2

sharp trellis
#

1.20.1 works

rancid widget
#

when is Velocity getting updated?

golden seal
#

when it's ready

#

this is the not right channel for discussion

fervent ferry
#

Even after updating paperweight to 1.5.8, I'm still getting issues with patching.
I've ran clean, cleanCache and cleanAllPaperweightUserdevCaches
Is there something else I need to manually clean?

smoky violet
#

did you read my response to your deleted comment

fervent ferry
#

Got it, thank you very much

#

Sorry about the deleted comment, I thought it was working after cleanCache but it turns out it wasn't 😅

smoky violet
#

I probably should have been a bit more detailed in the closing message anyways

cold hedge
brave widgetBOT
cold hedge
#

I get this error specifically when trying to use paperweight userdev with 1.20.2

smoky violet
#

basically, --refresh-dependencies

fervent ferry
#

So ./gradlew reobfJar --refresh-dependencies should work?

lament scarab
#

yes

fervent ferry
#

Let me try deleting some caches...

smoky violet
#

1.20.2-R0.1-20231010.011415-29 is latest

fervent ferry
#

Ah, so -SNAPSHOT doesn't work?

smoky violet
#

it does

cold hedge
#

that would explain why Jenkins built it and I couldn't

smoky violet
#

but sometimes your machine doesn't pull latest

cold hedge
#

Jenkins uses --refresh-dependnecies in my script

smoky violet
#

it was published like 20 mins ago

fervent ferry
#

Ah yes, seems like it wasn't pulling latest. Specifying 20231010.011415-29 worked. Thank you so much for your help

lethal canyon
brave widgetBOT
distant mango
pliant carbon
# lethal canyon anyone can help?

like powercas_game said, this is something not related to the gradle build tool, but with paper directly, so #paper-help is more appropriate for this.
More people with paper knowledge tend to look there, so please ask your question again over there.

pearl swallow
#

Hello, I have this error, can anyone help me please ?

brave widgetBOT
zenith flower
#

The second dependency is the spigot server jar, including craftbukkit and nms classes

#

Won't/shouldn't be on a public repo

#

Do you need server internals or just the api?

pearl swallow
#

I need nms

lament scarab
#

it's not in a public repo

#

you'd ned to run buildtools or whatever

pearl swallow
spice sparrow
#

🚨 1.8

proud jay
#

1.8 💀

pearl swallow
spice sparrow
#

banned for life

deft atlas
#

Hi for some odd reason, the task applyPatches fails when trying to run it? but it seams to work locally?

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':paperfork-server:compileLog4jPluginsJava' (type 'JavaCompile').
  - Gradle detected a problem with the following location: '/var/jenkins_home/jobs/paperfork/jobs/paperfork/workspace/obsidian-api/build/classes/java/main'.
``` Anyone know if this is like a issue with jenkins or like something we can fix in the build config?
median pulsar
#

is there any way to get paperweight to not use the internet after the upstream repos have been cloned in .gradle/caches/paperweight/upstreams?

main mica
#

using gradles offline mode should work

median pulsar
#

./gradlew --offline applyPatches

main mica
#

yeah for the first applyPatches you will need an internet connection because it downloads some mojang stuff too

median pulsar
#

yeah but it also tries to access the internet the second time i run applyPatches

cinder ember
weary salmon
#

Hi there,
At this moment I have a Maven project where it builds the .jar but I would like to have a way where it outomatically upload the .jar created in the target folder to my testserver on my VPS (in my dedicated server).
And after that reload the server to get the new jar enabled.
How would I do this?

spice sparrow
glass sable
#

would be better situated in your IDEs run configuratin thatn in maven tbh

weary salmon
lament scarab
#

you'd use run tasks

#

I mean, on linux I used to just basically ssh to rm the og plugin jar, scp over the new one, and then just poll something to send a signal over to the server to run a reload of that plugin

#

worth noting, that was a dev server, and I spent stupid amounts of time to make it as safe as possible in the territory of unsafe shit

primal wing
#

not really paper related, but at this point im starting to be pretty desperate in this. ive got a shadowjar plugin setup for my project with following configuration, whenever i want to apply it to my test project i get this weird error, since the library should be downloaded automatically(gson is avaialable on mvncentral), any ideas? ive tried reading through docs but found nothing + nobody knows what could be casuing this

grand niche
#

show the entire stacktrace

empty ledge
#

Is there an article on how to make a custom paper fork?

main mica
grand niche
#

you're just missing gson, is that a transitive dep from the ones you have included?

#

shadow doesn't filter transitives iirc

#

or wait, err

primal wing
grand niche
#

no

#

shadow doesn't filter entire transitive trees

#

only the explicitly defined dependencies are included

primal wing
primal wing
#

ive tried making the dependencnies transitive using api configuration but that doesnt change anything

grand niche
#

it's outlined in the shadow documentation

empty ledge
#

Is it possible to make s paper fork for removing Minecraft features I don’t want?

main mica
#

sure

empty ledge
#

As an example, can I just remove fall damage completely?

main mica
#

a fork for just that seems a bit unnecessary, considering thats one event to cancel and thats it

#

but you can, sure

shy sage
gaunt spruce
#

you can check whether this damage is from falling or not, if so, then use setCancelled

#

like
if(e.getType().equals(DamageTypes.Falling) {
e.setCancelled(true)
}

#

but do not copy this code, I wrote on the phone, it may be incorrect

distant mango
#

wrong channel

shy sage
#

Actually a better solution is /gamerule fallDamage false 😹

shy sage
gaunt spruce
shy sage
#

Altho, the code is wrong, the anwser itself isn't.

empty ledge
west marsh
#

Following the conversation from #paper-dev - I'm developing a plugin in Kotlin that's meant to be used as a dependency in other plugins. It has the following dependencies:

    implementation(kotlin("stdlib-jdk8"))
    implementation("net.objecthunter", "exp4j","0.4.8")
    implementation("org.apache.commons:commons-math3:3.6.1")

Am I doing the relocation correctly? Should kotlin be relocated?

    shadowJar {
        fun reloc(pkg: String) = relocate(pkg, "${project.group}.${project.name}.dependency.$pkg")

        reloc("kotlin")
        reloc("net.objecthunter")
        reloc("org.apache.commons")
    }
verbal skiff
#

afaik the client plugin needs to explicitly relocate the package in the same way

#

then it could work

#

alternatively the client shades and relocates it separately

#

but I haven't found a way yet to relocate transitively

#

if you find something let me know, it would interest me

lament scarab
#

Basically, best advice is, write your API in java

#

otherwise, unless you're using paper plugins, there is some potential classloader headaches if you don't relocate

west marsh
#

I am using paper :P

static urchin
#

paper plugins in a specific plugin format

#

it is highly experimental tho

#

general suggest I guess would just be, implement the API separately from your impl in plugin B.
Write the API of plugin B in java, write the impl in whatever you want

west marsh
#

I see, thanks! I will do that for my next plugin. For now I'll try to figure out how to relocate the package in the same way

static urchin
west marsh
lament scarab
#

you would have the exact same relocation

#

if plugin a relocates io.kotlin to my.mystical.plugin.io.kotlin, then your dependencies also need to have that exact same relocation

boreal wedge
west marsh
#

I reloated kotlin the same way, didn't I?

boreal wedge
lament scarab
#

Depends on the error you’re getting, you’d need to make sure it lines up (relocations)

#

Not feeling good so lying down

#

This channel is for support with build tooling

jade fulcrum
#

mb

west marsh
boreal wedge
west marsh
# west marsh This is the relocation for my main plugin: `relocate("kotlin", "com.github.gameo...

(The error is:
Caused by: java.lang.LinkageError: loader constraint violation: loader 'partigon-1.0.7.jar' @69787019 wants to load class com.github.gameoholic.partigon.dependency.kotlin.Pair. A different class with the same name was previously loaded by 'HubInteractions-0.1.1.jar' @4d62bdb7. (com.github.gameoholic.partigon.dependency.kotlin.Pair is in unnamed module of loader 'HubInteractions-0.1.1.jar' @4d62bdb7, parent loader java.net.URLClassLoader @66cd51c3)

#

Which I don't really understand since it's the same package? 🤔

static urchin
#

plugin A cannot also ship kotlin

#

you relocate your usage but don't shade it pretty much

#

and use plugin Bs kotlin stdlib

#

otherwise, yea, plugin A is gonna try to load a class called Pair from its jar but plugin B, sharing a classloader with plugin A already has the same class loaded; plugin A explodes

west marsh
#

ahh gotcha! How would I relocate the usage without shading and shipping it?

distant mango
#

same as normally

#

except don’t shade it in lol, so compileonly

west marsh
distant mango
#

iirc the kotlin plugin automatically adds it as a implementation dependency?

west marsh
#

Hmm, possibly? How would I make it not do that :P

distant mango
#

you’d have to google that

west marsh
#

Yeah reading the docs it does say it's automatic, I found how to disable it
edit: so according to the docs, you disable it by adding kotlin.stdlib.default.dependency=false to gradle.properties but it doesn't change anything.. sigh

west marsh
#

Trying to use a plugin as a dependency in another plugin, both are written in Kotlin.
I'm trying to make it so the main plugin doesn't ship kotlin, and uses the dependency's stdlib instead.

#

Even if I make the stdlib compileOnly, the kotlin plugin automatically adds it as an implementation regardless

primal wing
#

i used something like this

#

same way paperweight does it iirc

final jewel
#

white background and no syntax highlight. This mf opened build.gradle.kts with notepad

rapid fractal
muted acorn
#

Im experiencing gradle sync issues today, i have never seen this before:
Didn't change anything in the gradle file

#

Is this just a repo downtime?

distant mango
#

looks like it

muted acorn
#

damn it

distant mango
#

nvm

#

just really slow

primal wing
#

or github

final jewel
primal wing
#

ye that was obvious haha

muted acorn
#

other people confirmed that it works for them