#build-tooling-help

1 messages · Page 25 of 1

smoky violet
#

in some places we override committer or author but not everywhere

#

maybe mini tried to change it and missed something

#

but it’s been needed to set those since we started using pw iirc

proper grove
#

im using paperweight to make a fork of paper, but when i try to run the gradle task applyAllServerPatches, it doesnt exists? im using paperweight 2.0.0-beta.18

smoky violet
#

maybe try checking what tasks do exist...?

proper grove
#

it should exist

#

according to this other task

smoky violet
#

it says something specific

#

you need to be more specific about the issue you're having

proper grove
#

when i try to run ./gradlew applyAllPatches

it throws this error

OpenJDK Runtime Environment Temurin-21.0.8+9 (build 21.0.8+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.8+9 (build 21.0.8+9-LTS, mixed mode, sharing)
Reusing configuration cache.

> Task :applyPaperApiFilePatches
Applied 0 patches

> Configure project :Symphony
paperweight-patcher v2.0.0-beta.18 (running on 'Linux')

> Task :applyAllPatches FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Task 'applyAllServerPatches' not found in project ':Symphony'.

* Try:
> Run gradlew tasks to get a list of available tasks.
> For more on name expansion, please refer to https://docs.gradle.org/9.0.0/userguide/command_line_interface.html#sec:name_abbreviation in the Gradle documentation.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to generate a Build Scan (Powered by Develocity).
> Get more help at https://help.gradle.org.

BUILD FAILED in 3s
6 actionable tasks: 4 executed, 2 up-to-date
Configuration cache entry reused.```
smoky violet
#

something is wrong with your configuration, that's a task in the sever project

#

hence why applyAll runs a nested gradle process after setting up the server

proper grove
smoky violet
#

I suggest comparing to paperweight-examples which built successfully on github actions

brisk belfry
#

Per file patches are not supported by forks right?

main mica
#

no they work fine with forks

#

e.g. Purpur is mostly file patches

brisk belfry
#

Ahh okay you need to run the fixup patched

#

My bad, thanks for the food for thought.

unkempt geode
#

<@&748618676189528155>

#

wow that was fast

zenith stream
zenith stream
#

nvm, forgot to bump gradle itself to 9.0.0 🤦

zenith stream
#

Got another issue though:

> 'runClasspath' is empty and no version was specified for the 'runServer' task. Don't know what version to download.

* 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 generate a Build Scan (Powered by Develocity).
> Get more help at https://help.gradle.org.
BUILD FAILED in 434ms
11 actionable tasks: 1 executed, 10 up-to-date
#
runPaper {
        disablePluginJarDetection()
    }

tasks.runServer {
    minecraftVersion("1.21.4")
    dependsOn("shadowAll")
    pluginJars = files("/build/libs/ChatFormatter v${project.version}.jar")
    // We need to start the server with Java 21, but jar is built with Java 17
    javaLauncher.set(javaToolchains.launcherFor {
        languageVersion.set(JavaLanguageVersion.of(21))
    })
}
final jewel
#

and what is the shadowAll task, it should automatically pick the shaodwJar task

#

it'd be better to just see your build script tbh

zenith stream
#

it's because it's a multi-module project

dusk quail
#

<@&748618676189528155>

torn sonnet
#

handled

dusk quail
#

tyty

gentle viper
#

hello, how can I go about updating my fork from upstream? I'm currently at version 1.21.7 and have made some patches myself but I'd like to update to the most recent commit to paper

lament scarab
#

generally, update the paper ref and such, apply your patches, making sure that the single file patches apply, if not, fix and rebuild those and then apply again, etc, until you get through the entire process and have updated patches

gentle viper
#

ok so I updated gradle.properties and tried applyAllPatches and got some fails, for my build file for fork-server

#

it generated a build.gradle.kts.patch.rej how do I go about fixing this as its looks different to a typical merge conflict

lament scarab
#

generally, manually

#

you could use tools like wiggle but often much easier to just redo the tweaks manually, and then rebuild the single file patches and give it another shot

gentle viper
#

ok i'll have a go thanks

#

so I fixed my issue with my build file, rebuilt single file patches then re applied patches and got a new reject with CraftPlayer so i just keep going in this cycle until its all done?

lament scarab
#

Basically, yes

#

depends on what stage you're in, afaik for file patches it should apply all of them in one go and give you a bunch of rej files to fix that you'd then need to rebuild the patches from that step

gentle viper
#

alright

#

im slightly confused by the task names

#

how does:
rebuildServerFilePatches - Rebuilds paperServer file patches
differ to:
rebuildPaperSingleFilePatches - Rebuilds all paper single-file patches

lament scarab
#

It all ties down to the patch tasks you create in your gradle config

#

single file patches are explictly declared inside of your build config

#

the group ones are also declared there, you generally end up with fork specific named ones instead of "paperServer" ones, iirc

gentle viper
#

oh i see

#

so I rebuilt my patches and ran applyAllPatches succesfully but don't seem to have new patch files coming in from upstream

gentle viper
#

oh I needed to run specific tasks to apply all the patches

gentle viper
#

do the fork-server fork-api build files use the patch system for tooling convenience because i dont think there's any other reason to not just include the build files directly is there?

smoky violet
#

you can do the whole thing with bash scripts if you want

lament scarab
#

They use patching because the source files are subject to change at any time for various reasons

#

i.e. dependencies, etc

gentle viper
#

i just need to fix pulling com.otherfork.stuff

gentle viper
#
> Task :applySakuraSingleFilePatches FAILED
Patch /home/kynes/Octane/prism/prism-server/build.gradle.kts.patch failed:
[WARN] Missing patch target for sakura-server/build.gradle.kts.patch

Patch /home/kynes/Octane/prism/prism-api/build.gradle.kts.patch failed:
[WARN] Missing patch target for sakura-api/build.gradle.kts.patch

I'm forking a fork by registering an upstream and get this error on ./gradlew applyForkPatches

smoky violet
#

ok

brisk belfry
#

i think what jmp tried to tell you is that the build.gradle.kts file that the patch was created for isnt there anymore, so it cant apply the patch

gentle viper
#

yeah but I kind of already know that

#

i've not neglected to read it

brisk belfry
#

so if you know the issue what do you want to know?

gentle viper
#

well i think the issue is much more complex than that

#

i don’t think my fork upstream are being pull/patched? correctly if at all so the dirs aren’t creating and the patch can’t apply

gentle viper
#

im really not sure anymore

#

is there somewhere I can look to check if I'm doing this right

paper kestrel
#

Where does mache's parchment data come from? I see it's on the maven in a papermc group, but is it a private(?) fork of parchment?

The last upstream update was 2 months ago, so is the version number being per-snapshot the only change?

lament scarab
#

The only change is the artifact location or something in order to not conflict with their releases if they drop them for that version

#

it's literally just the normal repo but published somewhere useful for us

paper kestrel
#

Is it just published manually to each snapshot version then?

static urchin
#

Yes

waxen zephyr
#

Hello, I'm running into an issue with paperweight related to Netty version.
When I apply the io.spring.dependency-management plugin with userdev, Netty version gets overridden

#

is there a way to specify the version of Netty ?

#

I also tried these, but they didn’t work

bronze ember
lament scarab
#

Maybe

coarse ginkgo
#

I import the same exact artifact as a dev bundle in two subprojects and IDEA recognizes them as separate external libraries, effectively duplicating search results for Find Usages, Find in Files, etc, any way to prevent/fix that?

#

I'd assume this happens because paperweight saves the mappedServerJar.jar file separately for each subproject instead of saving it in the root project's gradle task cache, although the understanding of that doesn't make the issue magically disappear img_argh

smoky violet
#

the setup task must own it's outputs so it has to copy from the global cache

#

you could not apply paperweight to one of them

#

and then export the server deps as a consumable configuration on the one with pw

#

never tried that but it should work

coarse ginkgo
#

out of all configurations in paperweight, are these two the only ones I need to export?

smoky violet
#

which, you can just use the default task instead of runDevBundleServer, paper is always mojmapped now

#

you will need to make a new consumable configuration that extends from it iirc

#

failing that you could just add the setup task output directly to the consumable config sidestepping pw's config

#

we could maybe add utilities to streamline this for advanced users, but it can't be done automatically with config cache and project isolation compatibility

lucid mulch
#

it seems to work but idk if its the cleanest and if it would get accepted

#

so im asking before a pr

static urchin
#

idk why we'd want that?

lucid mulch
#

it'd be good for forks which want to use git file patches to update and they're basing off a commit where upstream has normal file patches

#

so apply/rebuild doesnt fail

static urchin
#

I cannot say I have looked a lot at your issue

#

but "ah the folder does not apply rn, lets not apply it even tho CLI asked us to apply" sounds like a less than ideal solution

lucid mulch
#

wdym?

static urchin
#

That is what your diff is doing no?

lucid mulch
#

no, if the patch is not a proper git patch it falls back to normal apply

#

using diff patch

static urchin
#

Yea

#

or if that patch does not apply rn

#

it would also fall back

lucid mulch
#

which only appears when the patch is bad

#

not when it fails

static urchin
#

Eh

#

I guess?

#

depending on stderr from git sounds even less fun xD

#

This just feels like a "we need a way for forks to rebuild their stuff as git patches while leaving upstream alone"

#

like, a configurable ext value

lucid mulch
#

yeah but that would mean bigger changes

static urchin
#

Well yea

lucid mulch
#

i wondered why does rebuild always apply upstream lol

#

for what reason

static urchin
#

I am sure we'd be happy to fix this for forks but we don't need to do this with a semi hacky fix

static urchin
#

that is just the gradle task dependency graph at work

lucid mulch
#

it just seems error prone like rn with the git file patches

#

wouldnt it be possible to cache upstream?

static urchin
#

How is it error prone, the fact that the upstream project inherits the gitFilePatches thing apparently is just a bug

#

the process itself isn't like bad

#

If I want to rebuild patches, the upstream needs to be fully applied, making sure that is the case is not error prone

lucid mulch
static urchin
#

idk? xD

lucid mulch
static urchin
#

one bug slipped -> error prone is a jump

lucid mulch
#

sorry doubt

static urchin
#

at that point all of computer science is error prone KEKW

lucid mulch
#

that would make it read the correct properties and use the upstream's versions of pw too

#

havent tested tho, might be wrong xD

static urchin
#

idk xD been a while since I dabbled in that part of PW

lucid mulch
#

i looked at it and seems that there is a problem

#

pw has diff names for apply for forks and paper kekw

#

so either depend that people dont set paper upstream name to smth arbitrary or unify the tasks? add a new one or sum

#

this makes my eyes hurt gsand

winter glacier
#

What gradle version should you use for a paper fork? 8.14 or already 9.0.0?

scarlet pond
lucid mulch
#

you need 8.14.3

#

8.8 is outdated, you were told that

lucid mulch
#

since that’s what paper is using rn

paper kestrel
#

has anyone else had an issue where intellij tries to run an all tests configurations seperately when building, in the wrong enviroment(?)

smoky violet
#

commenting the include line unter the test tasks fixes running individual tests

#

might help there too idk

peak yew
#

is this supposed to be the hash of the commit that made the patch in the -server/-api directory?

lament scarab
#

Those instructions are no longer applicable to supported versions of paper

#

oh, wait, no, I guess they are

#

the commands provided are generally fairly literal

peak yew
#

yea, i thought so too, but all the combinations i try get a "failed to lookup commit" 😅

lament scarab
#

ofc, -api no longer exists as a patched subtree anymore, only the server

#

and the server folder has different git trees inside of there, rather than just being a git tree itself

jovial stag
#

i've been trying to update a paper fork from 1.21.5 to 1.21.8 and i keep getting this error when applying the feature patches, and i'm not quite sure how to rebuild them

Patch failed at 0002 Add client-side trident API
error: invalid object 100644 3c5d84ff4b28acb0de07dec52e39f311135b9842 for 'net/minecraft/world/entity/LivingEntity.java'
error: Repository lacks necessary blobs to fall back on 3-way merge.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"


> Task :applyAllPatches FAILED
6 actionable tasks: 4 executed, 2 up-to-date
Configuration cache entry reused.
Already on 'main'
warning: You seem to have moved HEAD since the last 'am' failure.
Not rewinding to ORIG_HEAD
error: invalid object 100644 3c5d84ff4b28acb0de07dec52e39f311135b9842 for 'net/minecraft/world/entity/LivingEntity.java'
error: Repository lacks necessary blobs to fall back on 3-way merge.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
***   Please review above details and finish the apply then
***   save the changes with `./gradlew rebuildPatches`

FAILURE: Build failed with an exception.```
#

i've tried rebuilding with gitFilePatches, but it also gives an error

smoky violet
#

applyAllPatches is mainly meant as a shortcut for CI or setting up a fresh env, you really don't want to use it for normal development and especially not updating, if you read the task descriptions you would see why it will just slow you down compared to using more specific tasks

#

and not sure what you're trying to rebuild if you haven't gotten your patches applied yet..?

#

you need to resolve the problem like it says

#

sometimes you can improve the success rate of 3-way merge by adding the old src repo as a remote for the new one and or using the oldPaperCommit property

runic yacht
#

Does anyone know why this keeps happening when i run applyAllPatches?

java.nio.file.FileAlreadyExistsException: ~/taskCache/filterSlimyballspaper-asp-apiFromSparklySlimePaper/.git/hooks/applypatch-msg.sample

This is my paperweight entries inside of build.gradle.kts

paperweight {
    upstreams.register("SparklySlimePaper") {
        repo = "https://git.balls.rocks/PvPLand/SparklySlimePaper.git"
        ref = providers.gradleProperty("sspaperRef")

        patchFile {
            path = "sparklyslimepaper-server/build.gradle.kts"
            outputFile = file("slimyballspaper-server/build.gradle.kts")
            patchFile = file("slimyballspaper-server/build.gradle.kts.patch")
        }
        patchFile {
            path = "sparklyslimepaper-api/build.gradle.kts"
            outputFile = file("slimyballspaper-api/build.gradle.kts")
            patchFile = file("slimyballspaper-api/build.gradle.kts.patch")
        }
        patchRepo("paperApi") {
            upstreamPath = "paper-api"
            patchesDir = file("slimyballspaper-api/paper-patches")
            outputDir = file("paper-api")
        }
        patchDir("aspaperApi") {
            upstreamPath = "aspaper-api"
            excludes = listOf("build.gradle.kts", "build.gradle.kts.patch", "paper-patches")
            patchesDir = file("slimyballspaper-api/aspaper-patches")
            outputDir = file("aspaper-api")
        }
        patchDir("slimyballspaper-asp-api") {
            upstreamPath = "sparklyslimepaper-asp-api"
            patchesDir = file("slimyballspaper-api/aspaper-api-patches")
            outputDir = file("slimyballspaper-asp-api")
        }
    }
}
#

I probably cant get much help here since this is a fork of a fork

runic yacht
#

i deleted the git folder in the cache and ran apply all patches again and it like copied evefything from the papermc repo and overrid my build.gradle.kts file

winter glacier
cedar escarp
static urchin
#

id("io.papermc.paperweight.userdev") version "1.7.1"

#

you want version 2.0.0-beta.18

cedar escarp
#

Oh well, it also need to be upgraded 😅
Sorry, forgot about it.
Thank you very much.

iron jungle
#

I'm trying to build my Paper plugin using Paperweight, but my build fails with this error:

Execution failed for task ':paperweightUserdevSetup'.
io.papermc.paperweight.PaperweightException: Exception executing vanillaServerDownloads```
lament scarab
#

You would need to look at the full gradle output and see if there is anything useful

#

otherwise, run a build manually with the flags it advises

iron jungle
lament scarab
#

You would need to run it with the flags that it suggests to get more information

iron jungle
#

For some reason it works fine on my pc but on jitpack it isn't

lament scarab
#

I mean, it is sus that they're explictly setting some tls protocols, but, idk

#

Can't really provide support for jitpack

glass sable
#

jitpack tends to randomly break, best to not use it

#

pretty much all git code repositories provide ways of building stuff and even hosting a maven repo nowadays. One shouldn't need to have to deal with all the quirks of jitpack.

iron jungle
#

Thanks

haughty plover
#

how to patch? build.gradle.kts.patch?

#

I want to know how to create(rebuild) patch of paperfork-server/build.gradle.kts

lucid mulch
#

its the single file patching/rebuilding tasks

#

read the output of ./gradlew tasks

haughty plover
brisk belfry
#

There should be tasks called something like „rebuild…SingleFilePatches“

#

That’s what the other user told you. With ./gradlew tasks you should see those tasks

last spade
#

Hi sorry I've been out of the loop for over a year at this point and coming back to managing my own fork of Paper I see a lot of things have drastically changed in how the build system works. It seems like applyPatches is no longer what you run to setup the Workspace. Which of these tasks is the one I want? I'd like to setup the fork and compile the server jar for now

FAILURE: Build failed with an exception.

* What went wrong:
Task 'applyPatches' is ambiguous in root project 'fork' and its subprojects. Candidates are: 'applyAllPatches', 'applyOrMovePaperApiFilePatches', 'applyPaperApiFeaturePatches', 'applyPaperApiFilePatches', 'applyPaperApiFilePatchesFuzzy', 'applyPaperApiPatches', 'applyPaperFeaturePatches', 'applyPaperFilePatches', 'applyPaperPatches', 'applyPaperSingleFilePatches', 'applyPaperSingleFilePatchesFuzzy'.
#

Oh wow it seems like the rebuildPatches system is also different now

#

Gonna take a really long time to relearn everything...

lucid mulch
#

its pretty self explanatory tbh cat_what

last spade
#

Thanks!

haughty plover
#

what is better patch?

protected void idk(ServerLevel level) {
    int time = getTime();
+   if (getRider() == null) // blabla
    this.tick(level, this);
    this.update();
}

vs

protected void idk(ServerLevel level) {
    int time = getTime();
-   this.tick(level, this);
+   if (getRider() == null) this.tick(level, this); // blabla
    this.update();
}

Does the likelihood of a patch conflict increase as more “-” appear than too many "+"?
I’d like to know which approach carries less risk of upstream patch conflicts.

smoky violet
#

both will conflict when the line below changes which is what you want

#

one is more obvious what it's doing when you read it

haughty plover
smoky violet
#

you can probably find examples of both in the patches

#

whatever is in the contributing doc is the 'standard'

#

not sure if it covers this exact case

sharp trellis
#

is there a nice way to run tests in a real server environment? I just need to start the plugin, do some tests with some data (which requires nms to be present) and that's all, no event/player/whatever simulation

lucid mulch
#

if thats not what u want, there is also mockbukkit which allows writing unit tests tho im not sure how it handles nms

lament scarab
#

They don't handle NMS, hence the mocks

sharp trellis
#

mockbukkit is just paper api "standalone" implementation

lament scarab
#

There isn't really a "nice" way to do it

sharp trellis
#

I mostly care about the latest, but it's actually a library, so supporting more versions would be nice

lucid mulch
#

there should be, tho i think it’d have to be applied on modules then with each module having a different mc version specified for the run task

novel knoll
#

i mean, you can just have separate run tasks for different versions in the same module, no?

sharp trellis
#

that might be possible, I would need to create them manually tho

novel knoll
#

it's a task after all

sharp trellis
#

I might try that actually

#

yeah I was able to do that. thanks

lucid mulch
#

why do codebook param renames result in the param names becoming harder to read

#

here is an example

#
-        if (Math.abs(source_move) < ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.COLLISION_EPSILON) {
+        if (Math.abs(desiredOffset) < ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.COLLISION_EPSILON) {
#

or this

#
-    protected SetWritableBookPagesFunction(List<LootItemCondition> predicates, List<Filterable<String>> pages, ListOperation pageOperation) {
-        super(predicates);
+    protected SetWritableBookPagesFunction(List<LootItemCondition> conditions, List<Filterable<String>> pages, ListOperation pageOperation) {
+        super(conditions);

i feel like conditions is better suited here ig than predicates

#

this is diff after applying parchment again (the same build as in mache) ontop of the src/minecraft/java

#

there is a lot more and prob even more mention worthy examples

#

there’s also shifts such as owner becoming owner1

sharp trellis
#

I would like gh actions to report any failed tests to me

raven barn
#

anyone know what gradle is confused about here?

lament scarab
#

I mean, what version of adventure is that branch of paper using?

#

It's clearly upset about something to do with the versioning there

raven barn
#

i saw that lynx... 😄

#

so i cant do anything then alright

lament scarab
#

I mean, either you override the dependency resolution or you meet it

raven barn
#

too much work
i will wait patiently

smoky violet
#

you can look at adventure-platform-mod

#
fun Project.configureUnstableAdventureStrategy() {
  configurations.configureEach {
    resolutionStrategy.capabilitiesResolution.all {
      if (candidates.size == 2) {
        // Select unstable Paper variant over stable Kyori variant
        val unstable = candidates.find { c -> c.id.displayName.startsWith("io.papermc") }
        val stable = candidates.find { c -> c.id.displayName.startsWith("net.kyori") }
        if (unstable != null && stable != null) {
          select(unstable)
        }
      }
    }
  }
}
#

the problem is you are bringing in stable adventure somewhere and it conflicts with paper's unstable deps

raven barn
#

yeah i have a few deps that depend on various adventure libs

smoky violet
#

like how in mod it depends on stable adventure-platform but unstable -api

#

you need to tell gradle how to resolve the conflict like the docs explain

raven barn
#

gonna give that a try
thanks

harsh ore
#

Heya I am jusing jpenilla's gremlin for my dependency management and for some reason when I try adding kotlin-reflect it downloads it properly but kotlin still says its not available in the classpath. Does anyone know why?

smoky violet
#

are you relocating it

#

@harsh ore

harsh ore
smoky violet
tame rock
#

Where can I find dev-bundles for older versions

#

I am looking for 1.16.5

smoky violet
#

you're looking for something that doesn't exist

tame rock
#

unfortunate

lucid mulch
#

well that sure is interesting

#

github actions, why

vital cove
#

Not sure if this is something that can be asked here, but anyone get this error specifically when trying to apply patches from a fork-of-a-fork? (in windows, in linux works fine)
Doesn't happen when applying patches from paper or a fork of paper
io.papermc.paperweight.PaperweightException: Command finished with 128 exit code: git -c commit.gpgsign=false -c core.safecrlf=false reset --hard base

#

Windows long paths are enabled, and I signed in into github from both cli and desktop app

lucid mulch
#

are they enabled in git?

#

run git config --global core.longpaths true

vital cove
#

lemme try

fading vapor
vital cove
lucid mulch
#

only the git config is needed

tame rock
lucid mulch
#

🐟 🐟

vital cove
harsh ore
# smoky violet well if the dependency is being correctly passed to the classpath builder and yo...

Sorry for the late response, maybe you can help me out:
my build gradle: https://pastes.dev/7jxYYHepg6
my version catalog: https://pastes.dev/sgXeLYNiA9
my plugin loader: https://pastes.dev/7EhFQWhOsx

when running the server it also downloads: kotlin-reflect and puts it into G:\» Servers\» 1.21.8\libraries\org\jetbrains\kotlin\kotlin-reflect\2.2.20
so maybe gremlin does its job properly but its just the kotlin library not being properly added to the classpath or something idk

#

its the only library causing issues

smoky violet
#

you could copy the paper appender and add logging

#

also check for any non jars files in the result

#

beyond that it will likely be something with plugin class loader semantics

harsh ore
harsh ore
#

so what are my options? I am assuming one of them is to just use the normal gradle implementation and just bundle kotlin-reflect with my jar

smoky violet
#

what kind of errors are you getting for what code

harsh ore
#

lemme get the code one sec

smoky violet
#

it could just be the classic library loader cannot see plugin loader (only the other way around)

harsh ore
#

and this is the code:

for (clazz in classes) {
    val constructor = clazz.constructors.firstOrNull { it.parameters.size == 1 && it.parameters[0].type == LMS::class.java }
    val eventInstance = constructor?.call(instance) ?: clazz.constructors.first().call()
    Bukkit.getPluginManager().registerEvents(eventInstance as Listener, instance)
}```
the stacktrace is pointing to the constructor val
smoky violet
#

you can try setting the context classloader to the plugin class loader

#

if that doesn't work and you really want to avoid shading then you can jar-in-jar most of your plugin code except for a bootstrap to get everything on the library CL

#

or maybe you need to try the other way around (set ctx loader to the lib loader)

#

worth experimenting with

harsh ore
#

oh no I don't mind shading it, just wanted to ask around to see if there is a different way to do it for consistency sake

harsh ore
smoky violet
#

yeah

harsh ore
#

yea that didn't work

harsh ore
smoky violet
#

or SomeKotlinReflectClass::...classLoader

#

or any class from a downloaded lib should work

#

(as in work to get the library classloader)

harsh ore
#

so I tried: Thread.currentThread().contextClassLoader = KClass::class.java.classLoader
KClass is part of Kotlin Reflect and it still gave me the error but on the same code line (the constructor one)

lament scarab
#

KClass is part of the kotlin stdlib

smoky violet
#

there's probably a way to get it working but personally I would just shade kotlin stdlib and reflect

harsh ore
#

oh wait

smoky violet
#

it's in the stdlib but it doesn't really matter for the purpose of retrieving the lib loader

#

any class added via the loader will do

harsh ore
#

Okay that's interessting now:
I tried using a class thats not in the stdlib but in kotlin reflect and Intellij is saying this:

#

however I can see kotlin.reflect in my external libraries

lament scarab
#

I think that they're pulling some stuff off where they basically expect that everything is inside of one classloader

#

Or, i have no idea where their logic is to determine what variant of something loads

#

KClass is an stdlib class, but it's basically just an interface, I'd wonder if their compiler is pulling off some BS

harsh ore
#

oh well, I just shaded reflect - would've been interesting to figure out why kotlin is behaving like it does but don't wanna waste your guys's time

#

cause it just feels like it should work just fine since the library is on the classpath

lament scarab
#

I mean, your thing is loading the stdlib implementation of that class which is basically a dummy impl that blows up whenever you try to do anything that relies on kotlin-reflect to exist

harsh ore
#

yep but for some reason it things it doesn't exist

lament scarab
#

impl stuff isn't in the classpath so the compiler just uses the "oh noes" impl from the stdlib

harsh ore
#

I tried pressing the add library button, it did something and the button disappeared however it still gave me the unresolved reference

lament scarab
#

That would just modify the IDEs config, it wouldn't appease the gradle side of stuff and would be lost as soon as it resync'd

harsh ore
#

switching from runtimeDownload to implementation fixed the error but I still can't access kotlin reflect classes in my code. Maybe I am not meant to?

lament scarab
#

No idea how that works

smoky violet
#

all runtimeDownload does by default is add it to the dependency txt

#

unless you changed that, you still want to add it to compileOnly or implementation depending on your setup

harsh ore
proper grove
proper grove
#

thanks

broken wolf
#

Does the https://fill.papermc.io/v3/projects/paper/ rate limit?

smoky violet
broken wolf
#

ok so only without user agents, its rate limited, cool.
Had to come up with something janky to allow pres

lucid mulch
#

it looks like gradle 9.1.0 once again messed up with the generate mappings task

#

which randomly fails now

#

why is that so picky when it comes to java ver and gradle lmfao

upper zephyr
main mica
#

this isn't really "help with building random projects that aren't yours", but it seems like something is corrupting the files in your local repository. Might be some Windows/Defender issue, might be something with the downloading

upper zephyr
lucid mulch
#

both gradle 9.0.0 and 9.1.0 have this error

#
Caused by: java.lang.NullPointerException: CSRG must not be null
        at io.papermc.paperweight.util.MappingFormats.<clinit>(MappingFormats.kt:35)
#

cleaning the cache and fresh clones of my fork dont fix it too

#

this line seems to point here in paperweight

object MappingFormats {

    val TINY = TinyMappingFormat.STANDARD
    val CSRG: MappingFormat = Formats.CSRG // <- error here!
    val PROGUARD: MappingFormat = Formats.byId("proguard")
}
limpid belfry
#

<@&748618676189528155>

distant mango
#

<@&748618676189528155>

#

lol

limpid belfry
#

lmao

shrewd crestBOT
distant mango
#

Is there a way to override the paper repo in paperweight-userdev?

#

nvm I think i see

#

Maybe not? I have injectPaperRepository set to false but it's still looking in the paper repo, though that could be my build logic cache shit thing

smoky violet
#

read the doc on that method, it's very specific

#

the dev bundle itself declares repositories it needs

#

just use a lifecycle hook to swap out the urls

distant mango
#

Uhh how would I do that?

gilded turtle
#

it’s back now anyways

proper grove
#

im updating my fork of a fork of paper from 1.21.7 to 1.21.8, but while applying the patches it spit out a build.gradle.kts.ref, how do i fix the patch file?

lament scarab
#

look at the reject file and manually re-apply whatever tweaks are relevant and rebuild the patch

proper grove
#

how do i manually re-apply tweaks?

lament scarab
#

by hand

proper grove
#

im confused

lament scarab
#

hunks of the patch failed

#

either you fight a tool like wiggle or you do it by hand

open latch
#

not sure if this warning is my build or what because i use paperweight.paperDevBundle and not call the implementation for paper

dusk quail
#

afaik thats talking about smth like
conf("group", "artifact", "version")

smoky violet
lucid mulch
#

sorry for the ping but i saw you're doing work on pw rn

#

so i thought i'd bring this up while you're at it

#

tl;dr the shadow bump broke reobf mappings

#

generation

smoky violet
#

open an issue with all of the details please

#

there are other things blocking updating pw in Paper, so I haven't been testing it yet

lucid mulch
#

also i've opened a pr some time ago to fix the full vanilla test in paperweight as it right now doesn't do what it should

#

the test patches never got applied

#

as they weren't configured properly

#

so while the test succeded it didnt provide any meaningful input and wasnt reliable

#

i discovered that by accident lmfao cause changing things in those patches didnt conflict at all and changing/removing ATs and upon closer inspection in the dir where the tests ran, those changes from the patches weren't in the patched source

#

oh and also the output from the tests said 0 patches applied

smoky violet
#

@bronze ember should review that, he wrote the test

bronze ember
#

Can somebody remind me next week? Then I'll be back at a PC

#

Or maybe ping me in the comments and hope that I somehow wade thru my GitHub notifications

limpid heart
#

context would be nice

#

what are you building? what's your build script?

sick bough
#

um, can anyone remind me the process of updating the server jar (fork)? I updated the commit hash, which gradle tasks should I run now?

#

1.21.4 -> 1.21.8

lucid mulch
#

so im not sure about opening an issue on their github
-# especially since im not quite well-versed with it

lucid mulch
lucid mulch
#

otherwise you have to manually migrate your patches to the correct patch sets

#

it seems that someone reported it and that there is a fix

#
duplicatesStrategy = DuplicatesStrategy.INCLUDE
must be set for
mergeServicesFiles()
to work properly. Once this is set, it worked properly.
#

yeah seems like that fixed it, i can open a pr to close that issue

last spade
#

Post hard fork what's the general structure for Paper forks? I see src/minecraft/java containing the net.minecraft package as expected, but curiously it also contains non net.minecraft classes (Like spottedleaf's code and io.papermc.paper packages). It's puzzling to me why those classes are in src/minecraft/java instead of src/main/java in paper-server, more confusing is that all non net.minecraft classes from Paper, CraftBukkit, Spigot etc are split between src/minecraft/java and paper-server's src/main/java

