#build-tooling-help
1 messages · Page 1 of 1 (latest)
Period .
incredible
first
Maybe pin this?

How do I automatically run buildtools to get the latest spigot jar on startup?
ban
!ban @whole brook treason
I'd cry from laughing if the bot would ignore the backslash
i agree
someone know how to compile a plugin using kotlin in maven? because with the default maven with the dependecys i need my source is missing in the jar
I'd like to know how exactly reobfuscation mappings are generated in paperweight and why it requires Hypo. (a library by DenWav) I want to generate spigot -> yarn / mojang, yarn / mojang -> spigot mappings and use them in a fork of fabric loom for a mod development using paper sources and reobfuscate the build output back to spigot. (I've already implemented fabric loader for paper)
hypo is probably needed because spigots mappings are broken
Hypo cleans the generated mappings
Mostly of inheritance errors
We had to do that because the mappings were broken in subtitle ways and we couldn't figure out how to fix the cadix libs
(we did fix a bunch of stuff in the cadix libs)
@dusky anvil what would be the point of using paperweight if you don't need server internals?
i generally like to just clone the paper test plugin and it has paperweight that's why
and i would have the option to add nms if it's needed whenever
The whole point of pw is to use internals, if you add an option to disable that you're basically doing the same thing as not applying the plugin
I think just having the test plugin checked out locally is the simplest thing
you could use a gradle included build if you want to have the test plugin and it's deps show up in your ide
in your settings script includeBuild("path to test plugin")
and if you want that locally but not comitted to the repo you can do something like what we do in the Paper repo for it's test plugin project
so cloning https://github.com/PaperMC/paperweight-test-plugin and change it to not include the paperweight plugin and use includeBuild("path") to the local repo in my new plugins?
shouldn't need to make any changes to the test plugin
just include the build and when you sync the ide it'll attach everything
alright thanks
just tested it myself to make sure there's no issues with userdev and included builds, never tried it before, looks good though
Can reference the same test-plugin dir from multiple projects to reduce setup time, recent paperweight will properly handle concurrent instances
amazing
whut this mean? https://i.imgur.com/qKbUh1i.png
Did you . . . . look in the log?
sí
pw 1.5.2,
paperweight.paperDevBundle("1.19.3-R0.1-SNAPSHOT") in my dependencies build.gradle
using the groovy dsl
already tried ./gradlew cleanCache then ./gradlew clean build
do you happen to be using or have a jdk >= 19 installed
is this a "I should poke shrimp about that FF branch" thing?
So is the solution to use java 17 as toolchain orrr?
that would probably fix things
longer term I need someone to, like, degauss my brain so I can actually do things
forgeflower
yes please :p
we have an interesting set of mutual friends lolwtf
Me too
i cloned the geysermc repo and im using lang level 17 so WHY is this error?
even if i click set language level to 14 nothing is changed
it’s set to 8
no
all of them?
ye
so if you click on spigot then on spigots main it’s also 17?
we Are friends 🙄
u might need to change what JDK gradle is using, its Settings -> Build Tools -> Gradle -> look for something that says like SDK / JDK near the bottom
@heavy ginkgo
just changed that
Any clue why I am getting this
class io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject cannot be cast to class io.papermc.paperweight.userdev.internal.setup.UserdevSetup (io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @1813c18a; io.papermc.paperweight.userdev.internal.setup.UserdevSetup is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @5889322b)
apply plugin: 'io.papermc.paperweight.userdev'
apply plugin: 'com.github.johnrengelman.shadow'
shadowJar {
zip64 = true
// Relocations
dependencies {
}
}
dependencies {
if (findProject(":shared") == null) {
api project(":libraries:shared")
} else {
api project(":shared")
}
paperweight {
paperDevBundle "1.19.3-R0.1-SNAPSHOT"
}
compileOnly libs.protocollib
}
build {
dependsOn("reobfJar")
dependsOn("shadowJar")
}
I've just tried to switch my project to use userdev, but it seems to be missing stuff like Player#sendMessage(Component), PersistentDataContainer and other stuff.
plugins {
id("java")
id("com.github.johnrengelman.shadow") version "7.1.2"
id("io.papermc.paperweight.userdev") version "1.5.2"
}
group = "cx.leo.prison"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
maven("https://jitpack.io/")
}
dependencies {
// PaperMC-API
paperweight.paperDevBundle("1.19.3-R0.1-SNAPSHOT")
// PlaceholderAPI
compileOnly("me.clip:placeholderapi:2.11.2")
// Vault
compileOnly("com.github.milkbowl:VaultAPI:1.7")
// https://search.maven.org/artifact/dev.triumphteam/triumph-gui/3.1.3/jar
implementation("dev.triumphteam:triumph-gui:3.1.3")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
tasks {
assemble {
dependsOn(reobfJar)
}
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
}
processResources {
filteringCharset = Charsets.UTF_8.name()
}
shadowJar {
fun reloc(pkg: String) = relocate(pkg, "${project.group}.library.$pkg")
reloc("dev.triumphteam.gui")
}
build {
dependsOn(shadowJar)
}
}
you are correct, thank you
you need to do the workaround for the gradle bug like in the test plugin readme
@muted gazelle you need to use the shadow plugin, see the shadow branch of the test plugin for an example
i'm trying to use this but "Task with name 'assemble' not found in project ':v1_19_R2'"
how can i fix it and why not found when it exactly exists? named("assemble") also doesn't help
subprojects {
apply(plugin = "io.papermc.paperweight.userdev")
tasks {
assemble {
dependsOn(named("reobfJar"))
}
}
}
you're not applying the java plugin
which applies the base plugin, which creates those lifecycle tasks
or if you are applying java it's in the subproject script and happens in the wrong order
oh, okay. now I have this. how can I ask shadowJar to include this dependency only after reobfJar task (task only in module :v1_19_R2)?
upd: implementation(project(":v1_19_R2", configuration = "reobf")) - correct?
the one in the text block is correct
@smoky violet
https://gradle.com/s/o5xilmixaqug4
I wrote this on my phone but should be correct
you need to resolve this circular dependency
looks like you have api depends on main depends on api
after fixing that if there's still issues send another scan, this one doesn't have dependency info because of that failure
The problem is in FlowCoreModeration
well, your build is broken, can't debug anything else until the circular dep is fixed
if you look in the dependencies tab you'll see it's empty, the failure was before any resolution could happen
Aha
so I can't inspect your dependencies for your issue, not sure how intellij even imported the project (unless it was imported before it broke)
Well the API doesn't need to depend on the main, but the main does depend on the API
Pretty sure it was imported after breaking but I'm not even sure anymore
sometimes intellij does weird things with broken gradle builds
like hiding errors or half importing
so yeah, just remove the dependency on core from api, and if the issue persists after refreshing the project send another scan
I actually realized that API does depend on the main class of the main module (the initial plugin)
I will try my best to make the API standalone actually
Could be my bad
Don't know what I was thinking
the hacky way can be with reflection, but in the end you just need to get rid of the circular dep one way or another
better way is restructuring things so its not needed
Restructured 100%
Well not 100% because I made an API class and a lot of classes depend on that now
Activated
Also please don't look at my infastructure
If you do then you will be more than excited with an Intel core i3 with 4gb ram laptop
IFlowCore is an abstract class
it only resolved the deps for api
since the rest depends on api and you don't have parallel on
which parallel will exit once api fails anyways, so probably wont resolve still. need to fix the code first
can someone help me out? ive been stuck on this error for a couple hours now while trying to fork a paperweight project
does the fork itself build?
nothing builds
did you run applyPatches?
i can't the main gradle build script doesnt build
just run the command from the command line instead of your IDE (gradlew applyPatches)
that looks like it might be a bug
but you would have to be realizing the generateDevelopmentBundle task early for it to show up
@willow shard try with 1.5.3-SNAPSHOT (needs the paper repo in settings)
right now im having trouble with even running gradlew in wsl
I just use linux :p
https://github.com/PaperMC/paperweight/commit/298ae45990486db18610c415fed9e7a745b65ecf I pushed a commit which will probably fix that though
(the error, not wsl)
dude i love you
jmp iz gradle wizard 
did that fix it?
yes it did
surprising no other forks reported it
I'll push 1.5.3 sometime soon with that fix
😽
I wanna publish my project to my local repo. trying this but "Unresolved reference: maven/mavenJava" happens. (kotlin DSL)
plugins {
...
`maven-publish`
}
publishing {
repositories {
mavenLocal()
}
publications {
mavenJava(MavenPublication) {
from(components["java"])
}
}
}
fixed with:
create<MavenPublication>("maven") {
from(components["java"])
}
how can I publish only source jar? so, I dont wanna set ":sources" or any other mapping to version. I want like in paper-api, where u just using io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT
Sources jar only won't get you anywhere?
I don't quite understand you. I have a source jar generated in the local repository, however, gradle uses the compiled jar. I would like it to use jar with sources instead of compiled without any version mappings.
The sources jar is an additional artefact to the compiled dependency
You don't depend on "just" the sources
Concerning that usually you cannot compile against just the source
sooo, I did it and it works perfectly. I can see comments and javadocs
plugins {
`maven-publish`
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
repositories {
mavenLocal()
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
Yea thy deploys the binary, the javadocs jar and the sources jar
@wanton cargo paperweight doesn't auto update unless you used + in your version declaration
the dev bundle is a snapshot though, you can either pin specific snapshots or use ```kotlin
configurations.paperweightDevelopmentBundle {
resolutionStrategy.cacheChangingModulesFor(3, "days")
}
in general the updates won't take more than a couple seconds, when the decompiler, mappings, or ats change it can take longer, which in the last version the decompiler changed
and how can I make it not change?
I needed to open the task manager and kill the proccess
like I said, pin a specific snapshot, or set a resolution strategy
because it was using 100% of my cpu
I mean, it's decompiling
it takes some horsepower
it only decompiles again when it needs to, see the conditions I mentioned above
you're like, 6 versions out of date on paperweight (latest is 1.5.3)
but I already gave you two solutions and linked the docs
if you have more specific questions I can answer them
and how I pin a specific snapshot?
open the paper repo in your browser, and locate the dev bundle
it will show a bunch of versions with timestamps instead of -SNAPSHOT
pick one
Nexus Repository Manager
in 1.5.3 paperweight.paperDevBundle 'version' will also work in groovy
for the bundle dep declaration
got this after clicking the reload button https://paste.md-5.net/idunujunal.http
you have paperweight on the classpath twice somehow
create a build scan and send the link after you activated it
you're applying different versions, you need to only declare the version in the root project like described in the test plugin readme
is there any way to import all minecraft classes to a fork?
you don't want to do that. you will have to fix a 1000 decompile errors in order to compile
they should be available as sources tho
okay, maybe instead a package?
I think paperweight only supports 1 per line in the configured file for dev imports
can you show me what format dev-imports even uses? i cant get it to do anything atm
can take a look at ours to see. https://github.com/PaperMC/Paper/blob/b95d4b28b806ace2d61e9fe0bb13cede4a5e8847/build-data/dev-imports.txt
thank you
would be epic if that supported regex... ||jmp||
oh @smoky violet was looking at the pw mc dev stuff, we don't need the banned classes stuff anymore, that is all in the io.papermc package now
also, I would totally work on adding regex support for dev-imports if you'd accept it, I'd find that really useful for some things. (mainly like NOT typing out the full name for classes that def only have one named that)
pretty simple for mc files https://pastes.dev/Ub3tBDDwi8
does paperweight have an ability to generate a remapped patched server jar and add it as a dependency without decompiling it?
I think glob matching would be more convenient
java has api for doing it on Paths
if you mean userdev, yes, but it's more an internal thing and only intended for use on ci https://github.com/PaperMC/paperweight/blob/main/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/util/utils.kt#L178
for a variety of reasons it's not really an advertised feature or something we want to support outside of ci
but, nothing stops you from setting the property
just no guarantees it will stay there or have notice when/if it's removed, but I don't see it being removed in the foreseeable future
thanks
also for pre-1.18 bundles it will have to decompile regardless
iirc
might be wrong on that one though
what are those reasons? Are there any problems with it?
Because you can't ship that stuff publically
When I use paperweight-userdev, gradle says that it misses a lot of dependencies such as fastutils and authlib, how do I fix this?
share log
:Spoof-Spigot-19r3:test: Could not resolve com.mojang:authlib:3.16.29.
Required by:
project :Spoof-Spigot-19r3 > io.papermc.paper:paper-server:userdev-1.19.3-R0.1-SNAPSHOT
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
can you send your build files
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
Make sure you're applying user-dev at the root project
https://github.com/PaperMC/paperweight-test-plugin read the notes here
that's why
thanks
@distant mango
doesn't work
pluginManagement {
repositories {
gradlePluginPortal()
maven { url "https://repo.papermc.io/repository/maven-public/" }
maven { url "https://libraries.minecraft.net/"}
}
}
plugins {
id("io.papermc.paperweight.userdev") version "1.5.2" apply false
}
Added the plugin like that
might need to add it in the root build.gradle(.kts)
oh shit
@distant mango you know what causes this?
@smoky violet https://scans.gradle.com/s/ouuhdsnmeefj2
Variant 'apiElements' capability io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT declares a library for use during compile-time, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 8
you need to set java 17
same error for authlib
and dfu
ahh
how would I do this
all SDK's are set to coretto 17
and I have added java { toolchain { // Defines project's jvm build version. If its not found on the system it downloads it from the internet. languageVersion = JavaLanguageVersion.of(17) } }
to all scripts
also add the release.set part from the example script
I mean, now you just have compile errors
is your code already for 1.19.3?
and just using spigot mappings?
or is it for an older version as well
oh my bad
didn't realize that
😂
thanks jmp
@smoky violet one last thing, the userdev doesn't come with craftbukkit
how would I import that?
it does

sorry new to gradle 😅
you probably have the wrong version import
Jmp is generally so right omg
I'm trying to publish my packages to maven central through github ci which auto build the code and publish them. I'm using kyori indra publishing plugin, and I'm using in-memory pgp keys by using the gradle signing plugin:
signing {
val signingKey: String? by project
val signingPassword: String? by project
if (signingKey != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
}
on ubuntu this works fine, on windows and macos the signing fails: https://paste.gg/p/anonymous/453017646ab74b95a3b69fcb14b243d5
gpg: signing failed: No secret key
I'm going to place a guess, and guess that you don't have your secret key installed on there
I pass the key in through GH actions:
- name: "Publish release"
if: ${{ env.version_type == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: ./gradlew -PforceSign=true publishToSonatype closeSonatypeStagingRepository
env:
CI_PUBLISH_CORE: ${{ matrix.publish-core }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
I've tested if signingKey is not null by adding a println inside the != null block, and I do get output there during the build. So signingKey is passed in, and I'm assuming useInMemoryPgpKeys is also called therefore, but gpg just doesn't find it
On whatever runner that CI_PUBLISH_CORE is set, the run will work fine. If on that runner that variable isn't set, it fails to sign.
signing key being not null, and your gpg secret key being installed, are two entirely different things
Which is weird, because that core variable has nothing to do with signing
I don't think it's to do with that. The CI_PUBLISH_CORE determines if that runner publishes a separate API package, and it's only set to true on the ubuntu runner. I changed this to be true on the windows runner, and suddenly the ubuntu runner started failing with "signing failed: no secret key"
Yes, but I've never installed a secret key on any machine, and it ran fine on the ubuntu runner before
I just pass the key and pwd in through environment variables, and use useInMemoryPgpKeys
do I have to do anything special to get a fork's devbundle to to be used from maven local? when I try to refresh the gradle project using the dev bundle it says there are bunch of patch apply failures. I looked at the patchedSources.jar.log and its over 1000 hunks failed
ok, updating the decompiler/rempapper fixed a bunch, now only 47 hunks aren't applying
bleh, it works with the paperweight-examples right away. so I guess I have some small thing mis-configured
man, I cannot figure out why its not working. the fresh clone works, but afaik this should be the exact same, and its dev bundle won't work https://github.com/Machine-Maker/MachinedPaper
that still looks like an old decompiler version to me (?)
Paper is at 627.2 and you are at 605.1
(and thats what caused random dev bundle issues in the past for me at least)
oh I just used what's in paperweight-examples. I didn't even think to check if paper was newer than that
yeah, that was it. confused as to why I was getting it to work with the fresh paperweight-examples then, but whatevers
Somebody should update that then and we should remember updating it when paper updates
there's so much stuff like that that needs to be auto updated, but its all in different formats and stuff
like updating both paperweight-examples and paperweight-test-plugin
it'd be easier if updating paper or paperweight auto opened issues requesting an update on all the places
Alternatively we do what we do at work and have patch days, every X weeks, make sure x y z are fine
And just have a list you check every X weeks
yeah, that'd work too
I keep getting this error
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/gradyn/McsMigrationManager/McsMigrationManager has been compiled by a more recent version of the Java Runtime (class file version 63.0), this version of the Java Runtime only recognizes class file versions up to 61.0
I dont even have java 19 installed.
im even building with the same JDK that im running paper with
still dont know what the issue was but i deleted target and ran package again from scratch and now its working 
My only Suggestion: did you trie to set Version 17 in the pom.xml?
I got the same error a few hours ago and this was the Problem.
I sadly run into an error when using paper patcher in our custom fork of paper when upgrading from paperweight 1.4.1 to paperweight 1.5.X. The build scripts have not been touched between versions, I can provide a gradle build scan: https://scans.gradle.com/s/2qaqpajyujino
Does anyone know what Project : declares a dependency from configuration 'serverRuntimeClasspath' to configuration 'consumableRuntimeClasspath' which is not declared in the descriptor for project :. could mean?
try using 1.5.4 instead of 1.5.3. There was a very similar looking bug that jmp fixed a few days ago, maybe its that
alright. Is it ok if I send them as PM?
what do you need to hide in your build script
not really that much. Its just technically bound by an NDA
I mean I didn't sign the NDA either lol
I know - whatever I'll just send it to you. Its not a significant portion of code or any creative thing anyways
also no use in sitting on code that does not work 😄
try replacing -SNAPSHOT with 5.0.0-SNAPSHOT in build.gradle.kts for protocollib
How i set the slug/owner for the hanger paper publish grade plugin ?
update to 0.0.4 for the examples from the readme to work
Hi, not sure if this is the right place to ask, but I was wondering if there was any way to import minecraft's own data files (the json files found in data/minecraft, for example data/minecraft/dimension_type/overworld.json) to a fork so I can edit them. Putting the file name in dev-imports.txt doesnt seem to work.
No, not supported by paperweight atm. There’s an open issue tho. You can just make a datapack to override those files
ok, thanks
hi, i have multimodule project, and i'm trying to implement one of modules that uses paperDevBundle, and unfortunately, it's only executing jar, not assemble
how can I fix this
the question doesn't fully make sense but I am guessing you want to depend on the reobf configuration of the paperweight module
if i correctly understand you, yes
now i have implementation(project(":v1_19_R2"))
but it runs jar task instead of reobfJar or assemble
project(path, configuration)
project(":v1_19_R2", "reobfJar") like this?
it works, thanks!
yw
Hi, trying to set up https://github.com/HangarMC/hangar-publish-plugin, getting:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'io.papermc.hangar-publish-plugin'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)```
in plugins i have id("io.papermc.hangar-publish-plugin")
(plugin dependency must include a version number for this source)
it wasn’t able to find 0.0.4 either
I mean, it's a standard publication on the plugin portal
did the action not go for 0.0.4 maybe
apparently github does not trigger release action for pre releases
I was gaslighted last time
now 0.0.4 is published
It is possible to disable re-obfuscation for own compilation
you can use the task createMojmapBundlerJar
or potentially createMojangMappedBundlerJar. I don't quite remember which is used there. one or the other. check ./gradlew tasks
Thanks thats was i searching for
It is possible to install devBundles locally ?
Yeah, at least I did it once.
yeah, if you are using the publication setup from the paperweight-examples repo, just run the normal ./publishToMavenLocal -PpublishDevBundle
Thanks, also make compile able
If I have two publications, and don't want to redefine apiKey and platforms across both of them (they're identical), how would I avoid having to do that?
do i set io.papermc.hangar-publish-plugin.default-api-key as an environment variable?
Hi. How I make a Maven instance on Intellij with paper?
https://papermc.io/using-the-api is not helping
Could you reword that? Not sure what you mean.
All described there at which point your failing?
I created a Simple Gradle project on Intellij and after adding the lines from website:
Unresolved reference: toolchain
Unresolved reference: JavaLanguageVersion
send error and your gradle project
You likely need the
`java-library`
as plugin.
It's something that changed with Gradle 8 if I remember right.
Is there a simple way to add it like spigot?
Or an alternative like it?
Not really, no, we recommend getting comfortable with maven or Gradle
Adding dependencies that way is the least "simple" way :)
and publications is a NamedDomainObjectContainer, you can use all of the standard methods to configure things (ie configureEach)
I don't know. For my seams more simple to add just one file and has all in it what I need. Than wait for Maven to download resources and to edit the pom every time and to press Install Changes.
For my seams more time spend to setup than 2-4 clicks and is done.
Maybe because I never used.
But if I want to update some mods I need to change many things.
Not just remove the spigot and add paper.
Maybe because I never used.
That is the issue.
mhm, if you don't know how to operate a tractor using hand tools will seem simpler
learn to use proper build tooling, you'll thank yourself later
what versions does paperweight support?
1.17.2+
okay, thx
all other modules are working fine, but 1.19.4 module can't find the dependency
wait what paperDevBundle is deprecated now?
can you build with --scan and activate/send the link
sure
paperweight.paperDevBundle
it uses gradle extensions instead of top level kotlin functions now so it works on groovy
why dont you just tell groovy users to suck it?
(i haven't updated all of mine to kotlin yet but a couple days ago i just got chatgpt to do it all for me)
even with the difference outlined in the build script it was still a common thing people ignored and asked about in discord
many times a week
pain
easier to just make it work
i guess yeah but i dont see a reason to deprecate it
will get removed in 2.0
oh for fucks sake building with a scan is building everything again
top level extensions are super hacky
oh
wouldn't it just be DependencyHandlerScope.paperweight()? what's weird about that?
putting things in the root package is just bad practice
alright
was a hack I did before I knew you could add extensions to the dependency container
oh so it wasn't defined as DependencyHandlerScope.paperweight()?
it was, just in the root package so you don't have to import
oh i see, never knew that was considered bad practice
looks like its managing to find 1.19.4 now
interesting
See the "Try" section?
The thing provided literally 0 useful information
add --stacktrace
Oh, I think it's your version.set(version)
yeah the inner scope takes priority in name shadowing
register is what I would do too, just explaining
yeah but i made the mistake of not realising that i wasn't testing publish 🤷
fair because the error was in configuration not execution
it didnt say it happened in the publish task
com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not create task ':paper-server:runDev'.
Caused by: java.lang.UnsupportedOperationException
Is this a Gradle bug or something? I tried pulling the dev branch but it fails to sync
need to delete outdated server dir
ah, ty 👍
aha, yeah I guess I could do it that way
just compile errors
e: /Users/will/IdeaProjects/eco/eco-core/core-nms/v1_19_R3/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_19_R3/CommonsInitializer.kt: (159, 43): Unresolved reference: ServerGamePacketListenerImpl
e: /Users/will/IdeaProjects/eco/eco-core/core-nms/v1_19_R3/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_19_R3/CommonsInitializer.kt: (159, 74): Unresolved reference: Channel
you probably have the wrong version import
ive added them as imports now
still not being very happy
ill clear caches... again
nothings importing at all according to intellij, doesnt recognise anything bukkit/paper/nms
just nothing
other modules are fine
ill go again
WHY IS IT BUILDING FINE THEN
IVE CLEARED CACHES OVER AND OVER AND INTELLIJ STILL DOESN'T RECOGNISE IT
if its building fine but intellij is dying not much I can help with 
yeah but it's not fine because i was told you need to reflectively get the channel from ServerPlayerConnectionImpl or whatever its called now
so i can't just merge, push, and worry about it later
thanks though jmp you've been a great help
paper has mappings in the jar, can use my reflection-remapper lib to read them, on spigot glhf
we ball
ill just wait
wont affect anyone whether eco has 1.19.4 support today or if it has it tomorrow
I had to do some "fun" reflection for .4 as well: https://github.com/jpenilla/squaremap/commit/59a8822f49be8c8545355db2822d2cb58a13cb1a#diff-f7d77db2b1b9437d4bb9bdc5cf280834824469b46a637075bb6a3730204fb6f9R80-R109
was able to avoid using names though
wait why dont you just merge that into paper and make an api for it?
also the chad .coerceInRange() over clamp
It's one of those APIs which spigot has some work on for a good while now
(part of their "don't treat the API enums and enums warning)
also that code is not paper-specific
same code runs on forge/fabric/sponge
I could use AT/AW/Mixin on those other platforms but easier to just always use reflection
mixins are sexy
Mixins 😍
had a quick maven question. someone told me that my plugin source is getting compiled into my jar.
Is there some sorta flag or something I can set in my pom files to sort this out?
if you mean the .java files are being copied in there, see your pom file and make sure that you're not copying them in there
I mean, look in the jar, see if .java files exist
yes that's what it is, they were saying that the .java files were being included in the .jar
comments and everything
As far as this goes, I don't see anything in my pom that blatantly suggests that it's copying those files over.
I may need to share all of my poms with you because there are a few differnet (like paper and velocity) versions that are all compiled into one jar
I mean, if that's happening is cos your pom is configured to do that
yes you're totally correct, I'm not trying to deny that. I'm just saying at first glance I don't see anything that's like <copyAll.JavaFilesIntoTheSourceJar> (obv this is a joke)
So lemme throw these poms into a paste and I'll share that. Unless there's a specific config option that you know off the top of your head might be causing this
there are several dozen ways to do it, singling one out would be a waste of time
I'm not exactly a maven guru so I appreciate any help 🙂
line 315
ohh thank you! Lemme see if I can find the answer I need from here! I'll let you know if I'm stumped
okay so I just added <exclude>*.java</exclude> and it seems to have worked!
I got an exception at server startup but that's just cause I didn't implement bstats properly (bStats Metrics class has not been relocated correctly!)
@smoky violet here is my interpretation of supporting patching data files https://github.com/PaperMC/paperweight/pull/190
I had to do a bit of weirdness to make sure they had final newlines, I guess they initially don't
maybe that part would be better to have elsewhere, like when first decompiling the jar or smth
unfortunately, this much work in kotlin has made me really, really like the closure stuff and all the super nice stuff kotlin has
also did the glob stuff
whichever one is merged first, the other will need to adapt to its changes
Is there a way to get rid of the -unspecified?
https://cdn.lightdream.dev/nxplayer.bin_n2QOpC6fHp.png
plugins {
alias libs.plugins.paperweight
alias libs.plugins.shadow
}
shadowJar {
archiveFileName.set("Libraries-Bukkit-Plugin.jar")
}
dependencies {
paperweight {
paperDevBundle "1.19.3-R0.1-SNAPSHOT"
}
}
// ========== Build ==========
tasks {
assemble {
dependsOn reobfJar
}
reobfJar{
archivesBaseName = "Libraries-Bukkit-Plugin.jar"
}
}
getting this error trying to use 1.18.1 user dev in a module, using user dev 1.5.3, it has teh repo
fixed it
Hi, what if should i do if i want to use nms from version below 1.17.1 with paperweight (i need it to work with jitpack, so paperweight is the only solution i think)
I'm trying to build a project with java 20 and I have a build-logic folder which uses kotlin-dsl. I'm getting this error:
* What went wrong:
Execution failed for task ':build-logic:compileKotlin'.
> Error while evaluating property 'compilerOptions.jvmTarget' of task ':build-logic:compileKotlin'.
> Failed to calculate the value of property 'jvmTarget'.
> Unknown Kotlin JVM target: 20
I need to use it on jitpack, so it won't work
add the paper repo
@harsh stone unspecified is the version of your project. I do not recommend messing with artifact names for a variety of reasons but how to do so for reobfjar is covered in the test plugin script
paperweight is only for 1.17.1+, also literally anything else is better than jitpack
none of them. Codemc illegally distributes minecraftserver.
So, what should i use
I mean
generally, outside of setting up your own private maven repo/CI server, you're fucked
if you have a credit/debit card, theres a few companies like oracle, AWS, etc, who offer always free tiers
otherwise, your only option is to rely on services like codemc, etc
Not ideal, but, they exist
Or use paperclip below 1.17 with the install option. Not efficient but works.
Okay, thx
you could have gradle run the paperclip install for you when on ci
if you use run-paper you could use it's stuff for resolving paperclips
sounds like the kotlin plugin doesnt know what to do with jdk 20 yet
check for snapshots or open issues, I guess
Quick maven question. So I'd like to be able to just set my plugin version in my maven pom.xml and have that number be used inside of the plugin. Is there some sorta placeholder I can use which maven would replace with the correct value on-compile?
I see ${project.version} used a lot. Is there a way to use this in my java code too?
my alternative was to just use a .env file and then call that from the code
basically, there are templating plugins for that stuff
okay gotcha, so something like this? https://www.mojohaus.org/templating-maven-plugin/
yup
Using property files and filtering them is a way nicer solution
I’ll def look into this!
So last night I was trying to compile and test a new feature. But I started getting a Compilation Error. That's basically it it didn't give me much information other then that.
https://pastebin.com/Y88zBCDq
I saw the part about re-running with the -e switch but I couldn't find where/how I would set that in InteliJ? Cause it's not like the terminal let's me run mvn commands. All the maven stuff is just UI for me
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I figured I'd ask, maybe the log has more useful information for someone more understanding of the build processes
I'm currently trying to recreate it on an older commit version
okay so the cause of this seems to be these two new Brigader commands I have added
when I have the class files included the entire thing fails to compile, but without it seems good. Let me verify...
okay! yeah it's just those two Brigader commands. Even tho there's no syntax errors, something is causing the compiler to totally eat shit. I think I should be able to debug from here actually
it was cause my dumbass had the @Plugin annotation above my commands. I have no clue why. Maybe cause of some moron on stack overflow lmao
You need to install maven then
?
what don't you understand about that lol
how is it not installed? ive literally been coding on this plugin for months
you're using intellij bundled maven
You need to navigate to the download side for a program called maven. This is in a browser which can search through the internet
you can use the maven stuff in the UI. But not in the terminal
I get the same thing when I try to use terminal commands
But yeah, IntelliJ comes with bundled maven for its tool windows. Always a good idea to have it installed on the side so you can run it via cli if needed
i restarted intelli and now it works
Or via the maven wrapper which for some reason isn’t anywhere near as popular as the gradle wrapper
I know this is velocity, but I'm strugglign to shade the Jedis dependency into my plugin-
[03:01:49 ERROR]: Exception in thread "main" com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: redis/clients/jedis/JedisPool
[03:01:49 ERROR]: at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049)
...
```https://paste.md-5.net/vuwozebike.cs
build script
Ask chatgpt
this fixed it ty
How I speed up maven build? Why takes too long like 7 seconds. The spigot with the shadow.jar takes like 3 seconds to build the aterfact
what maven build?
Package
no like on what project? what pom? what is it doing?
there are plenty things to speed up maven
but maven is inherently slower than for example gradle because of how gradle caches things
Oh, so gradle is faster. Good to know now
Is possible to skip the "The process cannot access the file because it is being used by another process" in gradle?
No, that's a windows thing
Use bukkits update folder to update the plugin
Gradle does have a runPaper plugin tho, that will allow you to compile and restart paper in one go without having to copy files
ok, thanks
name: SkillsLibrary2
version: ${version}
main: me.xemor.skillslibrary2.SkillsLibrary
api-version: 1.16
authors: [ Xemor_ ]
I have a plugin.yml like this and am using kotlin gradle for compilation, but it caches the plugin.yml even when the version number is incremented. Does anyone have any idea for preventing this?
send your build.gradle(.kts)
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
that's what it's like for maven, but that wasn't working, when I dropped the "project." it worked on gradle
It just only works once as it caches the plugin.yml in the build folder, if I delete this cache, it generates with the latest version
processResources {
filesMatching("plugin.yml") {
expand("version" to rootProject.version)
}
}
This is what we typically use
What's your gradle.properties file looking like?
Where's that?
If you don't have one then it won't be what I'm thinking. There's some args in there for caching and it can sometimes cause that.
yep, you don't have one
I tried replacing my code inside tasks.processResources with the body there and that didn't work (not that I was really expecting it to). has the same behaviour as before with not updating cache
just making sure, is the plugin.yml in /src/main/resources?
you could also just use https://github.com/Minecrell/plugin-yml, which is what I use for my plugins
So how does gradle shadowing work? Do I need to first update gradle to 8.0?
I think I have 7.x
oh nvm I have 8
yes update first, then add it to your build file
org.gradle.api.GradleException: This version of Shadow supports Gradle 8.0+ only. Please upgrade.
but
------------------------------------------------------------
Gradle 8.0
------------------------------------------------------------
Build time: 2023-02-13 19:02:29 UTC
Revision: <unknown>
Kotlin: 1.8.10
Groovy: 3.0.13
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.6 (Oracle Corporation 17.0.6+10)
OS: Linux 5.15.102-1-MANJARO amd64
./gradlew -v
try upgrading to 8.0.2
If that doesn't work try shadow 7.1.2, and reload the project and make sure it runs, and then update to the 8.x shadow version
try inputs.property("version", rootProject.version) in processResources
for @ember topaz
I just worked out my solution
outputs.upToDateWhen { false }
inside tasks.processResources
basically invalidates the cache every time
thats not a solution its a hack
and the proper hack would be doNotTrackState("can't figure out how to make it track inputs properly") not outputs.upToDateWhen { false }
but I think what I sent will work
appears to work
yeah, I usually do something like https://github.com/jpenilla/MiniMOTD/blob/master/platform/bukkit/build.gradle.kts#L28-L36
ahh
everything works, thank you
@near oar run gradle build from terminal to get the full error
likely wrong java version
Ok so I have noticed 1 thing now, the file size went up from 15KB to 4MB, is there a way to just filter the dependencies I need?
or is the dependency I have included, in this case mariadb Driver class that large?
I'm not exactly still sure what was packaged in that jar
jars are zips, you can open them up with 7zip and look
mariadb driver is pretty large last I checked though
just use implementation for things to include, and compileOnly for things you don't want to
and make sure to relocate
if you're shading sql drivers you might also need mergeServiceFiles() in the shadowJar configuration
Well it worked, even without mergeService you mentioned
I no longer have an issue with class not found exception that I had earlier
if you don't relocate it won't be needed
but you should relocate everything you shade
what do i have to do?
.
it's a module
message.txt by @near oar: https://pastes.dev/0AE2y9baSg
i just wanted to use NMS with a gradle setup
you need to read
- Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 16
set your toolchain and release to 17 like in the test plugin
message.txt by @near oar: https://pastes.dev/L9yPYQjv4G
plugins{
id("java-library")
id("io.papermc.paperweight.userdev") version "1.5.3"
}
java {
// Configure the java toolchain. This allows gradle to auto-provision JDK 17 on systems that only have JDK 8 installed for example.
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
dependencies {
paperweight.paperDevBundle("1.19.4-R0.1-SNAPSHOT")
}
@short walrus running the reobfJar task will put two jars in build/libs, use the one without -dev
Thanks. 🙂
if you're still having trouble send over your build files in a paste
Will do.
isn't it what you asked for?
i'm sorry i'm not used to Gradle so much
search for "release.set" in the build.gradle.kts
oooooooh thank youuuuuu
Having another issue where all of my external libraries such as the ones that Kotlin needs (using due to stuff such as data classes and string templates) and other external libraries such as Jackson aren't in the jar file.
build.gradle.kts: https://bin.bloom.host/zedoremica.gradle.kts
settings.gradle.kts: https://bin.bloom.host/enakovojaq.gradle.kts
Ah.
Seems like for some reason the Shadow plugin had apply false set for it.
yeah that would do it
would recommend updating gradle & your gradle plugins, especially paperweight
also you don't need to add paper api yourself, the dev bundle depends on it transitively
btw, you should set your kotlin jvmTarget to the same as your java target
then kotlin can take advantage of new bytecode magic
(which actually is a regression when writing gradle plugins
)
since it starts using invokedynamic instead of generated classes for lambdas and gradle can't serialize it anymore (like java lambdas)
you're probably pulling in kotlin reflect somewhere
it's massive
Probably.
why does gradle need to serialize everything 👀
My original project was using Maven before I moved over to Gradle with Kotlin.
up to date checking
ah right, i thought it was just task inputs/outputs
iirc there was an open issue for this, will probably be a compiler flag gradle sets for scripts eventually
(and plugin authors could use)
Hopefully this new file has the class not found errors fixed too. (It kept saying it couldn't find a Jackson module for Kotlin) :/
Never heard of that.
I would also tell you to relocate everything you shade but I know kotlin stuff likes to break especially kotlin-reflect
so might be an idea to use the PluginLoader api to download these from maven at runtime
it offers some benefits such as additional compile-time safety
Yeah, I've only recently started using Kotlin.
it is a noble journey
only thing is you can't use the commands in the yml with paper plugins, which isn't a problem for me since I use cloud and haven't touched the commands section of yml in ages, but might be an issue for you
I've made progress, It's just saying that some of my json files haven't been found. (because I forgot to create them)
Seems to be working now.
Thanks for all of your help. 👍
Yeah, All of the previous errors are now fixed, Now I've got to fix my JSON system but it's all working now other than that, Again, Thanks for your help. 🙂
even if the error are resolved I would still look into either relocating or using the library loader, could easily run into issues if other plugins shade the same thing without relocating
something recently has made applying the server patches on my macbook take WAY too long. It sits Creating Paper-Server from remapped source... for minutes before importing the vanilla/library files and applying the patches
haven't seen it on my m2 pro 
its not all the time either, like just ran it again, 30 seconds for the whole applyPatches task
no messages about locking?
no, am not seeing anything
thats the only thing I can think of, ij running another instance and it locks the dirs
I think its gotta be related to that, this is all in intellij
but the locking logic is meant to log when its waiting on a lock
yeah, I don't see anything about that
it'd just be in the intellij build window right?
the one that would log would be the one that's waiting
but yeah if the ij instance is waiting it should show up in the window, if not in the root log when you click the top thing
its happening again, I just switched branches, and ran applyPatches, breezed through the first bit, then stuck on the same thing
if you know what I mean with the weird interface
yeah, ik what you mean but there's nothing showing up
it seems to be only the first apply after having the patches change
one of the gradle flags should print some info about what its doing
maybe gradle is fingerprinting them or smth
Yeah, I think it’s reliable reproducible for me. Lemme try not running it via a run configuration but just in the IntelliJ terminal
IntelliJ doesn’t show that it’s doing anything, like the progress bar in the bottom right, but idk if that’s definitive
it's either --debug or --info
they dump a massive amount of info but might be able to find something in there
Wow, ok, running it via the terminal does not have the same issue

oh wait, it wouldn't be gradle snapshotting if you get that log message
the stuff after that log message is literally the calls to git
trying witout intellij running now
ok, so actually it has nothing to do with intellij
just in a regular console window its taking forever at the exact same step
set the debug property to get git output
the paperweight one?
well there's the importing of the vanilla files right?
those messages show up, "Imported 238 vanilla files" or whatever and "Imported 7 library files"
that further indicates its the git ops
unless your machine is hanging on reading a json file
its -Ppaperweight.debug=true right?
oh yeah -D
this is where its stuck
git -c commit.gpgsign=false -c core.safecrlf=false gc
is this maybe because I have like 90 branches checkout locally?
yeah, and then the next logged lines are the Imported msgs, and then it applies and is done
I guess when you switch branches to something different enough it has to gc a lot
lets try on a fresh clone of the repo I guess
rm -rf the server dir would probably have the same effect
it won't have much to gc in a fresh clone
I need to stop abusing stash then
I've got like 5 things stashed in server, api and root each
is that with apple git or normal git?
because I haven't seen this before
I guess I don't use stash that much in server
should be normal git, how would I check?
git -v
git -v just returns 2.40.0, I assume if its apples there'd be some other info?
yeah thats normal
yea apple one has apple or mac or something in the version string
and they arent on .40 yet
but yeah stashing stuff and then applying again probably does lead to more garbage
since it has to retain refs for the stashes
yeah, fresh clone and everything is fine.
could maybe add something to only gc once per day?
and then that system could also be used for your pruning PR
so we can have that automatic without nuking apply times every time
and obviously a prop or something to disable it
im trying to add paperweight to my plugin and im going off https://github.com/PaperMC/paperweight-test-plugin but when adding the plugins block in my settings.gradle.kts, i get this error: https://paste.md-5.net/ujudubeqis.txt
outdated gradle
and how to reobfuscate my plugin to make it work on normal spigot/paper jar (not mojmap version)?
plugins{
id 'io.papermc.paperweight.userdev' version '1.5.3'
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT")
paperweight.paperDevBundle("1.19.4-R0.1-SNAPSHOT")
}
shadowJar {
}
run the reobfJar task I think it was
/* reobfJar { // This is an example of how you might change the output location for reobfJar. It's recommended not to do this // for a variety of reasons, however it's asked frequently enough that an example of how to do it is included here. outputJar.set(layout.buildDirectory.file("libs/PaperweightTestPlugin-${project.version}.jar")) } */
so the comment on paperweigth-plugin
i see also
assemble { dependsOn(reobfJar) }
where should i put the reobf in a multiple NMS project with modules?
how does it catch the version to use for reobfuscation?
I mean, you can only have a singular nms version in a project, you can't define multiple different versions of a dependency
what you generally do is have multiple submodules, and then use the reobf configuration from them
theres probably a few examples out there that exist, idk of any simple ones off the top of my head and too tired to go over it from top to bottom
I think worldedit uses multiple NMS modules
That's not exactly simple, but it's a starting point at least
WE uses a somewhat more complex build setup, so not sure they're a good reference
I'm having an issue with building a fork (again!).
For some reason the entire API project is missing from the paperclip or bundler jars. All patches are applied cleanly and the project builds fine, though suspiciously quick. My first build showed a large number of errors due to missing API, but still succeeded (???). Now when doing a clean build it doesn't even do that anymore, it just builds fine.
I checked the build files and they look fine, with the -server project depending on -api. I didn't make any changes to them. The fork is on Github here: https://github.com/DRE2N/Papyrus
I'm really confused whats going on
when you look in the bundler jar, you are looking in the libraries folder right?
yes, no bukkit there.
It also doesn't start (can't find craftbukkit.main) and is way too small
no gradlewrapper
I'm also pretty sure it shouldn't build, I haven't finished fixing up the patches
Does it need the wrapper?
well, no; but I'm not going to try to test locally if I gotta mess around
nothing stands out from a quick glance as being wrong
Wrapper should be there now
mystery solved: the toolchain was set to failOnError = false for some reason, thats why the build "succeeded" even though the API didn't compile. Everything works now
so there isn't any good reference
i'll hit the wall harder with my head
i got it!
i only need
implementation project(path: ':NMS1_19_4', configuration: 'reobf')
on the build.gradle where i need NMS1_19_4
is dev bundle available only for 1.17+?
yes
thanks guys. finally i can do a multi-NMS project without complications of any sort
paperweight is COOL
would you like to make a github gradle project template with multiple NMS versions?
we can even do a 1.13 to 1.19.4 plugin template
that wouldn't fall under paperweight
1.17 to 1.19.4 with paperweight
you're right
ok then from 1.17 to 1.19.4
who has the power to add a branch in paperweight-test-plugin?
core & maintainers i believe
jmp
Hi, how can I compile multimodule project (1.17, 1.18 and 1.19 nms are in separate modules) with java 16, while minecraft 1.19 requires java 17?
You can set different Java versions for each module with gradle
The same way you set the Java version for other things
how? I use intellij module settings to set java version
and I can't set different java version for specific module
Are you using gradle or maven at all?
i'm using gradle
Cause IntelliJ module settings isn’t how you set the version gradle/maven use to compile the project
so how can I do it
so now, I need to set toolchain.languageVersion.set(JavaLanguageVersion.of(16)) in all modules except 1.19 (where I need to set toolchain.languageVersion.set(JavaLanguageVersion.of(17)))?
You could also set https://github.com/PaperMC/paperweight-test-plugin/blob/master/build.gradle.kts#L35 instead
If you wanted to always compile with 17, but output bytecode for 16
Depending on how your project is setup, that would be one way. You could also do it just once in your root build.gradle skipping over sub projects that are 17
Then use IntelliJ module settings to s t the language version for each module, so IntelliJ warns you when you use a feature that is only available in a newer version
okay, I'll try it
thanks
Unfortunately, I have an error:
No matching variant of io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT:20230312.180621-141 was found. The consumer was configured to find a library for use during compile-time, compatible with Java 16, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
what does it say after the but
message.txt by @sharp trellis: https://pastes.dev/O5jEq3Erya
1.19 requires 17
I know, see messages above
send your build.gradle's
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
try setting release to 17
also the error & build file don't match
error says 1.19.3 build i 1.19.4
Hello, i recently updated one of my plugins from gradle 7.6 to gradle 8, which works perfectly fine except for building on jitpack.io.
It's like it's failing to find the java version for the paperweight part.
Here is the error: https://pastebin.com/UiXWs8m4
Here is the project location where it points the issue: https://github.com/Chronoken/MagicSpells/blob/main/nms/v1_19_R1/build.gradle
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
No matching toolchains found for requested specification
your erm, build environment doesn't have a jdk that supports java 17
So i have to manually set it?
You can tell gradle to automatically pull a JDK
Because from what i see jitpack gets java 8
I think that was what the foojay conventions plugin is for
0m4.142s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~16.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
Getting tasks: ./gradlew tasks --all
Tasks:
Pointed jitpack at jdk 17 and everything works fine 🙂
Still not building
Not really much to go on
it's saying that the plugin infofile is apparently empty? maybemake sure that you don't have the filedangling on the disk, and mae sure that the annotation processor is running?
if you're using kotlin you need to use kapt
they're using maven
@grand sorrel did you get it working?
what I meant by not randomly changing stuff is things like in that snippet you sent, in general you only need to change enough so the syntax is valid groovy
the repo is added by the plugin, and the dependency is the same
no i havent got it working yet, im about to go for 30min and then ill ask here if im still having issue
if i want NMS support, should I only be setting up paperweight-userdev? by adding to plugins id "io.papermc.paperweight.userdev" version "1.5.3" & to dependencies paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:1.19.4-R0.1-SNAPSHOT")
i got NMS working but im struggling w a library (unnamed's hephaestus engine), they have a test plugin (https://github.com/unnamed/hephaestus-test-plugin/blob/dadd2ce888d0ef05f73fa5e65e03cbb39d08a95d/src/main/java/team/unnamed/hephaestus/plugin/CustomModelEntity.java) but copying things gives me problems with NMS, I know this should be in their discord not here but was just wondering if someone here has any ideas what the problem is / how to fix. Other than the override registerGoals says that it is not overriding anything either. Is there a different implementation of net.minecraft.world.entity.EntityInsentient? Not entirely sure what the problem is tbh
anyone can tell me why this build script isn't building a jar with everything?
im only getting the META-INF folder
go to common/build/libs
what
it has the 2 jars from the shadow
common is a standalone piece of code which is shared across 2 other modules
- You are using an outdated version of shadow, the latest is 8.1.1
- the
dependencies {}block is unrelated to the shadow configuration, and instead should go at the top level in your buildscript
next, you should be using the shadowJar task, build may work but shadowJar will definitely produce the correct result
and then iirc the jar ends with -all.jar
and to continue point 2: you dont need a special shadow configuration at all in this case
https://nms.screamingsandals.org/1.19.4/ you need to translate it to mojang mappings
and if you're depending on their code and not just copying it into your project, you'll also need to depend on their mojang mapped artifact
buildtools is a spigot tool
userdev is our supported way of using server internals, you're already using gradle, might as well switch to it and remove the buildtools step
like how should i set it up
i applied to the following
Are you running the shadowJar task?
I dont think “build.finalizedBy(shadowJar)” is correct. You probably want tasks.assemble{ dependsOn(shadowJar) }
you probably also only want shadow on the root project shading the others
or maybe not
multiplatform jars are just cursed
you probably don't want it on common at least
Context: My code has Mojang NMS and in order to remap it into obfuscated NMS I am using the paperweight project which was built for paperspigot.
Question: Is it possible to rename the output of paperweight reobf jar? The jar output format is project.name + "-" + project.version + ".jar". But I dont want the project version to be included in the jar output. Any solutions? Basically I'm looking for a paperweight equivalent of shadowJar's "archiveFileName" option.
(Please feel free to ping me if you know the answer)
read the comments in the test plugin build script
@quartz wharf
Already did, found nothing useful
oh
in the comments
its commented out
I see it
thx a bunch
Hey, another question:
Is there anyway to configure the maven-publish plugin to publish the output of paperweight instead of the output of shadowJar?
I have some weird bug, I'm using gradle with KTS, and it seemingly breaks the communication of the version to my plugin.yml.
My plugin.yml is simply
name: StormTesting
author: Stormsly
version: "${version}"
main: me.stormsly.stormtesting.StormTesting
api-version: 1.19
depend: [ProtocolLib]
And in my build.gradle.kts
group = "me.stormsly"
version = "1.0.0-SNAPSHOT"
description = "Stormsly's Testing Plugin."
However when starting my server.
My whole build.gradle.kts is essentially the same as the example paper weight plugin, I'm trying to experiment and test out NMS for the first time.
you need to use the replace resources thing
Please send the file
has an example i believe
You want me to send my whole build.gradle.kts?
yes
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
Okay one second.
im not using the plugin they used to auto build the plugin.yml mainly because I had issues with it outright not functioning.
and i prefer doing it myself
Yea you'll have to expand the values you want template in your plugin.yml using https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html#org.gradle.language.jvm.tasks.ProcessResources:expand(java.util.Map)
You can either construct your own map or just pass project.properties
Latter would have the effect of the version being keyed with project.version
Im lost
I'm on my phone sadly maybe someone can spoon-feed real quick
You just call expand in the process resources task configuration block
filesMatching("**/plugin.yml") {
expand(project.properties)
}
i wasnt asking for a spoon-feed, i was asking for an elaboration
Oh
would that be correct usage?
Looks promising yea
ill update you then
Make sure to update the plugin yml to
.
gotcha
nope
[StormTesting] Loading server plugin StormTesting v${project.version}
is it because I have it inside a string? in my plugin.yml
should it just be
version: ${project.version}
okay that worked lol
thank you lynx
(i apologise if this is the incorrect channel) anyone know if theres any known collision between paperweight and shadowJar? this is my current build.gradle ```gradle
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'io.papermc.paperweight.userdev' version '1.5.4'
}
build.dependsOn(shadowJar)
assemble.dependsOn(reobfJar)
jar.enabled = false
group 'com.ankoki'
version '1.0-DEVELOPMENT'
repositories {
mavenCentral()
maven { url 'https://hat.lordoftherin.gs/releases/' }
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'
compileOnly 'org.jetbrains:annotations:24.0.1'
implementation 'com.ankoki:Roku:1.0-dev'
paperweight.paperDevBundle '1.19.4-R0.1-SNAPSHOT'
}
shadowJar {
relocate 'com.ankoki.roku', 'com.ankoki.sunriseslaughter.libs.roku'
archiveName 'Sunrise-Slaughter.jar'
}``` yet however whenever i build it, it doesnt remap the classes, throwing a ClassNotFoundException with net.minecraft.server.level.ServerPlayer, but my other project is just fine without shadowJar, this didnt happen until i updated to 1.19.4
ive also tested removing my assemble.dependsOn to no avail
pls ping me if you have any idea ^^
you should only really need the assemble.dependsOn(reobfJar), paperweight automatically picks up on shadow if it's present iirc
also probably an obvious question, but make sure you're using the jar without the -dev classifier
if that doesn't work then I don't know, someone else might though
yeah i am using the jar without the -dev, quite confused because it works on other projects haha
How can i make a fork of paper like folia with automated Updates of Paper it self
You can't really automate upstrem updates
How does Folia ?
Folia doesn't do automated updates of paper
That means. Spotted or someone else update it self
Just like we manually update spigot changes
I think airplane has a neat script for paperweight forks
Where is airplane ?
I thinked already about to make a gradle task to automate this
✈️ <- airplane
Pufferfish has that script too. Not sure if the airplane repo still exists
the script in question btw
Right that's what I meant
Doesn't Gradle has a way to dump them per task?
Paperweight doesn't use the paper API?
Do you mean the dev bundle? That's just normal Gradle dependency resolution
It's not using the paper API
It's just a maven dependency
I still don't get the XY, is something too slow?
That seems wonky
I have never used user dev but those things should be cached
Like the vanilla jar didnt change
Open an issue about that I guess, i looked at the code and stuff looks much different since I last touched paperweight
Don't mention paper API tho
"vanilla jar cache seems to expire after a few days" or something
No, this is all before the dev bundle
Shouldn't be, it should never redownload the vanilla jar
But am also confused why those aren't tasks, idk
Jmp needs to take a look, I assume am stupid
Well, duh
Lol
What is the output when it's doing more than you think it should be doing?
Things are cached
But it's just a standard maven dependency
Idk how often gradle will cache by default
🤷♂️
No idea how that stuff works, tbqh
all I know is that it's just a standard maven dependency and so pw isn't really the thing in control here for that aspect
configurations.paperweightDevelopmentBundle {
resolutionStrategy.cacheChangingModulesFor(3, "days")
}
Hi, I'm developing a plugin using gradle and paperweight. How can I use mojang mappings in reflection? Paperweight doesnt seem to convert these strings when building. I've read all the forum posts I could find and somebody mentioned that I should use yarn parameter mappings but I could not find more information on what these are and how to use them. Do I need to configure something?
https://github.com/jpenilla/reflection-remapper
reflection-remapper is a library to simplify making reflective calls, with specific support for remapped environments. Getting reflection-remapper. There are ...
not necessarily related directly to paper but I don't know where else to ask short of SO: I'm using kotlin multiplatform and am looking for a configuration similar to compileOnlyApi that comes with the java-library plugin - something like jvmMainCompileOnlyApi. I've tried using compileOnlyApi but that doesn't seem to be declaring the kotlin jvm transitive dependency correctly when I import my KMP library
how do i fix this error when setting up a paperweight plugin project?
Caused by: paper.libs.dev.denwav.hypo.core.HypoException: Unable to resolve class data binding for 'jdk/jfr/Event' which is listed as the super class for 'net/minecraft/util/profiling/jfr/event/WorldLoadFinishedEvent'
at paper.libs.dev.denwav.hypo.asm.AsmClassData.computeSuperClass(AsmClassData.java:165)
at paper.libs.dev.denwav.hypo.model.data.LazyValue.getOrThrow(LazyValue.java:121)
at paper.libs.dev.denwav.hypo.model.data.LazyClassData.superClass(LazyClassData.java:168)
at paper.libs.dev.denwav.hypo.hydrate.DefaultClassDataHydrator.hydrate(DefaultClassDataHydrator.java:59)
at paper.libs.dev.denwav.hypo.hydrate.DefaultHydrationManager.hydrate(DefaultHydrationManager.java:91)
at io.papermc.paperweight.tasks.GenerateMappings$GenerateMappingsAction.execute(GenerateMappings.kt:172)
java version:
openjdk 17.0.6 2023-01-17
IBM Semeru Runtime Open Edition 17.0.6.0 (build 17.0.6+10)
Eclipse OpenJ9 VM 17.0.6.0 (build openj9-0.36.0, JRE 17 Windows 11 amd64-64-Bit Compressed References 20230117_367 (JIT enabled, AOT enabled)
OpenJ9 - e68fb241f
OMR - f491bbf6f
JCL - 927b34f84c8 based on jdk-17.0.6+10)
can't use openj9. doesn't implement jfr
Ever since updating intellij to 2023.1 it's looking for a java sdk on my windows drive and not wsl2
https://i.imgur.com/AbkkrIW.png
happening on all projects
Probably a setting somewhere
well where then
because it's also happening when its looking for gradle provided jdks
I assume there
this is gradle not maven
look at my screenshots
