#build-tooling-help
1 messages · Page 14 of 1
for example in squaremap if I don't use build-logic in the root build script, it starts throwing similar errors for vanillagradle
apply an empty plugin, and it works
gradle's classloader hierarchy system can be finicky at times
makes sense
Tysm!
yw
why this code didn't work?
<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>
<!-- Project coordinates -->
<groupId>com.labib9x</groupId>
<artifactId>DonutSpawn</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<!-- Project name and description -->
<name>DonutSpawn</name>
<description>A Minecraft plugin for teleportation with customization options</description>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<paper.version>1.20.4-R0.1-SNAPSHOT</paper.version>
</properties>
<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>${paper.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
error?
heres
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< mygroupid:myartifactid >-----------------------
[INFO] Building myartifactid 0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ myartifactid ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myartifactid ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 5 source files to /home/runner/DonutSpawn-Plugin/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Source option 5 is no longer supported. Use 7 or later.
[ERROR] Target option 5 is no longer supported. Use 7 or later.
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.545 s
[INFO] Finished at: 2024-08-19T11:28:51Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project myartifactid: Compilation failure: Compilation failure:
[ERROR] Source option 5 is no longer supported. Use 7 or later.
[ERROR] Target option 5 is no longer supported. Use 7 or later.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException```
well in my repl its the one for some reason
i do run mvn clean first then i run mvn package
make sure that you saved the file
replit saves the file auto when i put text on it
what if you hardcode the version just for now
wdym
instead of referncing the compiler version just hardcode 17 in
<configuration>
<source>17</source>
<target>17</target>
</configuration>
Building myartifactid 0.0-SNAPSHOT
either you're tryna obfuscate info for some reason, or, you have a different pom in the folder you're trying to build
make sure that the pom is in the top folder of the project, where the src folder is
not in replit. replit have a another section below the src section called packager files
this is what you mean?
<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>
<!-- Project coordinates -->
<groupId>com.labib9x</groupId>
<artifactId>DonutSpawn</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<!-- Project name and description -->
<name>DonutSpawn</name>
<description>A Minecraft plugin for teleportation with customization options</description>
<properties>
<paper.version>1.20.4-R0.1-SNAPSHOT</paper.version>
</properties>
<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>${paper.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
yea, idk how the thing lays out files, but, that is is cleraly not the pom that is being ran
this is how it looks
in the left side it have files
and it have pom in saprate section
no, this is your IDE's listing, I am asking about your computer's locations
don't rely on IDEs so much
they hide so much, sometimes too much making problems
well i am making it online
do you have no way to access a terminal of your directory
yeah ido
cd to src and ls
heres the output
find . -iname 'pom.xml'
└───maven-project
├───pom.xml
├───README.txt
├───NOTICE.txt
├───LICENSE.txt
└───src
├───main
│ ├───java
│ ├───resources
│ ├───filters
│ └───webapp
├───test
│ ├───java
│ ├───resources
│ └───filters
├───it
├───site
└───assembly
this is how it should look like
go one up and ls again
cat's solution is even better
you may have a pom somewhere that overrides the one you're working on
okay i'll move to the intelij and then work on it this sucks
okay, how the heck do you link external documentation for javadocs
I've been googling for half an hour but its all groovy and doesn't work with Kotlin DSL
what
like, publishing your javadocs elsewhere?
I've figured it out with
tasks.javadoc {
(options as StandardJavadocDocletOptions).links("https://jd.papermc.io/paper/1.21.1/", "https://jd.advntr.dev/api/4.17.0/")
}
essentialy what I wanted was that instead of it saying org.bukkit.Player it would be Player with a hyperlink to paper docs
basically what paper docs have with Kyori
ah yeah, I did the same for my local javadocs and joml
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm'
id 'com.gradleup.shadow' version '8.3.0'
id("io.papermc.paperweight.userdev") version "1.7.2"
}
group = 'dev.lrdcxdes'
version = '1.0'
repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT")
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation 'com.zaxxer:HikariCP:4.0.3'
implementation "net.kyori:adventure-api:4.17.0"
paperweight.paperDevBundle("1.21.1-R0.1-SNAPSHOT")
}
def targetJavaVersion = 21
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release.set(targetJavaVersion)
}
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('paper-plugin.yml') {
expand props
}
}
kotlin {
jvmToolchain(21)
}
shadowJar {
tasks.assemble {
dependsOn(tasks.reobfJar)
}
archiveBaseName.set("project9")
}
oh you are using groovy. The syntax is different I think
or maybe it isn't anymore... whats the error you get when you load the project?
no error
only highlight
did you refresh gradle in intellij?
yes
Cannot resolve resource filtering of MatchingCopyAction. IDEA may fail to build project. Consider using delegated build (enabled by default).
maybe this warning?
no, that isn't it
try to build your plugin, if it doesn't error, its just intellij being dum
> Task :checkKotlinGradlePluginConfigurationErrors SKIPPED
Enchantments.kt:9:54 Unresolved reference 'Holder'.
well try to go import Holder then, see if that works and the highlight is just intellij not being up-to-date or smth
when I create a Gradle plugin and from the plugin register a task on the project, said task is also executed during apply or publish
how can I avoid that?
When trying to enable the test plugin as per https://github.com/PaperMC/Paper/blob/master/CONTRIBUTING.md#using-the-paper-test-plugin, I get an error Task 'wrapper' not found in project ':test-plugin'.
Any ideas on what's going wrong here?
Is it a sub project?
I had that earlier with another project with multiple modules and the issue was that IntelliJ (or gradle) did not recognise that module as a submodule
I apparently completely broke something beforehand, upon deleting and re-cloning the repo everything worked fine.
sounds like a somewhat common Gradle problem 😅
really that's more intellij's thing but yeah
I love when projects get randomly bricked until I delete .idea
hey does someone know why this isn't working?
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(File("C:/Users/User/Desktop/server/plugins/PaperweightTestPlugin.jar"))
}
define not working
you probably aren't running the task or windows file locking is stopping you
(the later being one of the many reasons there is that note about not doing this)
it wont even copy to my desktop
am i missing something?
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(File("C:/Users/User/Desktop/PaperweightTestPlugin.jar"))
}
with paperweight.paperDevBundle(...) how can I include MOJANG_PRODUCTION stuff because I want to do some stuff with mojang crap
as mentioned in #paper-dev see the docs or the test plugin
it sounds like you might be confused about what it does though, your code will be mojang mapped regardless of the production target
that just changes the wiring for reobfJar
probably a bit behind but uhm
beyond what I already said, I'd advise removing lines 23-25 of that paste
you should see what all the artifacts are named in their default configuration before changing names to ensure there isn't overlap
but in general leaving the defaults is more conducive to collaboration
I mean all 23-25 does is renaming the base file
bump
why would you want it to copy the jar file to desktop?
use a copy task
What's the ecommended gradle version to use in Paper 1.21?
The wrapper in our repo
Just use the respective scripts in the repo (gradlew or gradlew.bat)
I'm making a project with a separate module for each plugin, im creating it through IntelliJ and wanted to make sure I am on the correct version
as example
Damn, IntelliJ by default uses 8.5
then use https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Copy.html to copy the final jar
I've seen projects such as the Architectury gradle plugin (for minecraft modding) implementing custom icons for each module of a project, how does one go about implementing those?
I know it's not necessary at all, but it'd be neat to have a custom icon for each module to represent each plugin
why would you do that
I know it's unnecessary, just like the idea of making them visually dinstinct
just make a gradle plugin which sets conventions and then depend on that plugin instead
I mean, that's what one would call a monorepo
I am usually working on multiple plugins at once within my network, as I am only on one monitor it's easier if I can have everything under the same project
the only real benefit of it is that since the whole code is in a single repository, it is easier to link stuff together, jump to definitions and what not
to each their own I guess
can you show a screenshot of this?
See, they somehow implemented custom icons like such
thats part of the minecraft dev intellij plugin
are you sure that isn't just the minecraft development plugin-
Right rip
Too bad
Another question - is there a way to mark a directory as a module?
you define it in the include on the parent and have it include a gradle build file
Ahh alright got it
Does it make sense to define all the versions of my modules (the plugins) inside of my libs.version.toml?
the function:
void addRepositories(Project project) {...}
if called inside of allprojects, will be called for each module in my IntelliJ project right?
If that is the case, should the following work?
void addPlugins(Project project) {
// Add common plugins to the project
project.pluginManager.apply(alias(libs.plugins.java.library))
project.pluginManager.apply(alias(libs.plugins.maven.publish))
}```
If called inside of allprojects
This is to avoid having repetition in each module's build.gradle
hey! I am getting this error after adding
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.bivashy.NanoLimboPlugin</groupId>
<artifactId>api</artifactId>
<version>1.0.6</version>
</dependency>
</dependencies>```
here is my full pom.xml
XPdjP2H.txt by @drowsy spire: https://pastes.dev/KumezSz1o3
Is it possible to add publishings in the subprojects block in my project build.gradle?
To be applied to all modules in my IntelliJ project?
message.txt by @inland furnace: https://pastes.dev/cgojtADxRa
?
Someone ever had this error PermittedSubclasses requires ASM9?
I was trying to change a plugin from 1.20.4 to 1.21.1 and using java 21
Anyone know why the build may be failing? I'm literally cloning the oraxen repo and trying to build it and it fails. I didn't edit anything. I checked the logs it's talking about in the error msg and there are 3 patch failures. All relating to worldborder.
[DEBUG] Patching: net/minecraft/server/commands/WorldBorderCommand.java
[DEBUG] Hunk 0: EXACT: @@ -4,11 +4,12 @@
[WARN] Hunk 1: FAILURE: @@ -16,128 +17,138 @@
[DEBUG] Patching: net/minecraft/world/level/border/WorldBorder.java
[DEBUG] Hunk 0: EXACT: @@ -2,6 +2,7 @@
[WARN] Hunk 1: FAILURE: @@ -15,6 +16,7 @@
[WARN] Hunk 2: FAILURE: @@ -27,13 +29,28 @@
[DEBUG] Hunk 3: EXACT: @@ -61,18 +78,20 @@
[DEBUG] Hunk 4: EXACT: @@ -104,12 +123,19 @@
Patch Summary:
Un-changed files: 2481
Added files: 0
Changed files: 674
Removed files: 0
Missing files: 0
Failed matches: 3
Exact matches: 4453
Access matches: 0
Offset matches: 0
Fuzzy matches: 0
Overall Quality 99.93%```
Anyone got any idea?
Oraxen Dev said this: "Sorry but no clue here. Builds just fine locally. It is just using paper userdev and u dont need patches or any such thing"
generally down to wrong java version
And I would fix that by changing the project sdk to java21 right? (Oraxen requires java21)
yes
Because I've done that.
did you change it in the gradle settings too?
Where would I do that
Settings -> Build & Deployment -> Gradle
Like this?
yeah
It was already like that
no
you should update paperweight to 1.7.2
and set the java version
no manual cache clear is needed
but also, this channel is for help with your build, not with building paid-support plugins
oh, Oraxen is that kind of plugin, my bad
I mean it is still open-source. And I was originally trying to build someone’s pull-request on the plugin
Plus the dev of that plugin didn’t offer much help on the issue
How do I update paperweight?
I'm sure they will help you if you bought the plugin.
This is for helping with building your own project, not for help with getting premium plugins
They know I bought the plugin
What’s the difference at the end of the day whether it’s a premium public project or your own one?
Like this place is for building advice
contributing to a project can also fall under that umbrella, the key part is you are actually working on a build and not just using us as build support for someone else's project
we get plenty of people who try and do the later, especially with those types of plugins
I'm trying to test out a PR on that repo
it's more of a solidarity between fellow devs more than anything. As community members we respect the fact that they are offering their support as a service and not interfering with that, given they also respected the fact that the community values plugins to be open source over the potential financial gain that'd be incurred by not doing so
hey how do i add a depenency jar that's not a javaplugin to my plugin?
in a paperweight plugin
ideally, you source it from a maven repo
otherwise you can use file() instead of a maven coord iirc
you would need to setup the shade plugin
pls
ok it got fixed
why am I getting this error? https://pastes.dev/pL5iqWq0jB
i mean it builds without errors
hit the refresh button in IJ? 
i have
intellij is probably using an old jdk
maybe i did somthing wrong
bukkitPluginYaml {
main = "io.papermc.paperweight.testplugin.TestPlugin"
load = BukkitPluginYaml.PluginLoadOrder.STARTUP
authors.add("Author")
apiVersion = "1.21"
libraries.add("de.fabmax:physx-jni:2.4.1")
libraries.add("de.fabmax:physx-jni:2.4.1:natives-windows")
}
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact de.fabmax:physx-jni:2.4.1:natives-windows in central
are you sure that is in maven central?
wait, is that even a valid notation
`
The library is published on maven central, so you can easily add this to your dependencies:
Desktop Java
dependencies {
// java bindings
implementation("de.fabmax:physx-jni:2.4.1")
// native libraries - you can add the one matching your system or all
runtimeOnly("de.fabmax:physx-jni:2.4.1:natives-windows")
runtimeOnly("de.fabmax:physx-jni:2.4.1:natives-linux")
runtimeOnly("de.fabmax:physx-jni:2.4.1:natives-macos")
runtimeOnly("de.fabmax:physx-jni:2.4.1:natives-macos-arm64")
}
`
it is a typo
version should be 2.4.1-natives-windows
same for the rest
maybe gradle lets you write it like that, doubt it though
it is an extension, the more you know
it is a gradle thing apparently, not sure if whatever library Spigot is using to fetch the libs support that
hmmm what can i do?
you could use Paper's loader instead
what's that?
from DefaultArtifact: expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
@cinder ember
wait that what did i do wrong?
ah, so you should write de.fabmax:physx-jni:natives-windows:2.4.1 instead
I don't think that will work
de.fabmax:physx-jni:jar:natives-windows:2.4.1 most likely
only on the plugin/yml?
natives are usually only needed at runtime
so, if the yml is determining your runtime, rather than gradle, you only need to declare it in the yml
changing only bukkitPluginYaml { main = "io.papermc.paperweight.testplugin.TestPlugin" load = BukkitPluginYaml.PluginLoadOrder.STARTUP authors.add("Author") apiVersion = "1.21" libraries.add("de.fabmax:physx-jni:2.4.1") libraries.add("de.fabmax:physx-jni🫙natives-windows:2.4.1") }
gives no error
so it works then?
I'd still go for the loader option since you could dynamically choose which one to download and use depending on a config option or the environment itself
yeah maybe i figure that out later
I prefer gradle as the source of truth and so I use a custom plugin for that along with the paper loader system
i just wanted it to work
(you could do the dynamic selection thing by creating multiple dependency sets, btw)
why does paper's runServer task (and seemingly my whole IDE) ignore the project defined JDK and opt for a pre installed one that IDEA downloaded instead
its stopping me from using hotswap 
the runServer task uses the best pre-defined JDK for debugging
the jetbrains runtime itself
it should just be for the various "run" tasks
alright, can I change that? it would appear that was a recent change
as it used to work
ie why not use the project defined jdk?
because the jetbrains runtime is better for debugging/hotswapping. And that is what the run tasks are for
you can change it by looking at the task definitions in the paper-server build.gradle.kts file if you want, but if you want hotswapping, jbr should be what you want
thats what im using
but it is defaulting to correto
im using jbr with a hotswap agent in there because it wouldnt work wihtout it
trying to use*
ah i think i got it
i changed the gradle jvm
also, what is EnhancedClassRedefinition (the flag) supposed to add? I still cant add methods or anything of that nature with the flag enabled
if you want to do that then you have to add the flag -XX:+AllowRedefinitionToAddDeleteMethods
though that one is deprecated, I'd look in the way of HotswapAgent
I'm using paper patcher, however when I try to publishAllPublications, I get this error
Execution failed for task ':generateDevelopmentBundle'.
> java.io.IOException: Cannot run program "diff": CreateProcess error=2, The system cannot find the file specified
any idea how to fix it please?
Cannot run program "diff": CreateProcess error=2, The system cannot find the file specified
you need the diff command
Should I download cygwin? (https://www.cygwin.com/)
We don't really support windows
but, the expectation is that you have gnu diff in the path
not really sure cygwin is the recommended way for that sorta stuff these days
gradlew.bat, isnt that the ini script? would it not be just gradlew applyPatches?
How can I use mojang mappings in my plugins? I'm not using gradle I'm using maven
ask the person who made the maven plugin you are using for nms
😦
All tooling works on windows tho
I maybe found a way to add normal diff command, I'll look on it
Make sure it's a recent one, there is also a port that misses some options we use
I'm not using nms though
for what do you want to use mappings for then?
Yeah but what happenes if you're not using mojang mappings but your telling the server that you are?
if you use nms it’ll throw errors
yeah but since you don't use nms you don't have to worry about that
Thanks, if there is a plugin using nms though would you have to stick with spigot mappings?
i mean its up to you. if you use spigot mappings you (might) keep spigot compatibility
paper will remap it for you
if you use mojang mappings for nms paper doesn't have to remap it for you but you don't have spigot compat
powercas mentioned that it'll throw errors though
Just trying to wrap my head around the best practises for this mapping stuff
well yeah if you use spigot mappings but you tell the server you use mojang mappings it won't try to remap your plugin
and it will throw errors cause you are trying to find classes that don't exist
But how do you use mojang mappings in the first place? Do you just tell the server I'm using mojang mappings? I would of thought there was more to it
well if you use our paperweight userdev plugin
I don't use gradle
there is an unofficial maven one iirc
Can you link me
Thanks, I should probably find a way to move to gradle since paper doesn't seem to care about maven all that much
yeah all of papers tooling is written in gradle since that is just more modern and allows us to do stuff more easily
just a quick example since i am not sure if you understood mappings properly: lets say your plugin uses nms and has something like
EntityPlayer player = ((CraftPlayer) bukkitPlayer).getHandle();
EntityPlayer is the spigot mapping name for the nms player class. now if you tried to load that on a mojang mapped server it will error cause it cant find that EntityPlayer class (cause with mojang mapping that class is called ServerPlayer). paper will automatically remap that so that your plugin now does this:
ServerPlayer player = ((CraftPlayer) bukkitPlayer).getHandle();
take a look at https://mappings.dev/ if you want to see more examples
not exposed via the API
Apologies. Asked in #paper-dev.
👍
Thanks tho
Anyone can help me with this? Im using Java 21
https://paste.gg/p/anonymous/318d088af33e43369c91e385cb0c1c77 Gradle config
https://paste.gg/p/anonymous/4e2731a8414e42e08617189f80fdde85 Error
did you see the log
update paperweight and set the toolchain like in the test plugin
otherwise sort out why your java home isn't 21
FAILURE: Build failed with an exception.
- What went wrong:
A problem occurred configuring project ':v1_21'.
Cannot set the value of property 'downloadService' of type io.papermc.paperweight.DownloadService using a provider of type io.papermc.paperweight.DownloadService.
- 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.
CONFIGURE FAILED in 3s
Now i have this error, updating userdev to lastet.
Yo, I'm using paperweight for 1.21.1. I was reading https://github.com/PaperMC/paperweight-test-plugin/blob/master/build.gradle.kts to get an example.
This is my build.gradle.kts file:
plugins {
id("io.papermc.paperweight.userdev") version "1.7.2"
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
dependencies {
api(project(":tracking-api"))
paperweight.paperDevBundle("1.21.1-R0.1-SNAPSHOT")
}
paperweight.reobfArtifactConfiguration.set(io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION) // I don't care about supporting spigot
Then I'm compiling this with gradlew build but I'm getting this error:
Caused by: java.lang.NoClassDefFoundError: net/minecraft/server/level/ChunkTracker$TrackedEntity
While initializing this class:
class ViewableTracker extends ChunkMap.TrackedEntity {
// some stuff
}
After using a decompiler to check if it's a reobf issue I got this:
import net.minecraft.server.level.ChunkMap.TrackedEntity;
class ViewableTracker extends TrackedEntity {
// some stuff
}
So, I don't know what is happening. Can anyone help me?
I just saw plugins/.paper-remapped, there's a remapped version of my plugin. Decompiling that jar:
import net.minecraft.server.level.ChunkTracker.TrackedEntity;
class ViewableTracker extends TrackedEntity {
// some stuff
}
I think it's a paper error 
hey, general Gradle question, how would I go about including two text files from the root of the project in the final file? in Maven it was easy
<resources>
<resource>
<directory>.</directory>
<includes>
<include>LICENSE</include>
<include>NOTICE.md</include>
</includes>
</resource>
</resources>
but in Gradle
jar {
from(".").include("LICENSE", "NOTICE.md")
}
doing this makes everything else in the JAR disappear
jar {
from("LICENSE")
from("NOTICE.md")
}
For the new minor version of 1.12.1 to update paperweight-examples all I need to do is just change the values in gradle.properties right
I can't see anything in this new release that requires me to do anything else but I wanted to be sure
Can anyone help me?
did you make sure it’s the right mapping
I explained the whole stuff 
What do you mean with "right mapping"
paperweight.reobfArtifactConfiguration.set(io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION) // I don't care about supporting spigot
I set that paperweight's config
how are you building it
Then I'm compiling this with
gradlew buildbut I'm getting this error:
Can you read this messages?
I think it will be more helpful
try deleting the file in the .paper-remapped folder, you set the mojang mappings flag so that file shouldn't be getting created in the first place
set the mojang mappings flag
How do i do that?
So
removing the jar from .paper-remapped should be enough
gonna try
hopefully
I deleted the whole .paper-remapped folder
And it created again
And put my jar into there
with your plugin jar in it?
Yes
That's what i did
Well, I found the exact same issue
But I already did this
This is my MANIFEST.MF
If it's set correctly your jar shouldn't go there
Maybe is it a paper issue? 
@static urchin sorry for the ping but can u give me a hand here? 🙏
In the actual jar?
I'm assuming it's set through paperweight itself?
https://docs.papermc.io/paper/dev/userdev#compiling-to-mojang-mappings
And like it says there are no depends(reobfjar) lines
There is my paperweights configuration 
Well, nvm
I just updated to the latest 1.21.1 build and it got fixed
i keep getting FileSystemAlreadyExistsException
deleted caches, restarted computer, still persists
Hi, I h I'm using paperweight and I'm trying to use versions below 1.19.4-R0.1-SNAPSHOT, such as 1.18.2-R0.1-SNAPSHOT. However, when I try to use paperweight.paperDevBundle("1.18.2-R0.1-SNAPSHOT"), I'm getting the following error.
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.
you need to use a java 17 toolchain for some old versions, like it says in the newest pin
ty
is there a faster way to change version numbers each time I am meant to build and publish my plugins? Having to go into the build.gradle and then into my libs.version.toml is a bit tiresome when it comes to updating all of my plugins at once. Replacing the build.gradle's version with the value inside of libs.version.toml results in the version becoming ?, so that doesn't work
generally people just do that with their CI system
CI?
there is no real way of tracking a version that magically increments sanely outside of having something centralised
continious integration
jenkins, teamcity, github actions, etc
And does that automatically update the values inside of the build.gradles?
No
CIs will often inject variables that you can use like a build number you can append to your version string
Does having a Github Repository for my project count as continious integration?
Not sure if github actions is a name of some program, or if you meant actions like pushing and pulling in Github
https://docs.github.com/actions
Automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, ...
Hey, I need help with managing a fork of a fork. I'm trying to fork another fork (of paper), I use withStandardPatcher and it works fine, like the server compiles and runs successfully and is playable BUT nms.
So:
- if I just clone a fork and compile it myself, it works perfectly fine
- if I make a fork based on any other fork using withStandardPatcher (I tried different ones so it's not fork-related) and compile it - the server has problems with nms
By problems with NMS I mean that the plugin which uses NMS can't load using my compiled fork (even without internal changes in my fork), but works perfectly fine if I use original fork (pre-compiled or compiled by me from source). The error in the plugin shows that it can't find some NMS classes.
Maybe you can say what I missed? I just use regular paperweight commands like applyPatches and then createMojmapBundlerJar ('cause 1.21 is mojang-mapped now) to compile both my fork and original fork, though NMS only works for original fork. Sorry if there's some info about that but I couldn't even find a wiki about forking a fork (not paper) so I was trying to do the same as other forks do but something went wrong and I'd be glad to get some help with it
https://pastes.dev/3QEKVG8rFY
Hello, I have an issue or bug when using Paperweight Userdev on versions below 1.21. The error is as follows when using NMS from that version: java.lang.NoSuchMethodError: 'net.minecraft.server.level.ServerLevel org.bukkit.craftbukkit.v1_20_R3.CraftWorld.getHandle()'.
well what version of the server are you running the plugin on? @wise silo
1.20.4
can you pastebin the full latest.log where it throws that error
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.
oh I guess you just aren't using the reobf'd plugin jar
when you do ./gradlew build, which jar are you using from build/libs
do you mean this?
correct. it produces multiple jars, one is reobf'd the other is still mojang mapped
on 1.20.4, we hadn't switched to using mojang mapped in production, that is 1.20.5+
I understand, so how could I solve the compatibility issue?
right now I'm drawing a blank
xD
you have to use the other jar that is made when you run build
run ./gradlew build and show what files are built
I'm handling it through adapters for versions.
so you should be using the the non -dev jar
but you can open each jar up and decompile each class and look at the types being used
you shouldn't have any "ServerLevel" references in your plugin which you had in your no such method error
as that is a mojang name, not a refobf'd name
don’t fully understand you with the last part.
dev
no dev
yeah, don't use the -dev one because it's not reobf'd and you are running a reobf'd server
you can see the difference in the types ServerLevel->WorldServer BlockPos->BlockPosition
ty
What a coincidence, I was going to ask something from paperwegith related to the io.papermc.paperweight.userdev bug in the BlockAnimations project 
The bug was that it did not get a default version and was confusing for another error
can someone look over this,
Required by:
project : > io.papermc.paper:paper-server:userdev-1.21.1-R0.1-SNAPSHOT```
https://pastebin.com/dZbepRb3
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.
context, moving to paper from spigot
that looks like groovy
we primarly cater to kotlin build scripts these days
but, also, 1.20.5+ require java 21
it was kt but my friend changed it to groovy a year ago because he hit a wall, i went with the flow
ah let me see, i thought it was 21, just saw the 17
generally you want to use the modern toolchain stuff
thanks works, other than the error with the testing module
i want to change it back to kt, but it's hard to do that
For some reason, my IDE is stuck on Building model - downloading a pom file from my repository (reposilite). I tried deleting the .gradle folder and doing invalidate caches + restart, but nothing changed.
I tried adding this dependency on another project, and the pom downloads fine and the dependency works fine. So it's something wrong specifically with this project.
What should I do?
Turns out I'm the idiot, I forgot to update the domain on the repository
Though I am surprised there is no warning or anything about that
i need help, i'm using paperweight and i need to import in 1.8.9
paperweight.paperDevBundle("version")
i tried this
ahhh, its only above 1.17
right?
yup
Is it possible to use paperweight patcher in vanilla Minecraft instead of spigot?
I try to use paperweight for 1.21 with mojang mappings, but I always get following error when running gradle build:
A problem occurred configuring root project 'paperweight-test-plugin'.
> For input string: ""
I also tried the paperweight-test-plugin (cloned it and changed nothing), but I'm getting the same error. Any ideas what can cause this?
btw I'm using java 21 and gradle 8.9
gradle stacktrace: https://pastes.dev/ES2Mnca5BE
EDIT: solved it by removing the gradle cache in my user gradle folder
Can you send us your build.gradle(.kts) please?
It only happens with module version 1.19_R1. Is the problem paperweigth? When I remove that specific version it doesn't compile, when I remove it it builds fine.
you need java 17 for that
It is the build.gradle from the example project: https://pastes.dev/qLRpsL5HDD
Take a look at mache I guess
Can we use this like papermc? I want to make changes to the vanilla code and publish it. How exactly does it work?
mache is a set of tooling to produce a compilable set of sources
our tooling is currently heavily wired around our actual setup
Well?
well what?
our tooling is written for our own pipelining, we don't setup the pipelines manually in paper
the whole "patching over vanilla" thing isn't going to be a thing until v2

Hi everyone,
I've been trying for a bit to have unobfuscated NMS using paperweight. Maybe I don't understand how to make it work, here is the plugins and dependencies from my build.kts
plugins {
java
kotlin("jvm") version "1.8.21"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("io.papermc.paperweight.userdev") version "1.7.2"
}
dependencies {
implementation("org.apache.commons:commons-text:1.11.0")
compileOnly("org.spigotmc:spigot:1.19.4-R0.1-SNAPSHOT")
// compileOnly("org.bukkit:craftbukkit:1.19.4-R0.1-SNAPSHOT")
paperweight.paperDevBundle("1.19.4-R0.1-SNAPSHOT")
compileOnly("co.aikar:acf-paper:0.5.1-SNAPSHOT")
}
Am i doing somethings wrong or is paperweight userdev not made to get unobfuscated NMS ?
Have a great day and thanks for further helps
well, you're pulling spigot in
so you're going to have both papers mojmap environment and spigots api/obf stuff floating around
But then, i miss things like EntityPlayer from NMS level etc...
Mojang don't call it EntityPlayer, they call that ServerPlayer
and so, how do i get re-obfuscated jars ? I have a "NoSuchMethod" even tho i'm using the "reobfJar" task from gradle
make sure you grab the correct jar
well, in the build/libs right ?
@grave moss you still didnt ask it here. Did you find it out?
no just i didn't have time to ask or try anything so i just waited to ask tomorrow which is now later today
Anyway, I i am trying my own maven dependency for my plugin so people can use the api how can i do that?
alright but how do i make my own maven repo and stuff
google it
right
not the right place to ask but someone might know the answer
im forking paper and use intellij on windows. my jdk is stored on wsl and i run gradle through wsl to speed up the process (as suggested in the contrib guide) but my intellij cannot seem to function as my entire project inside the wsl partition so ends up crashing/freezing during indexing etc. this doesnt happen when the project is stored on windows, does anyone have any advice on what I should do because I cannot use this IDE in the current state
more specifically i hang on 'Importing maven repo data' and 'updating indexes' also hangs forever (hours in my testing i never bothered waiting any longer)
solution
https://youtrack.jetbrains.com/issue/IJPL-73519/IntelliJ-is-slow-hanging-when-working-with-WSL-filesystem
turning of windows defender does nothing you must instead add some file paths to exlcusion
I added the entire wsl system as an exclusion so \\wsl.localhost\Ubuntu as well as some JetBrains dirs
Hello, im trying to use paperweight for 1.21.1. The thing is that when i load my build.gradle i get this error message
at io.papermc.paperweight.userdev.internal.setup.step.ApplyDevBundlePatches.run(ApplyDevBundlePatches.kt:78)
at io.papermc.paperweight.userdev.internal.setup.step.StepExecutor.executeStep(steps.kt:99)
at io.papermc.paperweight.userdev.internal.setup.step.StepExecutor.executeSteps(steps.kt:80)
... 163 more```
but there is no error message in the patchedSourcesJar.log. What should i do ?
this is my build.gradle https://paste.gg/p/anonymous/21164e4ea67047ba9a1c0b47886be6d8
ok this was a dumb error lol tyvm its working now 👍
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
or preferably, https://pastes.dev
one is kotlin dsl one is the ugly outdated groovy dsl
relocate('xcrestored', 'org.tomlj:tomlj') relocate('xcrestored', 'org.jetbrains.kotlin')
wrong way around
relocate("org.jetbrains.kotlin", "xcresorted.libs.kotlin")
also 1.20.1 is outdated
why do you have the stdlib both as compileOnly and implementation as wel
Ty bro
you can set the toolchain per submodule
Because you're targeting a version that came out before java 21 the version of java that was in use
the decompiler output has some differences depending on the version of JRE that is being used
well, you may need to delete the cache folder manually in order to get it to try again properly
otherwise, we'd need more info
not if you are using the latest version, which is the only supported one
I would bet this is due to cross-project configuration ordering
(unless ofc they are not using latest)
(reposting from #paper-help )
Is there any reason why paperweight is resolving the reobf configuration to .gradle/caches/paperweight/taskCache/reobfJar.jar? I'm trying to abstract away most gradle config logic across multiple projects into a gradle plugin, but for some reason, when doing the following:
pluginProject.addImplementation(
pluginProject.dependencies.project(
mapOf(
"path" to adapterProject.path,
"configuration" to "reobf"
)
)
)
This causes shadowJar to not include the proper class, since reobfJar.jar doesn't exist. The correct path should be something like build/libs/whatever.jar.
hi can someone help me shading CommandAPI?
i get this error
https://paste.md-5.net/detexecocu.bash
share your build script
the build.gradle you mean?
yes thats your build script
new information everyday
use https://plugins.gradle.org/plugin/com.gradleup.shadow intead of the original shadow plugin
quick question
i don't need the CommandAPI.jar in my plugins folder right?
when i have it it sends the commandapi is loading 2 times
if you shade it you don't have to put it in your plugin folder
also you can remove the dev.jorel:commandapi-bukkit-core:9.5.2 dependceny
ok but when i had the jar without shading people said i have to shade
well that or you tell people to also install the CommandApi plugin
i get this error when i reload project
message.txt by @hollow lark: https://pastes.dev/wcIKlulUtP
i used this
latest version or 8.3 same as shadow
latest version
ok
i updated
but now i get this https://paste.md-5.net/wucoyodulo.cs
i updated to right version
uh can you send your new build script again?
you still need the java plugin
wdym
i did
?
message.txt by @hollow lark: https://pastes.dev/ejt7NT7zOh
i get this now
lowercase
hi
so im trying to use foundation library with gradle but everytime i build i get that error
script: https://pastes.dev/WNFWRi0gzo
That's a configuration issue with that library. It somehow declares WorldGuard and WorldEdit with a custom package. That's a terrible use of dependency management.
ideally, don't use it in general. its terrible and encourages bad practices
Maybe just missing some mine academy repo...
message.txt by @gritty robin: https://pastes.dev/A9MFxLoYLz
Still not working
uh
any other suggestions?
the guy who made it has like 12 years of experience
why does that matter at all
just because someone has years of experience doesn't mean they will make good libraries
i think i won't use it lol
i got loads of errors and i don't really feel comfortable for it
libraries like that are quite pointless anyway, they put abstractions on top of the Bukkit/Paper API but without thought into the design making the overall experience just worse
this is the reason you don't often see a "do everything" kind of library, and if you do then it is most likely used by a single developer, e.g.: bkcommonlib that berger uses on all his plugins
how would i use xyz.jpenilla.run-paper with --enable-preview?
just add it to the jvm args
how?
runServer {
// Configure the Minecraft version for our task.
// This is the only required configuration besides applying the plugin.
// Your plugin's jar (or shadowJar if present) will be used automatically.
minecraftVersion("1.21.1")
jvmArguments.add("--enable-preview")
jvmArgs("--enable-preview")
}
nvm
i am dumb
hey how can i run debug server on intelij?
i tried something but it doesn't add the plugin to server
use the run paper gradle plugin
gradle plugin
allows you to run a server which automatically adds your plugin
and debug stuff
see here for examples: https://github.com/jpenilla/run-task
i did whats in the paper one
and i get this error when i reload
bump
send your new build script
you haven’t added the plugin lol
oh lol
now i get this https://pastes.dev/bIEBIaP4LV
send build script
wait
i updated version
and no error
so i run runServer in terminal?
./gradlew runServer
yes
when i update code do i have to run it again?
or it updates auto
where do i find it
run/
run/?
the directory run
The server directory is the directory run, which it created in the root of your project
ohh found it
i thought it was some virtual stuff lol
it showed the Timings Reset but still says this
?
yes i restart?
then i should run a debug server :/
How do I refresh gradle dependencies/cache? I deleted the caches file in my .gradle on my macbook, but doing that broke all my projects and I can't get them back on their feet
On one of them I get the error NoSuchFileException, about not finding files in the caches directory
Initialization script '/private/var/folders/j2/_k38ncp578v6cv02qd18s7740000gn/T/ijInit1.gradle' line: 107
Actually I get that error in both
normally ./gradlew --refresh-dependencies is enough
try restarting
maybe there was some daemon still running so it got fucked up pretty good
and iirc you can even delete the whole .gradle dir
wait, did you mean the user-level ~/.gradle or the project level one?
I deleted ~/.gradle and it all sorted itself out
Hi, I'm currently trying to add a project dependency to my dev bundle serverRuntimeClasspath configuration, but it gets filtered out right before it's added to the config.
I need that in order to run the runDevBundleServer task from my plugin without the server throwing a NoClassDefFoundError. The project dependency is already available on the mojmap bundler server jar in its libraries directory.
I've added a "fork" (literally one line of code) to a reposilite, and I keep getting 401 forbidden when it attempts downloading the final jar. gradle's auth is working, but for some reason when it tries getting the jar it shits itself.. any ideas?
17:00:25.294 DEBUG | HEAD /aethon/io/github/aethon/aethon-api/1.21.1-R0.1-REEE/aethon-api-1.21.1-R0.1-REEE.pom from my ip
17:00:25.295 DEBUG | Gav 'io/github/aethon/aethon-api/1.21.1-R0.1-REEE/aethon-api-1.21.1-R0.1-REEE.pom' found in 'aethon' repository
17:00:25.336 DEBUG | GET /aethon/io/github/aethon/aethon-api/1.21.1-R0.1-REEE/aethon-api-1.21.1-R0.1-REEE.pom.sha1 from my ip
17:00:25.337 DEBUG | Gav 'io/github/aethon/aethon-api/1.21.1-R0.1-REEE/aethon-api-1.21.1-R0.1-REEE.pom.sha1' found in 'aethon' repository
17:00:25.379 DEBUG | HEAD /aethon/io/github/aethon/aethon-api/1.21.1-R0.1-REEE/aethon-api-1.21.1-R0.1-REEE.module from my ip
17:00:25.380 DEBUG | Gav 'io/github/aethon/aethon-api/1.21.1-R0.1-REEE/aethon-api-1.21.1-R0.1-REEE.module' found in 'aethon' repository
17:00:25.413 DEBUG | GET /aethon/io/github/aethon/aethon-api/1.21.1-R0.1-REEE/aethon-api-1.21.1-R0.1-REEE.module.sha1 from my ip
17:00:25.414 DEBUG | Gav 'io/github/aethon/aethon-api/1.21.1-R0.1-REEE/aethon-api-1.21.1-R0.1-REEE.module.sha1' found in 'aethon' repository
17:00:29.674 DEBUG | GET /aethon/io/github/aethon/aethon-api/1.21.1-R0.1-REEE/aethon-api-1.21.1-R0.1-REEE.jar from my ip
17:00:29.674 DEBUG | ACCESS | Unauthorized attempt of access (token: null) to io/github/aethon/aethon-api/1.21.1-R0.1-REEE/aethon-api-1.21.1-R0.1-REEE.jar from aethon
17:00:29.674 DEBUG | FIND | Could not find file due to ErrorResponse(status=401, message=You need to provide credentials.)
build.gradle: https://pastes.dev/2YD0CwZKTk
everything from the .pom to the .module files seem to download and i can view them in my caches too
funny thing is im doing auth the same way when im publishing so i dont have the slightest of clue as to why my local machine cant pick it up from the maven repo
https://pastes.dev/s9m29MZJjo
i was so hopeful for a while too 😔
idk what the fuck i did but its working now 💀
it's filtering out dependencies it can't support, it's not for no reason
your best bet would be publishing it like normal and having the api or server depend on the published version
I've experimented with trying to support project dependencies before, but did not like what I came up with, I have ideas for other ways to implement it now but it's not a priority at all
jmp, does the userdev devBundle script strip away credentials?
it appears I can just comment out the plugin, and the devBundle script and use a compileOnly to get my api (and it downloads perfectly)
but when i try to get the devBundle on its own, it fails with 401
I don't understand what you are asking
Sorry uh,
I'm trying to use my own fork using the userdev plugin. I have repo auth setup as such:
maven {
name = "aethon"
url = "https://reposilite.quack.boo/aethon"
// credentials(PasswordCredentials)
credentials {
username = "haappi"
password = "password"
}
}
and my dependency as
dependencies {
paperweight.devBundle("io.github.aethon", "1.21.1-R0.1-WORK-ALREADY-v2")
But this gives me a 401 for some reason. It can download everything else (like here #build-tooling-help message), but struggles with getting the jar file for some reason.
If I were to remove the userdev plugin along with the devBundle, and use compileOnly("io.github.aethon:aethon-api:1.21.1-R0.1-WORK-ALREADY-v2") to fetch the dependency, it works fine... so Im starting to wonder if userdev is somehow not passing the repo credentials correctly
Alright, thank you.
you wouldn't include the repository in the bundle if it requires credentials
Where would I do it then to gain the NMs mappings as well?
I don't get the question
in the config for dev bundle generation there is a list of repos you configure for injection to consumer projects
that is not useful for repos that require auth
consumers will need to add the repo themselves
where are the details supposed to be kek
nevermind, I just deleted the API and server folder instead
does run-paper have hot-swap?
hotswap is a JVM feature, not a run-paper thing
how would i enable it with intellij?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.MF</exclude>
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<patern>dev.dejvokep.boostedyaml</patern>
<shadedPattern>org.nexuscraft.corevelocity.libs</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
Maven reloads fine but upon package, it fails for the following reason
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.6.0:shade (default) on project Core-Velocity: Unable to parse configuration of mojo org.apache.maven.plugins:maven-shade-plugin:3.6.0:shade for parameter patern: Cannot find 'patern' in class org.apache.maven.plugins.shade.mojo.PackageRelocation -> [Help 1]
I believe you have to set a shortcut key and then run the main class in debug.
Ok got it, it was a typo
If you haven't figured it out yet:
You can just run the runServer/runDevBundleServer task using the Debug button (see attachment) and reload using Run > Reload changed classes
More on that is explained on the wiki: https://github.com/jpenilla/run-task/wiki/Debugging#hot-swap
I know how to run it but when i reload the changed classes nothing happens
I tried doing /reload confirm
the reload command has nothing to do with hotswapping, and generally should not be used
you sure you are changing the right classes
when hotswapping, onEnable isn't going to be called again so if you made your code unreachable then there's nothing that can be done about that lol
Is there any currently know issues with building paperweight dev bundles on OSX? I am currently using a bundle build as so, and it seems to be working alright.
works fine

Works fine for me as well. You use the gnu version of the diff cli tool?
am i missing something obvious, or does velocities "run" task not allow any commands into the console?
run-velocity or does the velocity project have a task
builtin application run task for papermc/velocity
is that through gradle or intellij
I can't find it in the repo
if it's gradle then it's probably just missing https://github.com/jpenilla/run-task/blob/master/plugin/src/main/kotlin/xyz/jpenilla/runtask/task/AbstractRun.kt#L117
yeah its through gradle.
idk how the built in application type works tho
https://github.com/PaperMC/Velocity/blob/dev/3.0.0/proxy/build.gradle.kts#L4-L12
ill see if i can set that in the application block itself
the application plugin is just kind of antiquated in general
I would just slap a JavaExec in there tbh
or just manually create a run with intellij
i created a pr for that on velocity https://github.com/PaperMC/Velocity/pull/1398
huh?
it does what its supposed to
Interesting about that comment saying runs input still doesn't work, even setting stdin
Compared to runshadow
I wonder what the differences between the two are
I mean, yea, but it's also generally broken here
I was thinking to just shove it over to using JavaExec, if that fixes that then it's probably worth it to just remove the application plugin and jump over to just using a custom run task for both
at the very leas that would potentially fix an issue with me having to mess around with my testing environment for
Oh, actually, I think I get what's happening
<?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>com.meek-dev</groupId>
<artifactId>CommuBadges</artifactId>
<version>2.0</version>
<packaging>jar</packaging>
<name>CommuBadges</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</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>4.9.1</version>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
@limpid heart
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
Remove spigot-api dependency, it isn't needed when depending on paper-api
if you mean not following modern java or gradle conventions is the goal, then sure
i don’t see why velocity would need the plugin at all when the distribution is just a fat jar
https://github.com/morganstanley/gradle-plugin-application this is much better than the application plugin for cases where you actually need it
I'm getting this timeout for 1.21.1 paperweight-userdev
move that repo to the end of your list
thx it works now
Sorry - after you clone Folia, is there some additional setup required? Getting the attached error for all gradle tasks:
#folia-help - but the steps are the same as outlined in the paper readme
^ thank you, that channel wasn't on my list
Is there a paper readme for building the server? I only see plugin guides on papermc.io
https://github.com/PaperMC/Paper#how-to-compiling-jar-from-source there isn't much
woot! For future refs, it built but I had to add org.gradle.jvmargs=-Xmx1024m "-XX:MaxMetaspaceSize=512m" to my gradle.properties
you should not need to change the memory options unless you have something messing with the defaults
nope, haven't messed with any of the code, clean clone from Github except for the gradle properties edit
Hello!
I am currently running a private paper fork. Now I am trying to access NMS so I need a Dev Bundle.
According to the paperweight-example there are 2 things needed
tasks.generateDevelopmentBundle {
apiCoordinates.set("de.verdox.mccreativelab:mccreativelab-api")
//mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
//repositories.maven(repositories.mavenLocal())
libraryRepositories.set(
listOf(
//"https://repo.maven.apache.org/maven2/",
mavenLocal,
// "https://my.repo/", // This should be a repo hosting your API (in this example, 'com.example.paperfork:forktest-api')
)
)
}
publishing {
// Publishing dev bundle:
// ./gradlew publishDevBundlePublicationTo(MavenLocal|MyRepoSnapshotsRepository) -PpublishDevBundle
if (project.hasProperty("publishDevBundle")) {
publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) {
artifactId = "dev-bundle"
}
}
}
}
I am only trying to publish it to maven local. Whenever I execute gradlew publishDevBundlePublicationToMavenLocal -PpublishDevBundle it creates the dev bundle in the build/libs/ and build/publications. However it does not appear in my maven local repository :/. I tried to add publishDevBundle to the gradle.properties. But did not work either
How do I add a library to the build process in gradle.kts?
e.g. to use during a task execution?
I want to include a library in the build process.
What does that mean. Do you want use the library during the build process to build something or do you want to include a library in the project that is being build
I want to include a library in my jar that I've added as a dependency.
Ah
in that case, what you are trying to do is shading the library
for that, the general plugin to use is the shadow plugin
The error occurs while trying to develop using paper-weight with id("io.papermc.paperweight.userdev") version "1.7.3-SNAPSHOT" applied. What could be the cause of this?
Beyond the question as to why you are running the .3 snapshot, ehh, what jdk are you using for compilation
I am using Java 21, and when I downloaded paper-weight from GitHub, it was version 1.7.3. Is there a way to use an older version (like 1.7.1)?
download paperweight from github?
The latest release is https://github.com/PaperMC/paperweight/releases 1.7.2
Not that it matters, ehh, can you share the build script?
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
https://github.com/HibiscusMC/HibiscusCommons
This error occurred while building this plugin. The build script includes paper-weight
do you have the branch that fails building?
beyond that, can you post the output of java --version
It occurs at the indicated section.
ibm jdk is crazy
Thank you! I will try again with the JDK build and version 1.7.2
ibm jre*
how can I get rid of the shaded and original jars? I only need the normal jar
don't
using maven is also generally a headache for this kinda thing, you'd need a post task to clean up, and screwing with files is how you end up breaking build reproduction
yo chat
how does one obtain hotswapping with userdev
all i have are these three tasks
runserver might do it, not sure if that supports hotswapping out of the box thb
ah shit i dont have a runServer task
all i did was add id("io.papermc.paperweight.userdev") version "1.7.1" to my plugins and add paperweight.paperDevBundle("1.20.6-R0.1-SNAPSHOT")
oh i probably need the whole paperweight setup rght
osmeone told me i just needed userdev 😭 🙏
get the run-task plugin
from jpenilla?
gotcha
ah yes this has runDevBundleServer im guessing this is it
how do i obtain hotswapping now that its running though lol
you may want to configure that task to add the enhanced hotswapping arg if that's still a thing
all i did was execute the runDevBundleServer task but it wasnt hotswapping shit 😭 🙏
executed it how?
good ol' left click
you need to run it as a debug task inside of IJ
that way IJ will hook in its debugger
oh as a debug task?
okay
gotcha
give me one sec
okay well im running it as a debug task
but its not doing shit (probably not using jbr)
okay well
jbr doesnt have a java 21 version afaik
am i cooked
no it does have 21
hmm
alright
now im using the right jdk to run it
but it aint hotswappong
😮
its definitely the right jdk though
unless im supposed to press some fancy button for hotswap
i had to do CTRL + SHIFT + F9
however ^
i restarted it and now i get this
oh wait do i need to append the parameters?
make sure you disable relocation
oh alright
i realised i didnt configure this
do I need to with paperweight?
or does it magically do it itself
ill figure out how to do this thanks
alrght well
now there's no error but it didnt do shit 💀
well i added -XX:+AllowEnhancedClassRedefinition -XX:HotswapAgent=fatjar to the arguments and got 2 billion errors
oh well it did fix it though
https://pastes.dev/IgJNXmRu4Q i do get these errors
hotswapping works at least
lol
thanks for da help 😄
fatjar never worked for me, some missing classes regarding plugins. I just use core and it works like a charm
except kotlins inlining and functions makes it a little annoying sometimes, but its worth ti
Hey, I asked my question in the wrong channel and was referred here. Panilla is unable to compile bc it requires PaperMC 1.20.6+ to be in the local maven repo in the same way spigot / craftbukkit had to be in the local maven repo for earlier versions.
Would anyone here know if compiling PaperMC w/ gradle will put the necessary dependencies in the local repo so I can compile Panilla? I’m having some trouble compiling Paper 1.20.6, which I can elaborate on if I get an answer but I just want to know if I’m working in the right direction.
A user was having a similar issue in this Discord here, don’t know what their solution was: #paper-help message
Thanks!
are you the dev or just a user trying to compile it? the proper solution is to update the project to use paperweight-userdev, we haven't supported the maven local install method for a couple years at this point
It's recommended to update to 1.21.1, but here is the reference for a properly configured 1.20.6 fork for reference
https://github.com/PaperMC/paperweight-examples/tree/81bc9ba6474cd782c75f590794d459ff1c277622
Right. Gradle people, I am stuck. Finally got my "api" module building , struggling with "plugins". api builds a jar and puts it in the libs folder... Declaring libs/*.jar doesn't seem to load it, as building plugins throws a ton of missing package/symbol errors...
if I add :api as a dependency, it supposedly a circular ref
Any pointers would be much appreciated
is the project on GH? Otherwise, share your build.gradle.kts files
Please send large files/logs to a pastebin
ty. I'll pastebin the kts files
api: https://pastebin.com/SHznW7wf
plugins: https://pastebin.com/G5C31Y0z
Aight, whatever you are doing there is 100% not what you are intending to be doing
Probably not, the gradle stuff was written after I left the "team"
basically just hacking away tilll something works tbh
Yea, so, obviously you kinda have a circular dependency if the api build a jar, puts it into /libs, but API also depends on the contents of libs
given how small the project gradle files looks, I'd just restart completely with gradle
you have a root build.gradle.kts ye? and then two modules, one api one plugin
nope. just api/build and plugins/build, then projects within plugins
Well that's part of the problem then
oh, so this isn't a single project then?
If you have multiple projects that all consume the API, you'd be looking a lot more at just publishing it correctly instead of some jar based dependency crud
Like, maven repository somewhere and off ya go
alternatively, make everything a single gradle project
Though if these 2 projects are effectively 1 project (i.e. it doesn't make sense to have them separate), you should probably be switching this to a single gradle project
oh missed that
but yea, if it is just one, go with _11's suggestion
hmm... it is and it isn't, i haven't touched this source since 2016... "api" is a collection of utility stuff and then "plugins" is a project full of plugins...
hmm, plugins does seem like a single project then yea
...wow that's more than I expected. Assuming those plugins are all completely independent of one another, I'd probably split them all up into independent projects (i.e. separate VCS, build file, etc), same with the API, and figure out proper publishing for the api module
Though I'm not sure if that'd be more or less work than trying to make it work as the current one giant megaproject thing
might be able to get away with pushing api to local maven then
local maven was the answer... now, is there a way to create fake players without NMS?
packets, but thats kinda the same in the end
All good, I'll probably just use Citizens. Finally got the whole project building and producing loadable plugins... Shame nothing actually works XD
are there any examples for using paperweight on a fork of paper?
I'm trying to make a custom server jar with paperweight patcher
I'm looking at that but the provided example is to make a fork based from paper and I want to use in my case purpur as a base fork
got it I knew that I had to use standardpatcher but the rest of the fields inside I was stuck on that
Hi, I have a problem with gradle. When I try to build my project it says that it the build was successful but there's no build directory to be found? I think there's something wrong with my build.gradle.kts file but I don't know what it is.
Please send large files/logs to a pastebin
your build.gradle
anyone know whats wrong?
* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
* 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.
C:\Users\User\Downloads\PlotSquared-7.3.11\PlotSquared-7.3.11>```
this channel is for people who want help building their own plugins, not building paid plugins
plugin development?
i need help and i never can compile this from github
i tried jdk 21 and jdk 17
im banned from dc
again, no help for building paid plugins. That's the reason people pay for it, for support
i couldnt pay
Hope you cloned the repo?!
You've enough memory to build stuff?
this is not the channel for “help me compile a (paid) plugin”
i downloaded the zip and extracted it theres a folder and one more folder and there is the files i navigated to the folders and run .\gradlew build in cmd it continues a bit and crashes
Yeah it is the channel "help me to use paperweight" ✅
?
I'm with you powercas_gamer.
ok
why not
solidarity between fellow developers, it would be rude to PS's maintainer
you'd need to see the gradle logs
but, helping people compile random plugins from github is generally a headache
yes
what logs
.gradle/daemon/ver/good luck
Not gonna hold hands for you. Buy the plugin or get ChatGPT to help you.
try a shorter folder path, I guess
i cant buy
and chatgpt doesnt help
Then safe up some money, so that you can.
ok
It isn't that we just want to be asshole and not help you. At least when it comes to me, I appreciate the fact that someone goes out of their way to publish the source of their paid plugins, and this is the way to reciprocate that as a community member
Did you manage to fix it? Im stuck with 1.20.6 as well 😓
as said, their project setup is generally broken and in order to fix it you'd either need to fluff around to deploy whatever they're expecting to be in the lobal maven repo to be in local maven, or, update the thing to properly use userdev
I wonder how they compiled it in the first place tho, is there some docs to update to userdev?
They manually installed those versions of paper into their maven local repo
is generally the documentation which covers that, but might not be a trivial swap if you're not familiar with gradle, etc
The project from github actually uses gradle
yes, I know
Will try to update, I dont have high hopes tho 
good luck thumbs pressed.
if you read the error you will notice it points you to a log file
https://github.com/PaperMC/paperweight-test-plugin/blob/master/build.gradle.kts#L51-L52 you found one of the reasons
remove the lines in your build file messing with output names
Hi, anyone knows why with this build.gradle I haven't NMS? I'd tried to follow paper's guide, but it seems like not works for me (it's my first time using Paper's NMS)
id("io.papermc.paperweight.userdev") version "1.7.1"
}
repositories {
mavenLocal()
}
dependencies {
paperweight.paperDevBundle("1.21.1-R0.1-SNAPSHOT")
implementation 'de.tr7zw:item-nbt-api:2.13.2'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}```
do you have any errors when refreshing the gradle?
Nop, I get error (of missing classes) during build
I talked about refreshing
not building
Yeah, I haven't any error
I haven't that jar lmao
and this doesn't seem like proper gradle
Can I send u the link of repo in dm?
wdym?
The link of Github repository
what github repository?
that one is private, look at this example plugin https://github.com/PaperMC/paperweight-test-plugin
I also have this one here if you want https://github.com/masmc05/SimpleInvApi
I meant I send u mine repository link
what repo link?
oh, you meant you to send me the github repository link with your plugin which have the issue?
yes
yeah, send it, will help with this
I'm trying to compile Panilla (https://github.com/ds58/Panilla).
It imports paper-server dependency from mavenLocal and with the build.gradle I sent not seems like to works
that one seems like is using some hacky unsupported ways
you'll have to ask the author for help
I don't have any contact of author (it hasn't any discord server or other).
I don't know why paperweight not generate nms classes, with these I think I can compile
But because that's a paid plugin, and you're kinda trying to break rule 7 from #welcome, you're going to receive even less support here
Purchase the plugin if you want a compiled version
I can't, is inactive on spigot
I would find an alternative for it then
paperweight how to make generateDevelopmentBundle for local repo and use for plugins?
see the comments in the paperweight-examples build file
just publish to maven local instead of a remote repo?
this doesn't publish bundle
i know that but it seems generateDevelopmentBundle does it in different way, it publish api + server but not devbundle
did you set the property to generate the bundle as per the build config?
Is it possible to modify the output jar of the paperweight userdev server after its done applying patches and stuff?
like say i wanted to apply another patch(with a gradle plugin), would it be possible to do that
wanting to clarify this is with a gradle plugin lol
no
should i use subprojects {} for common subproject configuration or should i use buildSrc/shared.gradle.kts?
Figured it out, using buildSrc conventions for common configuration 👍
right, DSL is killing me now. its resolving
https://mavenrepository.com/artifact/net.byteflux/libby-bukkit/1.3.1/libby-bukkit-1.3.1.pom
to https://mavenrepository.com/artifact/net/byteflux/libby-bukkit/1.3.1/libby-bukkit-1.3.1.pom
Any ideas?
Never mind, it was for Citizens and had to add the exclusion
Anyone know what the recommended version of the jetbrains annotations library is? Trying to compile a jar using the command line.
latest is probably fine
Hi, I have a problem with gradle, so I cloned a project from github and am now trying to compile it and I've gotten it so far that it compiles without errors but once you look into the jar file it creates there is no plugin.yml or other directories there is just the META-INF file and nothing else. I also noticed that inside of the build folder that the ./gradlew build command creates there are just the folders libs and tmp, everything else is missing. Does anyone have an idea what the problem would be here? I appreciate any help
what project is it
we're trying to make a mini game. right now the project includes a state machine and a class that shuffles teams
If that's what you mean
No, they asked specifically, what did you clone
chances are you're looking in the wrong place or ran the wrong command
either way, the particulars are going to depend on the project you cloned
oh
just quickly chiming in here, iam working on this project with ladycat and i can compile it fine on my machine (iam using linux, she uses windows) if that helps
works fine here
just cloned it again and didn't change of the cloned version then I tried building and it told me that I should run gradle init. So I ran gradle init and then tried building and it says that is successfully built but theres no build folder
(I had this problem before but the build folder appeared once I moved the build.gradle.kts, the settings.gradle.kts, .gitattributes, .gitignore, gradlew and gradlew.bat to outside of the src folder)
but then I had the problem I am having now
Hey, I'm getting this error whilst trying to add the dev bundle to my project: ```
A problem occurred configuring project ':bukkit'.
Failed to notify project evaluation listener.
Could not resolve all files for configuration ':bukkit:paperweightDevelopmentBundle'.
Could not find io.papermc.paper:dev-bundle:1.21.1.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/io/papermc/paper/dev-bundle/1.21.1/dev-bundle-1.21.1.pom
- https://repo.papermc.io/repository/maven-public/io/papermc/paper/dev-bundle/1.21.1/dev-bundle-1.21.1.pom
- https://maven.enginehub.org/repo/io/papermc/paper/dev-bundle/1.21.1/dev-bundle-1.21.1.pom
- https://mvn.devos.one/releases/io/papermc/paper/dev-bundle/1.21.1/dev-bundle-1.21.1.pom
- https://maven.radsteve.net/public/io/papermc/paper/dev-bundle/1.21.1/dev-bundle-1.21.1.pom
Required by:
project :bukkit
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
My buildscript: ```kts
plugins {
alias(libs.plugins.paper.dev)
}
dependencies {
implementation(project(":common"))
implementation(libs.bundles.cloud.paper)
paperweight.paperDevBundle(libs.versions.minecraft)
}
The paper repo is added to all projects
or wait
does it need to be 1.21.1-R0.1-SNAPSHOT?
yes
oh
I am using jpenilla's resource factory for paper convention and am wondering how to properly add plugin dependancies?
Ok so I've got my patch in mache - how does the cycle work? I think the next step is using paperweight-userdev to start a fork off of papermc
but like, what's the feedback loop from mache <-> paperweight?
how do I get the patch stuff to paperweight, and then back to mache to do more dev work?
there is none
mache is tooling for paperweight v2 which is not in use yet
you use paperweight-patcher to fork paper, and even when mache is in use that would still be the case
mache is just creating recompilable sources
and letting me browse through the full patched code and dynamically update patches based on my changes - I don't think paperweight does that?
have a look at the paperweight-examples repo and the paper CONTRIBUTING.md
i only saw the examples repo, thanks the contrib readme is very useful
how do I use paperweightDevelopmentBundle()
I dont quite understand what I need to put in the brackets
I assume its just a depencency
but idk to what
the website seems to be outdated too
The version to use
half blind right now, but, looks fine to me
that looks like groovy, not .kts
yea, I have no idea how that looks like in groovy
oof