static urchin
#

have a look at paperweight-examples

#

generally, <fork>-server/src/mojang/java is gonna maintain mojangs code, <fork>-server/src/main/java is going to maintain classes created in your fork and paper-server/src/main/java is going to maintain classes we add

last spade
#

Ah I see, I was just about to ask to see whether my understanding of the directory structure was correct

static urchin
#

The split into two patch sets for nms and paper classes was made as paper classes no longer need full nms code to apply / rebuild etc

static urchin
#

like, given our classes are in tree now post hardfork, you can patch them without nms decompilation

lucid mulch
last spade
#

Hmm, let me see if I got this right

last spade
#

At least that's what I'm getting from this

static urchin
#

Yea

last spade
#

I see, things are a little clearer now

static urchin
#

The patched classes mostly come from moonrise

#

given that is just trying to be its own complete patch

open latch
lucid mulch
#

what dep branch?

#

the renovate pr one?

#

i dont think it should

open latch
lucid mulch
#

that update isnt pulled in tho and that pr is an automated one

#

this just supercedes that update as its broken

open latch
sick bough
lucid mulch
#

yes

sick bough
lucid mulch
#

update your gradle

#

you need atleast 8.14

sick bough
#

I may be very bad at reading these errors but in no way I could tell by this error message that gradle needs to be updated lol

lucid mulch
#

yeah its really verbose but when you look at them a couple of times you can quickly identify whats wrong lol

#

Incompatible because this component declares a component, as well as attribute 'org.gradle.plugin.api-version' with value '8.14' and the consumer needed a component, as well as attribute 'org.gradle.plugin.api-version' with value '8.12'

sick bough
#

I suppose it's this part, right nvm, yes

median pulsar
#
* What went wrong:
Execution failed for task ':scoreboard-library-modern:reobfJar'.
> Failed to calculate the value of task ':scoreboard-library-modern:reobfJar' property 'mappingsFile'.
   > The current dev bundle does not provide reobf mappings.

the mappings will be provided after spigotmc releases 1.21.9 right?

lucid mulch
#

sooner or later they will

#

spigot has alr updated too btw

sick bough
lucid mulch
#

yeah or you can try fuzzy apply

nova shuttle
#

i am merging folia and stuck in this stage i dont know what to do

bronze ember
#

Bro is stuck in vi

#

Just exit it ^^

lament scarab
#

You don't touch the patch files manually, you generally just work through them and apply whatever rejects exist or whatever depending on the stage it got stuck

nova shuttle
#

But when I asked ChatGPT, it said I have to press the blue button labeled 'Commit Merge'

rapid fractal
#

First of all

#

Don’t ask ChatGPT

nova shuttle
#

ok

rapid fractal
#

They are not reliable source of ANYTHING

nova shuttle
#

so i just need to close it?

lucid mulch
#

to commit merge

#

and git add (. or files) before that

nova shuttle
nova shuttle
lament scarab
#

I mean, you have a merge conflict you probably want to figure out how to resolve

#

outside of that, we can't really teach git here

nova shuttle
nova shuttle
#

Can someone pls say it i am stuck there for a long time 😢

lament scarab
#

We can't tell what your issue is

#

either you're stuck with a really basic "how to use git" issue and are stuck inside of a text editor, or you have some deeper issue

#

if you're litearlly stuck at that screen still, read up on how to use vim

#

you can switch the editor to something else if you want

coarse ginkgo
#

Updating my fork to 1.21.9 and stuck on dev imports for libs

io.papermc.paperweight.PaperweightException: Failed to read library line 'adventure-api net.kyori.adventure.translation.GlobalTranslatorImpl', no library file was found.

build-data/dev-imports.txt:

# You can use this file to import files from minecraft libraries into the project
# format:
#     <artifactId> <fileName>
# both fully qualified and a file based syntax are accepted for <fileName>:
#     authlib com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
#     datafixerupper com.mojang.datafixers.DataFixerBuilder
#     datafixerupper com/mojang/datafixers/util/Either.java
bungeecord-chat net/md_5/bungee/chat/TranslationRegistry.java
adventure-api net.kyori.adventure.translation.GlobalTranslatorImpl

Also tried importing it by file path (similar to bungeecord-chat import), but no luck. Am I missing something? This worked on 1.21.8 with paperweight 2.0.0-beta.18

sick bough
sick bough
#

if anyone who knows what they are doing wants to help me fix some issues with the fork - dm or @ me, willing to pay, thanks.

nova shuttle
#

I correctly merged the Folia repository into my branch. After that, I built the .jar file using the Gradle command: ./gradlew build -x test. I then placed the resulting .jar into my server folder. However, when I try to start the server, I get the following error: no main manifest attribute, in server.jar.

#

someone?

lament scarab
#

you need a bundler jar

ornate kettle
#

do i have to update paperweight if i update from 1.21.7 to 1.21.9?

static urchin
#

does not hurt

#

required for gradle 9 iirc

ornate kettle
#

I would like to use the gradle catalog but the catalog seems not to work with plugins when you publish it to a remote repository

#

So I considered to ignore a paperweight update. But gradle 9 would be kinda pretty

gritty robin
#

problem with 1.21.9

lament scarab
#

We released 1.21.9 before spigot, so we didn't have mappings on release

#

they'll be added at some point

gritty robin
#

wow paper so fast

gritty robin
lament scarab
#

To our build config, and then we have to validate a bunch of stuff

#

noting that we consider the obfuscation stuff to be deprecated behavior and it's not going to be around too long, you should consider looking into supporting mojmap'd environments

gritty robin
novel knoll
#

you are going to have to make a decision about it eventually by the time the mechanism is dropped

nova shuttle
#

how to fix this

distant mango
#

you need to use the right jar

#

can’t remember which one it is though

#

may be in the root directory (or root’s build/libs)

nova shuttle
#

i used the correct one from builds/libs

distant mango
#

server/build/libs?

nova shuttle
#

yes

nova shuttle
distant mango
#

what was the jar name

#

and what task did you use

lament scarab
#

Not the -server jar, you need the bundler/paperclip jar, as already said

#

This will be in the root projects build folder

nova shuttle
#

Can someone say how to use papper clip.

novel knoll
#

as you were told in #folia-dev, you need to run the create paperclip jar task

brave folio
#

How to used paperweight for get fork paper?

#

🤣

fading vapor
lucid mulch
brave folio
brave folio
lament scarab
#

Well, you probably want to customise some aspects of the configuration there

#

part of the expectation is that with your knowledge it is mostly self documenting at this point

brave folio
#

I can change fork-api,fork-server ?

lucid mulch
#

yes

serene python
#

I'm getting this same error as shown here by another person, any idea why its happening or how to properly fix it?

#

I'm fixing it the way they did (by adding it to my dependencies) but if there is a better way Id like to switch to it

echo kilnBOT
brave folio
#

1.21.9 still unstable for fork?

exotic ridge
novel knoll
#

have you tried syncing gradle to your IDE?

exotic ridge
#

It works fine when I open in it something like vscode

#

and compiles too

brisk belfry
#

Unlink and link again?

exotic ridge
#

wdym by that

brisk belfry
#

Click the gradle module to unlink (not the root project) on the right window and select unlink then right click the build.gradle in the paper module to link the project again

exotic ridge
#

reinstalling intellij worked

#

it was a very old version

brisk belfry
#

Maybe just updating it would also helped then.

woven light
#

java is temurin 21.0.7

brave folio
#

I got javadoc error too🤣🤣 but
Error fetching URL javadocs 26.0.2

#

How to disable javadocs in javadoc ?

bronze ember
#

Comment it out

stable aspen
#

Configuring project ':generator' without an existing directory is not allowed. The configured projectDirectory 'C:\Users\1111\Desktop\Development\Development\RPGItems-reloaded\generator' does not exist, can't be written to or is not a directory.

  • Try:

Make sure the project directory exists and is writable.
Run with --scan to generate a Build Scan (Powered by Develocity).

#

what is even generator

#

Unable to resolve a dev bundle, which is required for paperweight to function.
Add a dev bundle to the 'paperweightDevelopmentBundle' configuration (the dependencies.paperweight extension can help with this), and ensure there is a repository to resolve it from (the Paper repository is used by default).
https://pastes.dev/kP5dDTLkZN

#

wtf is this

stable aspen
#

that's not related though

#

now it's 1.21.9

final jewel
#

you're also using the old shadow plugin, but that shouldn't cause paperweight to break

stable aspen
#

resolved, there are something I need to modify with gradle 9

final jewel
#

well now that you solved your issue, if you don't mind me nitpicking, here's a few things I noticed:

  1. You have two shadowJar tasks in there
  2. for the javadoc and source jar, you can do it on the java extension instead with withSourcesJar() and withJavadocJar
  3. You should use the release option + a toolchain instead of the old source and target compat variables, like so:
java {
  toolchain {
        languageVersion = JavaLanguageVersion.of(21)
  }
  withSourcesJar()
  withJavadocJar()
}

tasks.withType(JavaCompile) {
  options.encoding = "UTF-8"
  options.release = 21
}
stable aspen
#

those are very old configs from like years ago

final jewel
#

figured as much given it is using groovy dsl lol

stable aspen
#

but thanks I'll update them

#

2021 exactly

gusty field
#
A problem occurred configuring root project 'Frame'.
> Could not resolve all artifacts for configuration 'classpath'.
   > Could not resolve io.papermc.paperweight:paperweight-userdev:2.0.0-beta.19.
     Required by:
         root project : > io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:2.0.0-beta.19
      > No matching variant of io.papermc.paperweight:paperweight-userdev:2.0.0-beta.19 was found. The consumer was configured to find a library for use during runtime, compatible with Java 21, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.13' but:
          - Variant 'javadocElements' declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about its target Java version (required compatibility with Java 21)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.13')

any idea? tryna use paperweight for nms

echo kilnBOT
final jewel
#

most likely just outdated gradle

bronze ember
#

which is why that is the first point 😄

#

but they did cut off the log

gusty field
#

o yea

#

i was running 8.13

#

does it always have to be latest?

final jewel
#

not necessarily, but using latest allows to rule out some version incompatibility

#

latest version is 9.1.0 btw, you can change it in the gradle/wrapper/gradle-wrapper.properties file by changing the version in the url

#

or just ./gradlew wrapper --gradle-version=9.1.0

turbid moon
#

Or even simpler, what I tend to do gradle wrapper --gradle-version=latest so that you never have to keep track of the latest Gradle version

bronze ember
#

Paperweight has a min Gradle version requirement

#

It's at least 9 rn I think

#

If you didn't cut of the log it would have said so

glacial lintel
#

not sure if this is the right place to ask questions like this, but: im trying to make a few modifications to folia. My Goal is to modify a few classes within io.papermc.paper.threadedregions.
I have

  1. cloned the repo
  2. ran the applyAllPatches task
    However, now, my IDE marks all files within the folia-server directory as 'red' (however, those in paper-server are not red and appear to be part of the git repo as intended), as in not part of the git repo. when I make modifications to files and use intellij's "commit" feature, the modifications do not show up. I have made modifications to folia in the past, and if I take a look at the intellij project, the folia-server folder is not marked as red by my ide
lucid mulch
#

thats because there are no classes under folia-server

#

all folia classes are under the minecraft source

#

is this a fork or folia itself?

glacial lintel
glacial lintel
lucid mulch
#

and in which directory were you trying to commit?

glacial lintel
#

I made a change to src/minecraft/java/io/papermc/paper/threadedregions/RegionizedData.java

lucid mulch
#

ik but it sounds like you committed under the wrong directory if the changes dont get rebuilt

#

the proper git repo for committing would be the java folder

#

under minecraft

glacial lintel
lucid mulch
#

i understood it as if your changes aren’t showing up from the original message

#

as for the red files it seems that it somehow got imported wrongly or just some error

glacial lintel
glacial lintel
glacial lintel
#

any idea what this is caused by / how I could get rid off it? Making my changes and compiling works, however I do need patch files for them

lucid mulch
#

you could manually commit them in the java dir if the ide doesnt work properly

#

and then rebuild

lucid mulch
glacial lintel
#

so opening the server directory as its own project basically?

lucid mulch
#

thats how it should be done iirc

lucid mulch
#

if that fails then just the java folder

glacial lintel
#

okay

#

ill try that

glacial lintel
winter glacier
#

what gradle tasks do I need to run after updating the paperRef and mcVersion in my paper fork so it is actually updated to the new version?

lucid mulch
#

just applyAllPatches

echo trout
#

What is api.papermc.io/v2 actually using for downloads? Asking bc I want to create universal scripts for downloading the builds of like similar projects to paper. GeyserMC's download api is build the same

brave widgetBOT
bronze ember
brisk belfry
#

I hope you aren’t using the open source licenses for this project 😆

viscid pulsar
#

Hi, I'm getting an error :

.\gradlew --refresh-dependencies

[Incubating] Problems report is available at: file:///C:/Users/anton/Documents/_Walyverse/Walyverse/Plugins/WalyverseOneblockModule/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':NMS:v1_21_5'.

Failed to create service 'paperweight-userdev:setupService:67b115ed742da2541c3b41cbbd9950e53aafe8c7a73fd1ba97eb107ffe27d5ec'.
Could not create an instance of type io.papermc.paperweight.userdev.internal.setup.UserdevSetup.
The paperweight development bundle you are attempting to use is of data version '7', but the currently running version of paperweight only supports data versions '[2, 3, 4, 5, 6]'.

  • Try:

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

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

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

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

BUILD FAILED in 18s
build.gradle

plugins {
    id("io.papermc.paperweight.userdev") version "2.0.0-beta.11"
}

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

group 'NMS:v1_21_5'

dependencies {
    paperweight.paperDevBundle("1.21.5-R0.1-SNAPSHOT")
    compileOnly rootProject
}

shadowJar {
    archiveFileName = "${project.name}-exclude.jar"
}

assemble {
    dependsOn(reobfJar)
}

tasks {
    reobfJar {
        File outputFile = new File(rootProject.archiveFolder, "reobf/${project.name}.jar")
        outputJar.set(layout.buildDirectory.file(outputFile.getPath()))
    }
}

if (project.hasProperty('nms.compile_v1_21') && !Boolean.valueOf(project.findProperty("nms.compile_v1_21").toString())) {
    project.tasks.all { task -> task.enabled = false }
}
#

My project is composed of NMS folder containing all files, and inside each, build.gradle with paperweight version. I'll show you

final jewel
#

try updating the paperweight version and see if that fixes the issue

viscid pulsar
final jewel
#

latest version is 2.0.0-beta.19

viscid pulsar
#

Should I update all build.gradle that contains beta.11 ? Or just the version 1.21.5?

final jewel
#

let's try just updating the 1.21.5 module first

#

though, you should probably put it in the root project's build.gradle instead of each module having an independent paperweight version

viscid pulsar
#

Some versions do not use paperweight

final jewel
#

you can make it so the plugin is applied to a specific set of modules

viscid pulsar
#

I'm new to gradle. I'll make a quick video to show you

final jewel
#

though, it doesn't matter that much. Don't wanna rework your thing if it is working

viscid pulsar
#

Interesting but didn't help me to fix the problem

#

Fixed the bug!

winter glacier
# lucid mulch just applyAllPatches

I have some merging errors now because of a patch I added. How do I update the patch or what exactly do I need to do in order to solve the conflicts the right way?

#

Do I just need to rebuild the patch?

static urchin
#

you fix merge conflicts, apply the patch and rebuild yea

#

patches after that however are a bit of a headache as rebuilding would remove them

winter glacier
static urchin
#

you can directly update

winter glacier
#

Is the updatingMinecraft=true attribute in gradle.properties necessary while updating?

static urchin
#

uh

#

dont know if that even does anything anymore

#

since we have the ext now

lucid mulch
#

i think that it never did anything on forks anyway only on paper

lucid mulch
#

it was used here

#

for the tasks which have since been moved away from there

#

since april 14 to be exact

tawny lintel
#
repositories {
    maven {
        name = "papermc"
        url = uri("https://repo.papermc.io/repository/maven-public/")
    }
}
dependencies {
    compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
}

Why can't this gradle be imported? The error only prompts my module name.

final jewel
#

I just tested it and it works fine so there must be something messed up with your setup

#

@tawny lintel let's continue here

#

as for why, I have no idea

tawny lintel
#

What is the gradle version?

proud maple
#

make sure to specify a java version

tawny lintel
#

Other projects can be imported normally, and there is no other information, just a module name.

tawny lintel
# proud maple make sure to specify a java version
repositories {
    maven ("https://repo.papermc.io/repository/maven-public/")
}

dependencies {
    compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
}

java {
    toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
lucid mulch
#

maven("https://repo.papermc.io/repository/maven-public/")

#

no space here

tawny lintel
#

That does not affect the format, it is just the format display, in fact it is the same as not writing spaces

lucid mulch
#

the snippet you sent works perfectly fine for me having the java plugin applied

tawny lintel
#

Yes, so it's very strange. It's the same content, but it works fine when I change the project.

#

The key is that this is all his information

#
:project:common-impl-nms21p:main: Could not resolve io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT.
Required by:
    project :project:common-impl-nms21p

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

try running ./gradlew wrapper --gradle-version latest twice

tawny lintel
#

Yes

lucid mulch
#

nvm that

#

message

lucid mulch
#

could you give all of the build files since it seems like a multi-module project

tawny lintel
lucid mulch
#

you could set the compatibilities per module

#

because paper 1.21 needs java 21

#

and 1.19 needs java 17 etc

tawny lintel
#

Oh? You mean the project's Java version definition affects the module's?

lucid mulch
#

from what i recall yes

tawny lintel
#

Yes, because JavaPluginConvention is set to jdk8, it is normal now.

winter glacier
carmine ocean
#

Where can I find the version specific ids?

winter glacier
cinder ember
#

hey guys im having a 0 braincell moment with a gradle build.kts file rn.
this is the code i copied from the paper wiki:

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

dependencies {
    compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
}

java {
    toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}```
and im getting a ton of errors:
Unresolved reference: compileOnly
Expression 'java' cannot be invoked as a function. The function 'invoke()' is not found
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
public val PluginDependenciesSpec.java: PluginDependencySpec defined in org.gradle.kotlin.dsl
Unresolved reference: toolchain
lament scarab
#

Those are provided by the gradle java libraries plugin or something

#

(may also need the java plugin too)

tough pilot
#

make sure you have: build.gradle.kts

plugins {
    id("java")
}

at the top (it can be anywhere, but usually at the top)

cinder ember
#

dang sorry i guess i was just confused cause the tutorial doesnt have that in the build script

lament scarab
#

that stuff is generally inside of the standard java gradle template

cinder ember
#

my bad

#

thanks guys

#

i was reading up on kotlin on w3schools and the syntax seemed a bit different from the build.gradle.kts file. are they the same language?

lament scarab
#

Yes

cinder ember
#

maybe i need to find a build specific kotlin tutorial

lament scarab
#

Well, they're using a bunch of gradle magic features in order to make it more clear what's going on

#

or, well ,clear from the reading part, not always the writing part

cinder ember
#

oh i see. whats the term for the named curly brace sections in kotlin? they look like functions, blocks, or namespaces but idk what they are called in this context.

#

like dependencies {}

lament scarab
#

iirc it's basically a shortcut for apply()

turbid moon
#

That's basically just lambda statements

lament scarab
#

I was gonna say lambda but I know kotlin loves to give stuff fancy names just to make reading the documentation more fun

cinder ember
turbid moon
#

Writing

dependencies {
  compileOnly(...)
}

Is the same as writing in Java

dependencies(this -> {
  this.compileOnly(...);
});

They are also basically extension functions

#

Kotlin DSL is nothing more than just smartly chosen extension functions which you provide as a lambda statement

#

Just Kotlin trickery

cinder ember
#

just took a screenshot of this so i can revise this in the morning when im properly awake xD

lament scarab
#

not sure if higher order function or aneurism

turbid moon
#

But here the interesting part is that you do not have a parameter, but this is the same as whatever type is inside that dependencies block normally

cinder ember
#

i actually dont think ive ever seen that java syntax. i think im missing some knowledge in that area

#

ive seen the arrows like () -> {

lament scarab
#

same thing

turbid moon
#

They call it type-safe builders, which is really boring imo, but it is what it is

cinder ember
#

thanks ill have a read tomorrow

#

oh wow thats similar to html but just a different way of writing it

#

its like html x xml

turbid moon
#

(html and xml are not much different)

#

You probably confused something there kekw

cinder ember
#

yeah true they are very similar

turbid moon
#

But yeah, you get it. It's Kotlin's code diabetes (too much sugar) for writing builder patterns

cinder ember
#

its so complex 😭

novel knoll
#

i think you're worrying about things you don't need to just yet

#

unless you plan on writing more complex build scripts than a basic java plugin + paper api dependency, there's no need to understand the ins and outs of kotlin for it

lean palm
final jewel
#

chances are it is either outdated jdk or IDE

lean palm
lament scarab
#

run a build and see what it says

#

the fact that it can find the package but not the class suggests you're using the wrong java version for the project or the IDEs caches are borked

#

if it builds fine, go to what I think was the file menu and hit invalidate caches or might be fix IDE now

final jewel
lean palm
lament scarab
#

I mean, you don't need the first one, but, basically, yes

lean palm
final jewel
#

Ctrl + Ctrl then gradle build

#

even if it errors

lean palm
#

funny thing that after invalidating cache paper has worked but for example jda didnt lol

#

problems of big project...

#

the fact that JDA works on our discord api but it doesnt in discord bot is funny

carmine ocean
#

Some dude apparently dragged his balls through the dependencies while trying to set up his environment it's the weirdest setup I've ever seen

winter glacier
#

You have to give us more context

carmine ocean
#

I will send the configurations in a few hours

cinder ember
#

i appreciate it

cinder ember
#

hey gang using the gradleup shadow plugin how do you choose which dependencies are shaded into the jar

fading vapor
cinder ember
#

bet

#

thanks dude

final jewel
zenith ridge
#

I recently created a fork of Folia based on the paperweight-example and was looking at forks on GitHub like Luminol. It was actually pretty easy. The part I can't figure out is how to create the patches. If the .gitignore is ignoring paper-api, paper-server, folia-api and folia-server, I can't create them using the standard git format-patch. What's the best way to do this?

lucid mulch
#

take a look at ./gradlew tasks output

tepid path
#

Hi! I'm getting this error when I try to sync my project with run-paper:

Cannot set the value of property 'downloadsApiService' of type xyz.jpenilla.runtask.service.DownloadsAPIService using a provider of type xyz.jpenilla.runtask.service.DownloadsAPIServiceImpl.

The error disappears if I use the plugin in a single module, cus rn I have it on two modules

https://pastes.dev/ZL5oPkMejd
https://pastes.dev/CoWDcN7Dmk

lament scarab
#

Yes, that is a known limitation, you need to add PW to the parent module with apply false

tepid path
#

pw?

lament scarab
#

paperweight

#

Oh, derp

#

I'd guess the same applies, gradle limitation means that you can't really add that stuff to multiple modules, add it ot the parent project and define the tasks there

#

the paperweight test plugin project on github unironically has an example of this

tepid path
#

ok, ty 😄

#

yeah it worked thanks 🙂

latent wolf
#

I'm experiencing some issues with disabling spigot:
Unexpected added class from Spigot: cds$a - net/minecraft/world/entity/Display$BillboardConstraints

latent wolf
#

-# for snapshot 25w41a

final jewel
latent wolf
gloomy night
#

Is it possible for paper forks to update to snapshot versions?

lucid mulch
#

yes if you also update paper itself and make that updated repo your upstream

gloomy night
#

that's smart wow thank you xd

torn sonnet
#
   > Could not find spark-paper-1.10.84-20240720.204128-1.jar (me.lucko:spark-paper:1.10.84-SNAPSHOT:20240720.204128-1).
     Searched in the following locations:
         https://repo.papermc.io/repository/maven-public/me/lucko/spark-paper/1.10.84-SNAPSHOT/spark-paper-1.10.84-20240720.204128-1.jar

Trying to build with (yeah, I know) 1.21

proud maple
#

that artifact used to be published to central snapshots but a while ago they lowered the amount of time snapshots are kept for iirc

smoky violet
#

I've been wanting that dep to not be a snapshot for a while

#

it finally is

proud maple
#

is the api depending on it or just the dev bundle

smoky violet
#

1.21(.0) is not a version worth fixing though

#

dev bundle

#

you can just exclude it, runDevBundleServer will break but everything else should be fine

misty current
#

Im building someone elses plugin that doesnt have an api package published but does have the api source set, and i get this error in the jitpack log

Failed to execute goal on project MC_1_21_8: Could not resolve dependencies for project su.nightexpress.dungeonarena:MC_1_21_8:jar:8.3.0: Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.21.8-R0.1-SNAPSHOT in papermc (https://repo.papermc.io/repository/maven-public/) -> [Help 1]
#

Is this a configuration error or something else?

sharp trellis
#

you would need to run spigot's build tools first to get the spigot jar

misty current
#

This is on jitpack, is that possible?

sharp trellis
#

no

misty current
#

wonderful

#

i assumed that if I just used org.spigotmc:spigot-api:1.21.8-R0.1-SNAPSHOT it would work or still no

#

because that package is actually on the papermc repo? idk how spigot builds work

sharp trellis
#

you could use userdev I suppose, but idk if it would since hard fork

misty current
#

at that point i would have to convert the build system of the project, very sad

bronze ember
#

we dont have the capacity to provide support for two different build systems

lucid mulch
lucid mulch
#

the generated gradle files should be good to go out of the box but may require minor changes to work properly in some cases

#

or you can just clone the example paper plugin and make probably minor adjustments to make it match the maven build

#

(btw theres also a paperweight userdev maven plugin that works but its unofficial so you wont get support here)

misty current
bronze ember
#

Way easier to work with from the dev side

#

While the user side is a hit or miss as we all know with gradle

sturdy coral
#

Im currently trying to update my project from
userdev 2.0.0-beta.17 -> 2.0.0-beta.19
minecraft 1.21.1-R0.1-SNAPSHOT -> 1.21.8-R0.1-SNAPSHOT

I updated my gradle wrapper to 9.1.0 which supports java 25 as far as im aware.
My project uses java 25 as its jvm version.

When configuring the gradle project, i get an exception during the remapMinecraft step.

Execution of 'io.papermc.codebook.cli.Main' failed with exit code 1.
> Task :ability-api:paperweightUserdevSetup
Skipping vanillaServerDownloads (up-to-date)
Skipping extractFromBundler (up-to-date)
Executing remapMinecraft...

> Task :ability-api:paperweightUserdevSetup FAILED

Execution failed for task ':ability-api:paperweightUserdevSetup'.
> io.papermc.paperweight.PaperweightException: Exception executing remapMinecraft

The log file shows an "Unsupported class file major version 69" exception. Full log:
https://pastebin.com/BPcjNY7y

#

This means, something, somewhere, doesnt support java 25 class files. But im lost which part of the toolchain is failing with this, as all of them should be using java 25 by now.

static urchin
#

codebook asm probably isn't on 9.9 then

sturdy coral
#

Yeah was about to say that it looks like asm is on 9.6.
Is this pulled from Hypo? But this is part of the userdev dependency.
This means ill just have to wait, right?

static urchin
#

Well or you can technically somehow run the step with a different jvm

sturdy coral
static urchin
#

but definitely something we should be fixing yea

sturdy coral
#

Ill just wait. You guys do the hard work. Ill dabble in lobby plugins or whatever.

static urchin
#

kekwhyper fair enough

sturdy coral
#

ill just unpack the codebook jar and repack it with the new asm classes kekw

white arrow
#

Are there any docs for io.papermc.paperweight.source-generator? I'd like to use it in a (non-fork) paper project to generate a file that contains access to all the EntityDataAccessors via reflection (or I just extract all the entity ids manually? Although thats more prone to errors on version upgrades)

lament scarab
#

Nope

white arrow
#

not even any like small sample like fork-test?

#

guess I'll have to read through what you guys did on the paper repo then

lament scarab
#

No, it's internal tooling

white arrow
#

Would it even be usable for my usecase? Or is it just completely out of the question?

lament scarab
#

I mean, the primary goal is that it just generates a bunch of classes based upon stuff it can derive from the vanilla mapped jar

white arrow
#

that would be exactly what I want for this project

lament scarab
#

that generally smells in its wheelhouse at least from the data abilities, but, idk how far it will get you

white arrow
#

I'll see

#

I'll figure something out eventually

sharp quarry
#

did everything like on the docs but got this error im using gradle 9.1.0

proud maple
#

see the note at the top of the docs:

This guide is written using the Gradle Kotlin DSL and assumes you have some basic knowledge of Gradle.

patent pilot
#

Hi, does someone know how I would go about using Mixins in a Paper plugin ?

I've tried to add the dependency (v 0.8.7) and manually call the MixinBootstrap.init();, but I get a classNotFoundException net.minecraft.launchwrapper.LaunchClassLoader

main mica
#

that is not something that works with Paper

#

Mixins are for Fabric etc, not for Paper

patent pilot
#

How would I go about modifying a method in the game's source code ?

lucid mulch
#

you can’t through a plugin

#

you can however fork paper and make that change in the software itself

main mica
#

there are also third-party projects like Ignite which do add Mixin support via a javaagent

patent pilot
#

That feels like a very heavy option when I just want to change one single line of code

torn sonnet
#

What are you trying to change?

patent pilot
#

I'm generating a custom structure in a custom dimention (all done through the datapack bundled in the plugin).
I can configure the structure to generate a single instance in the dimention, at very specific coordinates.

I want to TP the players in the start room of the structure, which I know the coordinates of.
Issue is by default, the JigsawPlacement.addPieces does Rotation random = Rotation.getRandom(worldgenRandom); to determine the rotation of the structure - that's not something I can configure in my structure config.

As a result, I dont know in which direction i should offset the spawnpoint for my players.
All i want to do is :

        if (currentPool.toString().equals("myplugin:custom_structure/start")) {
            return Rotation.CLOCKWISE_90;
        } else {
            return Rotation.getRandom(random);
        }
#

I know how to write a mixin for it (I already have it), but my issue is I dont know how to inject it into the game's code

I know paper doesn't support Mixins, but I thought I could do the Mixin initialization manually

torn sonnet
#

Is this a plugin you're distributing or just running for yourself? If the latter, I'd just use Ignite.

patent pilot
#

I would need to ask if we can switch to Ignite, but if we cant what can I do ?

torn sonnet
#

Options are that or maintaining a lil paper fork

final jewel
final jewel
#

<@&748618676189528155>

lilac root
#

Hi, any help is appreciated, this is with a fresh clone of 1.21.10 for a paper fork https://i.tricrotism.com/idea64_xekcVVQKEb.png

Im confused since the files dont actually exist aside from in the gradle cache???!?!?!?!

Not sure what I’m missing here exactly.

lament scarab
#

Generally wrong Java version, otherwise you get the joy of looking into it

#

Make sure that the versions of stuff is aligned with paper too, such as the decompiler versions

lilac root
#

wild

brisk belfry
lilac root
sturdy coral
#

Gradle 9.1.0
JVM 25 (Eclipse Adoptium 25+36-LTS)

            version("minecraft", "1.21.8-R0.1-SNAPSHOT")
            version("userdev", "2.0.0-beta.19")

Since a few days im getting an exception when i try to load my gradle project containing userdev.
During the remapMinecraft step, i get an exception from codebook.

java.lang.IllegalArgumentException: Unsupported class file major version 69
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:200)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:180)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:166)
    at dev.denwav.hypo.asm.AsmClassData.readFile(AsmClassData.java:296)
    at dev.denwav.hypo.asm.AsmClassDataProvider.parseClassData(AsmClassDataProvider.java:65)
    at dev.denwav.hypo.model.AbstractClassDataProvider.lambda$findClass$0(AbstractClassDataProvider.java:139)
    at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1724)
    at dev.denwav.hypo.model.AbstractClassDataProvider.findClass(AbstractClassDataProvider.java:132)
    at dev.denwav.hypo.model.ClassDataProviderSet.findClass(ClassDataProviderSet.java:101)
    at dev.denwav.hypo.asm.AsmClassData.computeSuperClass(AsmClassData.java:239)
    at dev.denwav.hypo.model.data.LazyValue.getOrThrow(LazyValue.java:121)
    at dev.denwav.hypo.model.data.LazyClassData.superClass(LazyClassData.java:220)
    at dev.denwav.hypo.hydrate.DefaultClassDataHydrator.hydrate(DefaultClassDataHydrator.java:55)
    at dev.denwav.hypo.hydrate.DefaultHydrationManager.hydrate(DefaultHydrationManager.java:96)
    at io.papermc.codebook.pages.InspectJarPage.exec(InspectJarPage.java:108)
    at io.papermc.codebook.pages.CodeBookPage.exec(CodeBookPage.java:54)
    at io.papermc.codebook.CodeBook.exec(CodeBook.java:88)
    at io.papermc.codebook.CodeBook.exec(CodeBook.java:71)
    at io.papermc.codebook.cli.Main.call(Main.java:370)
    at io.papermc.codebook.cli.Main.call(Main.java:53)
    at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
    at picocli.CommandLine.access$1500(CommandLine.java:148)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
    at picocli.CommandLine.execute(CommandLine.java:2170)
    at io.papermc.codebook.cli.Main.main(Main.java:332)
final jewel
#

everything else does, just not codebook

sturdy coral
#

Userdev requires j25 if i understood a previous exception right (thats why i updated). Which means im softlocked until asm updates?

final jewel
#

userdev should work fine with 21

sturdy coral
#

Ill try it out, but i had an exception similar to "no version of userdev found for java 21"

final jewel
#

well, if it doesn't work properly in that userdev version for whatever reason, you can just downgrade to beta.18 I guess

#

but I don't think I had any issues with 21 last time I tried it

smoky violet
#

override the java toolchain used for setup in the paperweight extension

golden remnant
#

Im a noob, first time using Gradle, struggling hard. I keep getting this error

Expected configuration ':paperweightDevelopmentBundle' to contain exactly one file, however, it contains more than one file.
plugins {
    id 'java'
    id("xyz.jpenilla.run-paper") version "2.3.1"
    id("io.papermc.paperweight.userdev") version "1.7.7"
}
dependencies {
    paperweight.paperDevBundle("1.21.5-R0.1-SNAPSHOT")
}
tasks {
    // Configure the run-paper test server
    runServer {
        minecraftVersion("1.21")  // the server version to run for testing
    }

    // Make sure the reobfuscated JAR is produced when you build
    assemble {
        dependsOn(reobfJar)
    }
}
echo kilnBOT
golden remnant
smoky violet
#

when you get these kind of ugly selection errors and you don't understand it, it's one of the cases where I would actually use an llm omegaroll

#

but try editing the wrapper properties manually and then redoing the upgrade

golden remnant
#

Thank you that worked. Also updating userdev and gradle fixed my other error.

storm tendon
#

my server was on 1.20.4 and i has update to 1.21.4 and this happened

proud maple
golden remnant
#

Is their any big difference between kotlin and groovy? I didnt even realize at first I was using groovy until I kept trying to add kotlin code.

lucid mulch
#

they are seperate programming languages so yeah there are differences

#

kotlin has a lot of exotic syntax compared to groovy

golden remnant
#

In comparison to Gradle vs Maven, where people are usually suggesting I use Gradle, is Kotlin vs Groovy like that at all or is it mostly just preference?

tender edge
#

gradle team recommends kotlin these days, if you use intellij it has better ide support

lucid mulch
#

and kotlin is the preferred one

#

a lot easier to read and more supported

golden remnant
#

Cool thank you very much

novel knoll
turbid moon
#

Kotlin has exotic syntax, but at least feels consistent, Groovy feels incredibly inconsistent (braces are optional, the is like 3 types of strings you can use, etc), at least when using them as a Gradle dsl

final jewel
#

when it comes to internal classes (OCB, NMS), does userdev only provide the compiled classes or can I make it generate source files somehow?

smoky violet
#

it generates source files unless you explicitly disabled it or are running with env.CI=true

final jewel
#

I don't think I've ever set that environment variable but I'll check just to be sure

smoky violet
#

the .java files are sibling to the .class files in the final jar output by the setup task

#

you just click attach sources while viewing a decompiled file for intellij to realize

final jewel
#

when I click attach sources in IntelliJ nothing happens, usually it opens the select sources window but it isn't right now so I guess I am having an issue with IJ itself right now

smoky violet
#

yeah it won't make you select anything, it should just magically start using source files once you click it

#

in the latest EAP I get a thread error instead though

#

(when attaching or download any source pepegaroll)

#

you could try selecting the same jar though

final jewel
#

running 2025.1.2 so that shouldn't be the case for me. Though it is the flatpak version so maybe that is messing with it

smoky violet
#

basically there is no proper way to have a connected sources and binary jar produced by a task and then consumable by normal means

#

so we abuse intellij behavior in merging the jars

#

there's better ways for eclipse but no one has asked for eclipse support yet

final jewel
#

alright, thanks. I'll see if I figure out the IJ issue

smoky violet
#

(in v1 the setup was not a task and we used a different strategy to attach sources, but it had to be made a task for configuration cache compatibility; this is the same way ModDevGradle works for NeoForge)

#

it's kind of funny, I got the idea for paperweight v2's userdev task from ModDevGradle, which has influence from loom in it's file-based locking, which I PRd to loom based on paperweight code PepeLa

final jewel
#

okay, just updating to 2025.2.3 (was previously in 2025.1.2) seemed to have fixed my issue, for whatever reason. I honestly thought paperweight just didn't generate source files for the longest time lol

smoky violet
#

This is what happens when you run ./gradlew wrapper --gradle-version latest once instead of ./gradlew wrapper --gradle-version latest && ./gradlew wrapper - see image

(i.e: always run the wrapper task twice when upgrading Gradle for a full upgrade)

This is because wrapper is a normal task that extracts the wrapper files from the current Gradle runtime and sets the new url in the properties file, as described in the Gradle docs!

https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper

plucky goblet
#

could it be a cache issue?

#

seems like it was an intellij cache problem specifically, it builds fine from the terminal

white arrow
#

Is there a way to apply feature patches fuzzily? Patches in the same region and file succeded with fuzzy apply on file patches but fail to 3-way-merge on feature patches

Its mainly just variable names that changed since something in paper was updated (is it mache?)

lucid mulch
white arrow
#

Is there a way to make this easier to apply? There are no code changes except variable names

#

(Except doing stuff like patch editing)

white arrow
lucid mulch
#

and then commit/rebuild

lucid mulch
#

the variable names are changed due to mapping updates

white arrow
#

will look at that thanks

white arrow
#

I think those are included in mache, is that right?

lucid mulch
#

yes

misty current
#

Anyone know why Idea wont load ANY classes, not even from the jdk?

#

I managed to get it loading the KotlinSDK after adding "facets" to my modules, but its still not importing anytihng

#

ive reinstalled idea twice with no avail

#

deleted all cache directories and rebuilt them

#

reinstalled jdks

#

also, my buildscripts are completely unresolved, so it seems no gradle jars are getting loaded either (possbily symptom from not importing any classes)

#

but strangely, gradle syncs and builds.

#

So it is purely IDEA

#

ive been working on this for like three hours and no amount of googling or AI has helped, so im unsure what i could do next

gaunt ledge
#

notepad > IDEA

misty current
#

except i want debugging and semantic analysis 😭

gaunt ledge
#

ive js gotten used to it atp after giving up trying to fix it

crude kernel
#

did you try deleting the project's .idea and then restarting idea

misty current
#

yes

#

its for every projcet

#

i generated a new project from scratch and had the same issue

#

CLion works great though! thats a relief

#

but yeah it seems IDEA just wants me to not make plugins

#

it may be something linux related but I dont know how thats possible, considering nothing massive changed since it was last working

#

All build steps work and I do get a plugin jar

#

meaning its literawy juts idea being angry

#

if anyone has ANY ideas, please ping me

sharp trellis
#

hi, not sure where to ask, but I have problems running runServer/runClient in mache.
it seems that run configuration does not include default game assets, like version.json or default en_us lang file.
any ideas?

[13:51:32] [main/WARN]: Missing version information!
Exception in thread "main" java.lang.ExceptionInInitializerError
        at net.minecraft.network.chat.contents.TranslatableContents.decompose(TranslatableContents.java:91)
        at net.minecraft.network.chat.contents.TranslatableContents.visit(TranslatableContents.java:184)
        at net.minecraft.network.chat.Component.visit(Component.java:103)
        at net.minecraft.network.chat.FormattedText.getString(FormattedText.java:88)
        at net.minecraft.network.chat.Component.getString(Component.java:47)
        at net.minecraft.world.item.CreativeModeTabs.validate(CreativeModeTabs.java:1885)
        at net.minecraft.server.Bootstrap.bootStrap(Bootstrap.java:58)
        at net.minecraft.server.Main.main(Main.java:107)
Caused by: java.lang.NullPointerException
        at java.base/java.io.Reader.<init>(Reader.java:168)
        at java.base/java.io.InputStreamReader.<init>(InputStreamReader.java:123)
        at net.minecraft.locale.Language.loadFromJson(Language.java:77)
        at net.minecraft.locale.Language.parseTranslations(Language.java:70)
        at net.minecraft.locale.Language.loadDefault(Language.java:38)
        at net.minecraft.locale.Language.<clinit>(Language.java:32)
        ... 8 more
// Language.java

private static Language loadDefault() {
    // ...
    parseTranslations(biConsumer, "/assets/minecraft/lang/en_us.json");
    // ...
}
#

tested both 1.21.4 and 1.21.10 to make sure I didn't mess anything when updating to the latest version

static urchin
#

first run setup

sharp trellis
#

ohh, thanks, I forgot about that. I only run applyPatches

#

works now

shrewd crestBOT
hexed sable
# shrewd crest

I loved how I see channels notify me then a video shows and disappears lol, nice job !

turbid moon
#

I speedran that one lol. No need for the mods ping this time

#

They are really annoying lately because they themselves delete the messages shortly after posting, so you gotta be quick to grab their user lmao

hexed sable
#

Yeah i didn't have the time to see the vid lol

hexed sable
high sentinel
#

how do i fix ./gradlew: Permission denied in github actions?

lament scarab
#

you need to mark it as executable

turbid moon
#

What I did was add an extra step in the GH actions script which literally just runs chmod +x ./gradlew before running the actual build

#

Cool to know that it is possible with git as well though

main mica
#

I mean adding this to the actions script is permanent

lament scarab
#

unless you remove the execute flag from the file it will remain executable

#

otherwise, as said, just add an actions step to mark the file as executable

chilly steeple
#

hi can you tell me can I use JDK 22 with gradle 9.1.0 for paperweight?

bronze ember
#

what error are you getting?

chilly steeple
lucid mulch
#

if 22 causes issues

chilly steeple
turbid moon
#

Never said you are stupid

#

It's literally written in the info box what you should do

chilly steeple
#

Its literally that what i have done

chilly steeple
#

Thats why i asked for java ver

digital vale
#

Hello, I get this error when compiling a module using paper weight:

Execution failed for task ':NMS:V1_21_8:compileJava'.
> Could not resolve all files for configuration ':NMS:V1_21_8:compileClasspath'.
   > Could not find net.kyori:adventure-text-serializer-ansi:.
     Required by:
         project :NMS:V1_21_8 > io.papermc.paper:dev-bundle:1.21.8-R0.1-SNAPSHOT:20250906.215025-55

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
echo kilnBOT
digital vale
smoky violet
#

a command line build log is better, don't need all the intellij junk

digital vale
smoky violet
#

there's something weird with your logs it should be showing a selection error about why it cant be resolved and what it tried

#

maybe try a build scan

digital vale
smoky violet
#

yes add --scan to the failing command

#

and then activate the scan in your browser before sharing it

digital vale
#

I think I've found it, it contains private information. Can I send it to you in a private message?

hexed sable
#

Hey, I have a small issue where if I use runDevServer with debug in intellij. For example, i set it when the sheep spawns, so the debug starts, and when I click on resume program it shows an error and kills the gradle task

#

Can I somehow avoid this?

lament scarab
#

probably the watchdog

#

there was a system property to disable that, you'd need to check the docs unless somebody else has it

hexed sable
lament scarab
#

yes

hexed sable
#

Amazing, thank you!

hexed sable
#

Something like this

lucid mulch
iron jungle
#
  `java-library`
  id("io.papermc.paperweight.userdev") version "2.0.0-beta.18"
  id("maven-publish") 
}

group = "dev.lrxh"
version = "2.0-SNAPSHOT"
description = "BlockChanger library built with Paperweight"

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

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

tasks {
  compileJava {
    options.release.set(21)
  }
  javadoc {
    options.encoding = Charsets.UTF_8.name()
  }
}

publishing {
  publications {
    create<MavenPublication>("mavenJava") {
      groupId = "dev.lrxh"
      artifactId = "BlockChanger"
      version = "2.0-SNAPSHOT"

      from(components["java"])

      artifact(tasks.named("reobfJar")) {
        classifier = "reobf"
      }
    }
  }
  repositories {
    mavenLocal()
  }
}
novel knoll
#

right, and how are you consuming the library?

iron jungle
novel knoll
#

yes, i mean in that other plugin

iron jungle
#

I am just calling a method in the library itself

novel knoll
#

i mean not that you should be publishing a reobf'd library to begin with

#

what i'm asking is how are you depending on the library in that other plugin

#

in the build script

novel knoll
lucid mulch
#

use that

#

youll have to run the ./gradlew wrapper —gradle-version latest task twice before switching tho

lucid mulch
#

@iron jungle

iron jungle
#

will that fix the issue?

iron jungle
#
  `java-library`
  id("io.papermc.paperweight.userdev") version "2.0.0-beta.19"
  id("maven-publish")
}

group = "dev.lrxh"
version = "2.0-SNAPSHOT"
description = "BlockChanger library built with Paperweight"

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

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

tasks {
  compileJava {
    options.release.set(21)
    options.encoding = Charsets.UTF_8.name()
  }
  javadoc {
    options.encoding = Charsets.UTF_8.name()
  }
}

paperweight {
  reobfArtifactConfiguration.set(
    io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
  )
}

publishing {
  publications {
    create<MavenPublication>("mavenJava") {
      groupId = "dev.lrxh"
      artifactId = "BlockChanger"
      version = "2.0-SNAPSHOT"

      from(components["java"])
    }
  }
  repositories {
    mavenLocal()
  }
}
``` This is how it is now
novel knoll
#

yeah that should be fine as long as you don't reobf the plugin that consumes the library then

iron jungle
#

This my plugin:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>dev.lrxh</groupId>
    <artifactId>WorkingDolphin</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <name>WorkingDolphin</name>

    <properties>
        <java.version>21</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <defaultGoal>clean package</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.5.3</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <repositories>
        <repository>
            <id>papermc-repo</id>
            <url>https://repo.papermc.io/repository/maven-public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.21.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

                <dependency>
                    <groupId>dev.lrxh</groupId>
                    <artifactId>BlockChanger</artifactId>
                    <version>2.0-SNAPSHOT</version>
                </dependency>
    </dependencies>
</project>```
iron jungle
#

Any solution for my issue?

bold sorrel
#
Some problems were found with the configuration of task ':mainResourceFactory' (type 'ExecuteResourceFactories').
  - Type 'xyz.jpenilla.resourcefactory.ExecuteResourceFactories' property 'factories.$0.value.apiVersion' doesn't have a configured value.
  name.set("FakePlayers")
  version.set("1.0.0-21.8")
  main.set("dev.suitsnap.fakeplayers.NPCPlugin")
  bootstrapper.set("dev.suitsnap.fakeplayers.NPCBootstrapper")
  authors.add("SuitSnap")
  apiVersion.set("1.21")
}

HUH

lament scarab
#

update gradle and the plugin

#

otherwise something else in your setup is wrong

bold sorrel
#

it builds fine just wont compile

lament scarab
#

Yes, because the plugin is upset for some reason

bold sorrel
#

updated the resource factory to 1.3.1 and it worked thank you :3

lucid mulch
#

@smoky violet is it possible to have both the runPaper and runFolia tasks at the same time in one module? i added the register folia run task function from the wiki but now it deregistered the paper one

#

im hoping i dont have to manually register it

lucid mulch
#

sorry for the ping, i did that because it’s your plugin so i thought i should ask u specifically as you’d know best 😔