#build-tooling-help

1 messages · Page 3 of 1

distant mango
#

or set to false

lone carbon
#

sure

distant mango
#

also open your jar and see if the classes are there

lone carbon
#

still

lone carbon
distant mango
#

what command are you using to build

lone carbon
#

commands?

#

that?

distant mango
#

try using package

lone carbon
#

nope

wraith cave
#

i usually mvn clean package install, works just fine

lone carbon
lone carbon
#

like i can't find the jar

#

looks lioke i am getting error with it as wel

orchid laurel
#

your pom is correct, it's a code issue

lone carbon
orchid laurel
lone carbon
orchid laurel
#

is it located in C:\Users\Merlijn\Documents\Beyond\Servers\Proxy\plugins?

lone carbon
#

nope

orchid laurel
#

so it's not the right one

lone carbon
#

?

orchid laurel
#

your pom build the jar in C:\Users\Merlijn\Documents\Beyond\Servers\Proxy\plugins

#

as specified

lone carbon
#

yes?

orchid laurel
#

so it's should be there

lone carbon
#

if i build it normaly it does.

orchid laurel
lone carbon
lone carbon
orchid laurel
#

the only way you should get your jar is mvn clean package

lone carbon
#

same thing

orchid laurel
#

for you it's a pom issue

quaint raven
#

<version>LATEST</version>

orchid laurel
#

it's a code issue for the other guy

quaint raven
#

Are you sure you can use LATEST as version there?

wraith cave
#

Stop pinging me bruh

lone carbon
#

user*?

#

bruh

#

i can't type

quaint raven
#

whatever HikariCP version you want to use?

lone carbon
#

use*

#

so is it bad if i use the lastest?

bronze ember
#

Never use latest

#

Always pin versions

#

This isn't npm

quaint raven
#

Imo yes, at some point you stuff will not compile anymore because LATEST is incompatible with your code

bronze ember
#

Latest isn't even guaranteed to work fully

lone carbon
#

but that will not fix it?

quaint raven
#

not sure how maven works, I don't use that. you created somehow a profile "release" with the shade plugin. do you compile your plugin with that release profile?

lone carbon
#

?

orchid laurel
#

why is there so much thing is your pom

lone carbon
#

idk

quaint raven
#

maybe you should drop the entire pom and start from scratch then.

#

there is no point in using stuff you don't understand.

lone carbon
#

k

#

i will have a look

#

this pom.xml create this jar?

orchid laurel
#

Skoice.jar yes

lone carbon
#

i use that?

orchid laurel
#

wdym

#

you can't just copy paste my pom

#

you have some changes to make

lone carbon
lament scarab
#

Don't just copy somebodies pom

#

you need to understand what all it does

orchid laurel
lament scarab
#

iirc, yes

orchid laurel
# lone carbon https://pastebin.com/yLtjvhrD this is what i have

This should work

<?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.mcpractice</groupId>
    <artifactId>MCPracticeProxy</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>
 
    <name>MCPracticeProxy</name>
 
    <properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
 
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</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.3.0</version>
                <configuration>
                    <minimizeJar>false</minimizeJar>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>
 
    <repositories>
        <repository>
            <id>papermc-repo</id>
            <url>https://repo.papermc.io/repository/maven-public/</url>
        </repository>
    </repositories>
 
    <dependencies>
        <dependency>
            <groupId>com.velocitypowered</groupId>
            <artifactId>velocity-api</artifactId>
            <version>3.2.0-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.28</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <version>5.0.0</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.27</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>4.3.1</version>
        </dependency>
    </dependencies>
</project>
quaint raven
orchid laurel
lone carbon
#

look like the mysql-connector-java is not building

orchid laurel
#

code issue

lone carbon
orchid laurel
lone carbon
orchid laurel
lone carbon
#

prod the wrong place to ask but what is jdbcUrl?

lone carbon
#

thanks

oak copper
#

If you run build here on build-logic you wont get fat jar

distant mango
#

then add something so that assemble also executes shadowjar

oak copper
#

The shadow needs to be on the build-logic

distant mango
#

what

oak copper
#

You need to shade in those

#

So the shadowJar needs to run there

distant mango
#

what

oak copper
#

Without shadowJar implementation libs are not shaded in

distant mango
#

shadow is there

oak copper
distant mango
#

above paperweight

oak copper
#

Where is libs defined?

#

val libs = extensions.getByType(org.gradle.accessors.dm.LibrariesForLibs::class)

distant mango
#

gradle/libs.versions.toml

oak copper
#

WTF is this

#

I am so confused

#

How are you implementing a gradle plugin

distant mango
#

it's needed for build-logic

oak copper
#

Well my build logic is completely different I dont understand how this works at all 😄

#

I mean I get it but WTF

distant mango
#

are ytou using build-logic or buildSrc

oak copper
#

I am just using shadowJar

#

I get all the submodules and merge them

#

I do this on root

#

Well I just modified it so it matches how I do it

#

So I changed the configuration from "shadow" to "reobf"

#

This works so I am happy

short trench
#

haven't touched my build file for velocity, and now it's somehowbeing a hoe

no main manifest attribute, in server.jar

So I added this to my build.gradle

jar {
    manifest {
        attributes(
                'Main-Class': 'io.github.haappi.duckvelocity.DuckVelocity'
        )
    }
}

Error: Unable to initialize main class io.github.haappi.duckvelocity.DuckVelocity
Caused by: java.lang.NoClassDefFoundError: com/velocitypowered/api/proxy/messages/ChannelIdentifier
.-.
https://hastebin.com/share/niqiyoboya.java build file

#

It was working before like, today

short trench
#

wait

#

i spent half an fucking hour

#

just cuz i forgot that goes in the plugins dir

slate salmon
#

So I created a Paper fork using the PaperMC/paperweight-examples repository.
I've setup my project basically the way Folia has but when trying to execute gradlew applyPatches I get this error:
Command finished with 128 exit code: git -c commit.gpgsign=false -c core.safecrlf=false clone --no-hardlinks '<directory1>' '<directory2'
Is there anything I am missing?

static urchin
#

smack the debug flag -Dpaperweight.debug=true applyPatches and provide the output

slate salmon
#

Thanks for that flag, that gave this:

error: unable to create file nms-patches/net/minecraft/world/level/storage/loot/predicates/LootItemConditionRandomChanceWithLooting.patch: Filename too long
error: unable to create file nms-patches/net/minecraft/world/level/storage/loot/predicates/LootItemConditionSurvivesExplosion.patch: Filename too long

Which makes me think that I should move this fork; probably into a directory that has a shorter path than the current directory

static urchin
#

Yea

#

windows moment

#

Either move or, I think (has been a while since I touched windows) there is a flag somewhjere in the registry

slate salmon
#

Yeah, moving definitely solved that problem, now I am searching this stupid flag in the registry

granite valve
#

filename too long... yikes

static urchin
#

Something something long path enabled

#

idk, google probably got your back

slate salmon
#

I mean, if it's possible, why is it not enabled by default?! Windows, whyyyyy?

static urchin
#

"Windows, whyyyyy?" is honestly their slogan

slate salmon
quaint raven
#

Not only the main branch, but yes

cold hedge
lament scarab
#

You want to specify the configuration in your project depend to depend on the reobfJar config

cold hedge
#

i am not sure how to do that

#

i can't depend on reobfJar in the core project and it already is for the subprojects

lament scarab
#

in the project() thing

#

you can specify a configuration, idr the syntax and my craptop won't cope, so, you'll have to crossref the docs for that project method thingy or look around for somebody with such a setup

cold hedge
#

alright, i figured it out

#

also, the paperDevBundle is crossed out

#

but i cant do the paperweight.paperDevBundle

#

the paperweight is in red

distant mango
static urchin
#

I mean, seems like a runtask issue ?

#

make sure you are up to date with paperweight userdev ?

#

iirc it grabs stuff from there

distant mango
#

userdev 1.5.5

static urchin
#

Hmmm, seems to work fine on the paperweight-test-plugin

distant mango
#

How would I change the name of the jar? archiveBaseName doesn't exists (userdev)

lament scarab
#

read the example

distant mango
#

bleh okay

full stump
#

what was the gradle tool to translate groovy to kotlin

#

okay, whatever, i used the chatgpt and prayer method

full stump
#

Anyone know if i can run multiple servers simultaneously using https://github.com/jpenilla/run-task?

smoky violet
#

yes

#

you need a task for each server, each with own run directory, then adjust the ports so they don't collide

full stump
#

but won't they run sequentially?

#

like, one after the other?

smoky violet
#

I mean, it will run them in parallel if parallel mode is on. but you probably want to run it in separate terminal emulators so each one has it's own stdin/out

tardy summit
#

Hey, I'm reloading my gradle project within intellij which has multiple subprojects, and it's going through the whole paperweight shenanigans twice (once in the subproject that uses the plugin, and again when the parent project reloads). Is there anyway to stop this as it takes quite a while

distant mango
#

send your root build.gradle and the sub project's

tardy summit
#

they are practically identical to the ones in the test plugin

#

Root

plugins {
    kotlin("jvm") version "1.9.0" apply false
}

Plugin

import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    kotlin("jvm")
    id("io.papermc.paperweight.userdev") version "1.5.5"
    id("xyz.jpenilla.run-paper") version "2.1.0"
}

group = "com.jackchap"
version = "1.0.0-SNAPSHOT"
description = "A plugin to provide your servers stats to the Universal Stats Bot"

dependencies {
    paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
    compileOnly(kotlin("reflect"))
}

tasks {
    assemble {
        dependsOn(reobfJar)
    }

    processResources {
        filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything
        val props = mapOf(
            "name" to project.name,
            "version" to project.version,
            "description" to project.description,
            "apiVersion" to "1.20",
            "kotlinVersion" to getKotlinPluginVersion(),
        )
        inputs.properties(props)
        filesMatching("plugin.yml") {
            expand(props)
        }
    }
}

tasks.withType<KotlinCompile> {
    kotlinOptions.jvmTarget = "17"
    kotlinOptions.freeCompilerArgs = listOf("-Xcontext-receivers")
}
#

other sub project uses kotlin plugin but not paperweight

full stump
#

How do I make blossom run on build?

#

or rather, on assemble or jar, whichever one is better (I'm using it to substitute plugin version)

distant mango
#

you need to apply paperweight to the root plugin

full stump
#
blossom {
    val constants = "src/main/java/com/oskarsmc/tablist/TabListPlugin.java"
    replaceToken("\${version}", version, constants)
}

tasks.assemble { dependsOn(tasks.named("blossomSourceReplacementJava")) }
distant mango
#

with apply false

full stump
#

that's how i did it

#

what

distant mango
#

not u

tardy summit
distant mango
#

yes

tardy summit
#

i assumed that was if it was in multiple

#

okay

#

I was just about to try that as I thought that might have been the case

full stump
tardy summit
# distant mango yes

didn't need to, somehow intellij had made two separate gradle builds, one for the root, and one for a single subproject?! deleted the separate build and now its all built correctly

distant mango
#

according to the userdev docs it is required /shrug

tardy summit
#

Due to a gradle bug, independently applying paperweight-userdev to multiple projects in a build can result in errors

lament scarab
#

I mean, that's for mutliple sub projects

tardy summit
#

yes, that was my understanding

#

and what the readme says

#

I think what happened was I copied over a template plugin of mine including the gradle wrapper so intellij assumed it was a separate project rather than a subproject

distant mango
#

I already did git prune a few times

lament scarab
#

i mean, yes

#

but, if you wanna ru that command, you'd need to do it in the submodules

split barn
distant mango
#

i answered you in paper-dev

split barn
#

I added the repo paper

distant mango
#

send a new screenshot then

#

also try to use the actual release

#

so 1.5.5

#

is the latest

#

iirc

#

but again, wtf are you trying to do

solar heath
#

Could somebody help me set up velocity?

distant mango
#

no

shrewd crestBOT
#

(64b75287cdf07f25f6ac9fa9) // @solar heath (keysean#0082 / 958908249049038920) has been kicked by @rapid fractal (177150983258767360)
Reason: troll and impolite person

cinder ember
#

How to set up a papermc server on Linux?

static urchin
#

head to #paper-help for help with administration of servers

opal verge
#

So currently

#
configurations {
    includeInJar
}
dependencies {
    configurations.implementation.extendsFrom(configurations.includeInJar)
    includeInJar project(':common')

    compileOnly "io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT"
}
jar {
    dependsOn ':common:remapJar'
    from {
        configurations.includeInJar.collect {
            it.isDirectory() ? it : zipTree(it)
        }
    }
}```
#

That worked, in that it actually included the classes from :common inside the :fabric JAR, however...

#

When I then published my stuff to maven local, and tried to use it in a different project, it said this ```
A problem occurred configuring root project 'SeedMapper'.

Could not resolve all files for configuration ':modImplementation'.
Could not find dev.xpple:common:1.1.5-multi-platform.
Searched in the following locations:
- file:/C:/Users/frede/IdeaProjects/SeedMapper/.gradle/loom-cache/remapped_mods/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- file:/C:/Users/frede/.gradle/caches/fabric-loom/minecraftMaven/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- file:/C:/Users/frede/IdeaProjects/SeedMapper/.gradle/loom-cache/minecraftMaven/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- https://maven.fabricmc.net/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- https://libraries.minecraft.net/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- https://libraries.minecraft.net/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.jar
- https://repo.maven.apache.org/maven2/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- file:/C:/Users/frede/.m2/repository/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- https://maven.xpple.dev/maven2/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- https://nexus.seedfinding.com/repository/maven-seedfinding/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- https://nexus.seedfinding.com/repository/maven-seedfinding-snapshots/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
Required by:
project : > dev.xpple:betterconfig:1.1.5-multi-platform-fabric```

distant mango
#

@lethal sparrow what version of runTask

lethal sparrow
#

2.1.0

opal verge
distant mango
#

it works for me ¯_(ツ)_/¯

opal verge
#

I could confirm my suspicion by looking inside the .module file inside the JAR file, where it says this { "group": "dev.xpple", "module": "common", "version": { "requires": "1.1.5-multi-platform" } }

lethal sparrow
#

jvmArgs("-Xmx4000M", "-Xms4000M") might work but I'm unsure on how to see if it's actually doing anything.

opal verge
#

So yeah that's where I am stuck now, so much so that I now want to use that shadow plugin instead

lethal sparrow
#

How can I get this window to show up when running the runServer task?

opal verge
#

Remove some --nogui argument

lethal sparrow
#

It doesn't even regonize the nogui argument

granite valve
#

its not a jvm arg, its a program arg

#

probably have to remove it from the args list in the task

lethal sparrow
#

I've tried all of this

        args?.remove("--nogui");
        args?.remove("-nogui");
        args?.remove("nogui");```
but it did not work.

Although, I ended up downloading Spark and using /spark heapsummary just to see if `jvmArgs("-Xmx4000M", "-Xms4000M")` was actually affecting the memory and it does!
wraith cave
#

but...

#

the gui told you it worked... why did you need spark for that? xP

#

nvm im fucking stupid lmao

opal verge
#

How can I set up a test server task for my plugin?

#

And also a test module along side my main module?

granite valve
#

gradle should automatically do that. just create the folder

#

I think those are techincally sourceSets not modules to use the gradle parlance

opal verge
#

Ty

opal verge
#

Do I use paperweight-test-plugin to make a test plugin setup for my plugin?

distant mango
#

what

opal verge
#

I searched through this Discord and someone mentioned using it to test their plugin

#

Idfk

#

And in my case I don't wanna just test my plugin, I wanna test my plugin using another test plugin, since I'm writing a library plugin

bronze ember
#

paperweight-test-plugin is an example repo for paperweight-userdev, our way to allow plugin authors to access internals via a gradle plugin

#

it seems unrelated here

opal verge
#

Ah, sorry then

#

Then how do I set up a testing plugin

distant mango
#

what is your defenition of a "testing plugin"

opal verge
#

A plugin

#

To test my library plugin

distant mango
#

just create a plugin like normal..?

opal verge
#

I want it in the same project as my main plugin

#

To use the classes from it

opal verge
#

I just want this, but...

eager sorrel
solemn iris
#

There's a very good motivation

opal verge
#

Yeah

solemn iris
#

What you can do is use a mock(Plugin.class) from Mockito

#

Then stub the methods returning the relevant information

eager sorrel
#

yeah, use mockito

solemn iris
#

Basically just mock anything not directly being tested if it's an interface outside your implementation (which TDD advocates will hate me for saying)

lament scarab
#

I mean, mocking is generally flawed testing wise

#

but, nobody wants to spin up entire dev environments and the tooling that goes along with that

#

either that or you basically focus on testability over caring about the actual intended goal

solemn iris
#

Sure thing, but until you find an alternative that allows me to write tests covering my entire plugin, be my guest and sit pretty

lament scarab
#

i only sit pretty on friday/saturday nights

solemn iris
#

Me too, Friday/Saturday is my weekend

opal verge
#

Currently I have an entirely separate project to test my plugin, and along with that a server set up somewhere. All I want is to have that in one place

lament scarab
#

basically, for good testing, you generally kinda need to focus on testing

#

mocking is one of those kinda neccessary evils on some front

opal verge
solemn iris
#

I love necessary evils

solemn iris
#

So join me on the dark side and embrace the automated mocking mess

opal verge
#

Idk what it is exactly but it doesn't feel like something I'd need to use for this

lament scarab
#

I mean, that's what mockito is

#

it just helps with some stuff where it generally ain't as viable or desirable to maintain 200 different mocks

opal verge
#

It should be possible to achieve what I want with some Gradle hacks

lament scarab
#

Well, your missing class is a classpath issue

opal verge
#

Yea

#

Somehow I need to add that to the classpath

#

Don't know how though

solemn iris
#

Test dependency?

lament scarab
#

I mean, afaik the test classpath generally derives from some aspects of the other classpaths

#

otherwise, you can explictly add stuff to the test classpath

opal verge
#

I'm a total noob when it comes to Gradle

#

Well that was an easy fix lol

opal verge
#

Okay I've got almost everything sorted out

#

The only thing that remains is to build the test plugin somehow

distant mango
#

I don't think you can build a jar w/o some custom tasks from the tests source folder

opal verge
#

Yeah I wanna set up those tasks :)

#

So some Gradle task that builds this

distant mango
#

show the whole project tree

opal verge
#

This is the paper subproject

distant mango
#

coul've just created a seperate subproject

#

feel like that would be 100x easier

opal verge
#

That wouldn't make much sense tbh

#

Also doesn't reflect the Fabric project structure

distant mango
#

why does that matter

distant mango
opal verge
#

It doesn't make sense to have common, paper, fabric and then also testplugin as subprojects

#

No one ever has done it like that

novel knoll
#

you could have testplugin as a subproject of paper

opal verge
#

I guess that could work? But I'd rather not, is there really no way to build the test sources?

novel knoll
#

yes, by making it a subproject

#

each source set has its own compileXxJava and xxClasses tasks anyway

opal verge
#

Does that create something similar to build/libs?

distant mango
#

you'd still need to setup a task to actually create the jar

novel knoll
#

see the tasks task

distant mango
#

but again, this would be a million times easier with a subproject

novel knoll
#

i think it sets up xxJar as well but, i don't remember

#

xx being the name of the sourceSet

opal verge
#

When I do testpluginClasses it complains that it can't find some class from my main source set, is the below not correct? gradle sourceSets { testplugin { compileClasspath += main.compileClasspath runtimeClasspath += main.runtimeClasspath compileClasspath += main.java runtimeClasspath += main.java } }

opal verge
#

Yea it's not there for me either

novel knoll
#

--all?

distant mango
#

yes

#

that's from --all

novel knoll
#

okay then it doesn't set up a jar task ¯_(ツ)_/¯

#

but it's like 3 lines to set one up

#

from(sourceset.outputs) or something

opal verge
#

I see, I'll look that up

opal verge
#

Ah do I need main.output instead of main.java

opal verge
#

What is the difference between compileTestJava and testClasses?

novel knoll
#

classes task is like the combination of various compileLanguage tasks

opal verge
#

So it's better to use that one ig?

opal verge
#

For future people with this problem:```gradle
tasks.register('buildTestplugin', Jar) {
it.group = 'paper'

it.archiveBaseName = 'testplugin'
it.archiveVersion = '1.0.0'
from sourceSets.testplugin.output

}

tasks.register('copyJarsToServer') {
it.group = 'paper'

doLast {
    copy {
        from jar
        into "${projectDir}/run/plugins"
    }

    copy {
        from buildTestplugin
        into "${projectDir}/run/plugins"
    }
}

}

copyJarsToServer.dependsOn(build, buildTestplugin)

tasks.register('runTestpluginServer') {
it.group = 'paper'

doLast {
    javaexec {
        workingDir = "${projectDir}/run"
        main = '-jar'
        args = ["${projectDir}/run/server.jar", '--nogui']
        jvmArgs = ['-Dcom.mojang.eula.agree=true']
        standardInput = System.in
    }
}

}

runTestpluginServer.dependsOn(copyJarsToServer)```

smoky violet
#

or ```groovy
plugins {
id(“xyz.jpenilla.run-paper”) version “2.1.0”
}

tasks.register('buildTestplugin', Jar) {
it.group = 'build'
it.archiveBaseName = 'testplugin'
it.archiveVersion = '1.0.0'
from sourceSets.testplugin.output
}

tasks.runServer {
minecraftVersion(“1.20.1”)
pluginJars.from(tasks.jar.archiveFile, tasks.buildTestplugin.archiveFile)
systemProperty(“com.mojang.eula.agree”, true)
}

opal verge
#

I totally would have used that if I knew it existed

novel knoll
#

funny quotes

dire ridge
#

lol

opal verge
carmine crane
#

Anyone know why i can't type runServer to build a server ?

lament scarab
#

"can't"

dusk pine
#

^ what’s the problem / error

carmine crane
#

i can't runServer in my console (normally that will start a server with my plugin on a papermc server)

lament scarab
#

Why can't you

#

what does it say?

hardy tendon
#

That doesn't really tell anything, do you get an error or something? What's the command you're running?

lament scarab
#

Like, we're not magicians here, just saying "can't" gives us literally nothing to go off

carmine crane
distant mango
#

..

#

you need to do gradlew runServer

glass sable
#

lol

carmine crane
#

oh

carmine crane
carmine crane
#

Do you know how to accept the eula with the runServer task ?

distant mango
#

jvmArguments.add("-Dcom.mojang.eula.agree=true")

#

with kotlin

carmine crane
#

where ?

distant mango
#

in the RunServer task

#
tasks {
    runServer {
        minecraftVersion(Constants.MINECRAFT_VERSION)

        jvmArguments.add("-Dcom.mojang.eula.agree=true")
        systemProperty("terminal.jline", false)
        systemProperty("terminal.ansi", true)
    }
}
carmine crane
#

what do the systemProperty ?

distant mango
#

colors

carmine crane
#

ok

carmine crane
distant mango
#

quotes

#

"1.20.1"

carmine crane
#

same problem

distant mango
#

are you using kotlin or groovy dsl

lament scarab
#

that looks like groovy?

#

or, no

#

.kts

distant mango
#

then that should defenitely work

#

try restartign your intellij

carmine crane
#

same....

#

i restarted

distant mango
#

try to actually run it

carmine crane
distant mango
#

from the commandline

lament scarab
#

best guess would be plugin version or something

#

but, er

#

isn't that from erm, what's it called

#

gradles own thingy?

#

brain, words, etc

carmine crane
#
plugins {
    id("java")
    id("xyz.jpenilla.run-paper") version "2.1.0"
}

group = "io.lakwiss.paper"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
    maven("https://repo.papermc.io/repository/maven-public/")
}

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

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


tasks {
    runServer {
        minecraftVersion("1.20.1")

        jvmArguments.add("-Dcom.mojang.eula.agree=true")
        systemProperty("terminal.jline", false)
        systemProperty("terminal.ansi", true)
    }
}
#

That's all my code

distant mango
#

¯_(ツ)_/¯

cold jay
#

Cannot resolve resource filtering of MatchingCopyAction. IDEA may fail to build project. Consider using delegated build (enabled by default).

btw what does this warning mean and how to fix if possible

    processResources {
        filesMatching("paper-plugin.yml") {
            expand(project.properties)
        }
        filesMatching("plugin.yml") {
            expand(project.properties)
        }
    }
cold jay
#
val targetJavaVersion = providers.gradleProperty("java_version").get()

how can i convert this val into an int?

#

(in kts)

distant mango
#

.toInt()

cold jay
#

ty

cold jay
#

Mmmh, i can't seem to get the jar

#

I only get dev and dev-all

brave widgetBOT
cold jay
#

what's missing?

lament scarab
#

because you want to run reobfJar

cold jay
#

this one?

#

can't i configure build to use that

distant mango
#

yes

cold jay
#

my bad i put dependsOn(shadowJar) instead of reobfJar

distant mango
#

Do I have to clear paperweight's caches for it to update the api?

#

or something else?

lament scarab
#

well, it's cached

#

either that cache expires or you clear it manually

distant mango
#

alr

west marsh
#

How do I delete a patch from my fork? Is it safe to just delete the patch file?

bronze ember
#

You want a proper paperweight fork that has a patch that is a revert of the initial patch, fixing all conflicts that arise

#

I.e. run git revert in forkname-server, fix conflicts so it compiles, rebuild patches

drifting torrent
#

any clue how I can apply userdev via apply?
trying to see if I can format my multi-module project abit differently like this in the main one but cant seem to apply it
normal plugins {} complains so

distant mango
#

plugins block has to be at the top

drifting torrent
#

im trying to strip out submodules needing their own build gradle file, and move it all into the main one
iknow the block needs to be at the top normally but cant use the block within the submodules like that

distant mango
#

put it at the top with apply false

drifting torrent
#

umean like this?

distant mango
#

yes

drifting torrent
#

seems to work though I have to use the deprecated paperDevBundle as it still doesnt find "paperweight"

fair kestrel
#

im very new to papermc development and i was tryna code a plugin in kotlin but im getting this err

Plugin 'org.jetbrains.kotlin:kotlin-maven-plugin:1.9.0' not found
distant mango
#

id recommend using gradle with kotlin

woeful gate
#

Hey, I'm trying to make project as api, however I have issue with publishing, I am not sure, how it should be there, this is what I have currently

publishing {
    publications {
        shadow(MavenPublication) {
            from components.shadow
        }
    }
}

build.gradle -> https://pastes.dev/t1JVLIxPw1

distant mango
#

what is the issue

#

@woeful gate

verbal skiff
#

shadow looks quite out of place there

granite valve
#

Generally you don’t publish your shadow jar

#

You should declare your dependencies in such a way that when someone else depends on you, they get your dependencies transitively. And then you can hide some dependencies that aren’t needed for the “api” part of your project

woeful gate
#
 ⚠️   WARNING:
 Gradle 'publishToMavenLocal' task not found. Please add the 'maven-publish' or 'maven' plugin.
 See the documentation and examples: https://docs.jitpack.io
distant mango
#

you need to add repositories to publish to

cinder ember
#

Why am I getting this error? Could not determine the dependencies of task ':commander-paper:compileJava'.

woeful gate
cinder ember
# distant mango show your build scripts
plugins {
    id("java")
    id("maven-publish")
}

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

dependencies {
    implementation(project(mapOf("path" to ":commander-common")))
    compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
}


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

publishing {
    publications {
        create<MavenPublication>("maven") {
            groupId = "com.github.QuadraBoy"
            artifactId = "commander-paper"
            version = "0.1-ALPHA"

            from(components["java"])
        }
    }
}
#

I'm new to making Gradle multi-projects and I have no idea why I'm getting this error

echo kilnBOT
#

Please send large files/logs to a pastebin

distant mango
#

all of your build files

#

& the complete log

lament scarab
#

Because it wants you to define it in the root project so that that task exists globally is my guess

cinder ember
cinder ember
#

Where?

#

In the root build file?

lament scarab
#

Yes

#

That build failed because it doesn’t have a suitable jvm

cinder ember
#

under subprojects?

lament scarab
#

Either tell gradle to do it, or comfigure kit pack to provide it

#

Afaik, no

cinder ember
lament scarab
#

Well, you can just provide it to the needed sub modules I guess

#

Generally you add stuff that affects the entire build into the root config, but, idk the conventions too well so

cinder ember
#
class org.gradle.api.internal.project.DefaultProject_Decorated cannot be cast to class org.gradle.api.initialization.Settings (org.gradle.api.internal.project.DefaultProject_Decorated and org.gradle.api.initialization.Settings are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @3b22cdd0)

#

I got this error

lament scarab
#

Yeaaaaa

#

That’s why it needs to be defined in the root project

cinder ember
#

Phew, this Gradle multi-projrct thing is a real pain in the ass

#

It's 1:23 AM in my country I need to go sleep. I will test it tomorrow morning

woeful gate
#

So I've played bit with maven publish, but now seems, jitpack is throwing error about no local toolchains, when I added plugin org.gradle.toolchains.foojay-resolver-convention (0.4.0), which should fix this, gradle throws Gradle's dependency cache may be corrupt ....

distant mango
#

you need to put that plugin in settings.gradle

#

and use 0.6.0

woeful gate
#

are you sure I need to use 0.6.0? on gradle was 0.4.0

distant mango
#

latest is 0.6.0

woeful gate
#

okay thanks

#

nice works

cinder ember
#

Ok so JitPack managed to successfully build my multi-project but when I tried to add the project as an dependency, IntelliJ gives me an error

#

it's trying to check the jar in the papermc repo even though it's on JitPack :/

#

you can check all of the build.gradle file on this repo

distant mango
#

..you need to add jitpack's repo

cinder ember
distant mango
#

send your pom

cinder ember
#

here

lament scarab
#

the thng just logs the last repo it tried when it blew up

#

you might need to run run the thng with -U to tell maven to refetch stuff

#

outside of that, any issues with jitpack you'd basically need to take up with them; their stuff ain't exactly known here for being reliable

cinder ember
granite valve
#

is there a way to configure a finalizer task in gradle with an output of the parent task?

#

basically want to set the input of the finalizer task to one of the outputs

smoky violet
#

what do you mean "parent task"

#

sounds cursed

#

finalizer tasks are kinda annoying to use in general iirc, I used to use them in toothpick but they caused problems with inconsistent results

granite valve
smoky violet
#

that was gradle 6 tho

granite valve
#

The there are 2 apply patch tasks, and after both, the git repo is setup.

smoky violet
#

oh that comment lol

#

yeah finalizers are fun for sure

granite valve
#

If there’s a way to configure finalizer task with an output of the task that’s being “finalized” I couldn’t find it

smoky violet
#

no you'd just need to wire stuff normally, and I think that comment is saying it breaks the finalization behavior to do that

smoky violet
granite valve
#

Yes

#

One or the other (if u understand that denwav was going for correctly)

smoky violet
#

and you're trying to use the same finalizer task regardless of which apply patch task is done?

granite valve
#

Correct

smoky violet
#

I would say don't do that, just have a different finalizer for each, and use that hack where you pass the outputs while breaking the task dependency chain

#

like that comment is talking about

granite valve
#

Hmm, so to pass the outputs i have to unwrap the provider then?

#

Or save the failed patches to a file and then load them from that file

smoky violet
#

yeah

#

finalizer means it runs after regardless of task failure iirc

granite valve
#

Yeah ok. Then I can have one finalizer and just have both apply patch tasks save to the same spot

smoky violet
#

so if it has a task dependency on the output it can't be a finalizer, as then it could only run when the previous succeeded

granite valve
#

It was seemingly working for me as is when the apply failed. Like I tested it with a patch that would conflict to make sure the whole thing worked

#

The apply patch task throws if any patch failed to apply

smoky violet
#

I see

#

I'm just going off memory so I could be wrong

granite valve
#

I’ll try it again to be sure that the finalizer is running if the apply patch fails.

#

But I can just change it to save/load from a file regardless

subtle solar
#

think of it as, one task sets up a temporary resource, you always want the finalizer for it to run to clean it up, regardless of build outcome

#

unfortunately if you tell gradle the finalizer task depends on the task it's finalizing via an input, then gradle decides the finalizer CAN'T run if the taks fails since its inputs aren't set up properly, so it never runs it

#

I don't know what @granite valve's question is tho

#

I had it set up to do the right thing already

#

the task is a finalizer for both apply patches tasks

smoky violet
#

I think he was trying to add another input

#

but not sure

subtle solar
#

yeah there should just be one setupSources task

#

applyPatches and applyPatchesFuzzy should never be run together, idk if there's a way to encode that in gradle tho. I would just call that UB and call it a day

#

or I guess the --max-fuzz argument could exist on just the single apply patches task and default to -1 for not setting it or something idk.

granite valve
#

but I can just do what you do for the patched jar, pass the file patch for a list of failed patches

subtle solar
#

the failed patches could just be in a different jar or something

granite valve
#

yeah, that would work too. the way that pr does it now is just unstages those files after adding all diff before committing the Patched commit

granite valve
#

then that jar's file is copied back over after the patch commit

#

the java patcher doesn't have the 3-way merge conflict thing, so unsure how best to handle that. right now, just nothing happens. We could omit the whole file from the "patched" commit instead of just the patch conflict

cinder ember
#

So I think I messed really bad uhmm I can't access JetBrains' annotations and the adventure api in my project and I found out when removing my custom built api in the pom.xml seems to fix the issue

#

here's a picture

#

Here's a picture while I have my API in the pom.yml. I can't access the Adventure API, numerous methods of the CommandSender, Bukkit, and probably in other classes.

#

And here's the build.gradle of my API ```kts
plugins {
id("java")
id("maven-publish")
}

group = "me.quadraboy.commander"
version = "BETA-0.1"

repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}

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

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

publishing {
publications {
create<MavenPublication>("maven") {
groupId = "com.github.QuadraBoy"
artifactId = "commander"
version = "BETA-0.1"

        from(components["java"])
    }
}

}

distant mango
#

show the dependency tree

distant mango
#

@cinder ember ^^

cinder ember
#

Oh sorry I managed to fix it

distant mango
#

alright, I assume it was that you had bukkit and/or spigot on the classpath?

cinder ember
#

yeah

cinder ember
#

here's my pom.xml @distant mango

distant mango
cinder ember
#

Uhmm what's that?

#

is it the <dependencies> thing?

distant mango
#

mvn dependency:tree

cinder ember
distant mango
#

do mvn dependency:tree in your terminal

#

and send the output here

cinder ember
#

oh ok

#
again.
At line:1 char:1
+ mvn dependency:tree
+ ~~~
    + CategoryInfo          : ObjectNotFound: (mvn:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
distant mango
#

in intellij's terminal

#

or use the task selecotr on the right

cinder ember
#

I can't seem to find the task

distant mango
#

then just try running it in the termianl

#

Alt + f12

#

i believe maven is bundled with intellij

cinder ember
#

Oh that's where I run the command

cinder ember
#

I probably need to download maven right?

distant mango
#

I thought intellij added maven to PATH thonk

verbal skiff
#

where's the :nomaven: emote when you need it

cinder ember
#

So what am I gonna do?

verbal skiff
cinder ember
#

the gradle one is from another project

#

the one I'm using rn is maven

verbal skiff
#

why dont you just use gradle for both?

cinder ember
#

and here we are

verbal skiff
#

you dont need to check it

#

gradle uses the maven publishing system

#

but your problem is actually that you arent using compileOnlyApi

#

instead of the java plugin, add the java-library plugin

#

this gives you access to dependency configrations such as api and compileOnlyApi

#

implementation and compileOnly won't create a transitive dependency, which seems to be your goal here

cinder ember
#
plugins {
    id("java")
    id("maven-publish")
}

group = "me.quadraboy.commander"
version = "BETA-0.1"

repositories {
    mavenCentral()
    maven("https://repo.papermc.io/repository/maven-public/")
}

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

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

publishing {
    publications {
        create<MavenPublication>("maven") {
            groupId = "com.github.QuadraBoy"
            artifactId = "commander"
            version = "BETA-0.1"

            from(components["java"])
        }
    }
}
``` here's the gradle one btw
verbal skiff
#

without the java-library plugin, you wont have any transitive dependencies

cinder ember
#

here is my updated build.gradle ```kts
plugins {
id("java-library")
id("maven-publish")
}

group = "me.quadraboy.commander"
version = "BETA-0.1"

repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}

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

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

publishing {
publications {
create<MavenPublication>("maven") {
groupId = "com.github.QuadraBoy"
artifactId = "commander"
version = "BETA-0.1"

        from(components["java"])
    }
}

}

Is it right?
verbal skiff
#

looks better

#

give it a shot

#

and try with a downstream gradle project too

cinder ember
#

alright I'm gonna test it out

verbal skiff
#

but as I said, you really dont need to check it with maven - if it works with gradle its going to work with maven too because they use the same format

#

i should rephrase and not let my anti-maven-bias out so much: If it works with either one, its going to work with both

cinder ember
#

uhmm it still doesn't work

verbal skiff
#

where are you publishing to

cinder ember
#

jitpack

#

you can try it

verbal skiff
#

jitpack is a hacky mess that doesn't always work, try it with maven local

distant mango
#

also fyi you really shouldn't use compileOnlyApi for your paper dep

#

pretty sure that'll cause it to be added to the jar for other people

verbal skiff
#

no

#

it wont

#

api will do that

distant mango
#

had that happen to me once

verbal skiff
#

compileOnly means it wont be included at runtime

#

thats the whole point of compileOnly

distant mango
#

I know that, but a dependency that I was using had a compileOnlyAPi for paper which caused it to be added to my jar

verbal skiff
#

then your shadow configuration was wrong

#

there is a compileClasspath and the runtimeClasspath

distant mango
#

default shadow config /shrug

verbal skiff
#

i mean i've never had any problems with shadow including anything other than the runtime classpath

verbal skiff
#

and for when you actually want to publish, I recommend going for maven central if its a serious project

#

you have to own the domain for your project

cinder ember
#

how can I do that?

verbal skiff
#

but then its as simple as opening a ticket on their JIRA, i've done it three times now

#

you also have to meet the minimum requirements (i.e. publishing sources, javadoc, signing)

#

but its very doable and the standard for JVM projects

cinder ember
#

I'll consider that option since I just want to publish my private works

verbal skiff
#

why do you want to publish?

cinder ember
#

anyways

#

Do you know what's causing this issue?

verbal skiff
#
  1. try it with maven local
  2. make sure you also add the paper repository to the downstream project
cinder ember
#

I have the paper repo in my API

#

The issue only appears if I add my API as a dependency

verbal skiff
#

what is the issue exactly

#

i thought you said that you dont have access to the paper classes through your api?

#

which means that naturally you wont have access if you remove your API

cinder ember
#

But when I removed my API from the dependencies, the issue is gone

#

wait I'll provide some pictures

verbal skiff
cinder ember
#

whoops wrong explaination

#

here's the project without my API as a dependency

#

and here's the project with my API as a dependency

distant mango
#

do you have paper api added as a dependnecy yourself

#

it's not including any transative dependnecies hence why it's not working

verbal skiff
#

hmm, good point

cinder ember
verbal skiff
#

I assumed he's not adding the paper api explicitly in the downstream project

distant mango
#

yep

verbal skiff
#

do you have compileOnly(paper...) in the downstream project

#

or implementation, compileOnlyApi, api

cinder ember
#

Wait so the downstream project is the API I made?

verbal skiff
#

no

#

the downstream project is "down the stream" from your API

#

its the project that uses your API

cinder ember
#

oh

#
<repositories>
        <repository>
            <id>papermc-repo</id>
            <url>https://repo.papermc.io/repository/maven-public/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.20.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.github.QuadraBoy</groupId>
            <artifactId>commander</artifactId>
            <version>BETA-0.1</version>
        </dependency>
    </dependencies>
#

everything is there though

verbal skiff
#

yeah ok

#

so dont do that

#

remove the paper api

#

your commander artifact already includes the paper dependency if you use "api"

#

or compileOnlyApi

#

now I'm like 95% sure this is a jitpack problem

#

please give it a go with maven local

distant mango
#

after adding the java-library plugin did you publish that to jitpack?

cinder ember
#

everything falls apart

cinder ember
#

I republish it again

verbal skiff
#

then its a jitpack problem

#

run ./gradlew publishToMavenLocal

#

in your API

distant mango
#

nvm

verbal skiff
cinder ember
#

after running publishToMavenLocal, all of the errors are gone

verbal skiff
#

there you go

#

don't use jitpack

cinder ember
#

T_T I can finally sleep

verbal skiff
#

what time zone are you in? o.o

cinder ember
#

idk about timezones, but I'm from the Philippines

#

it's 11:00 pm

verbal skiff
#

okay, that makes sense then

#

for most people on this server its around 11 AM right now I think

distant mango
#

5pm for me

cinder ember
#

I usually sleep at 10 but when I'm working on a project like this, I sleep at 2-3 am

#

my 15-year old brain can finally relax

verbal skiff
cinder ember
#

thank you!

verbal skiff
#

i would be very careful about that on discord, as the minimum age is 16 and they really like to ban people for that

#

i would delete that message

#

wait a second

#

nevermind

#

its 13

distant mango
#

depends on the country

verbal skiff
#

yeah, i've just seen so many posts on reddit about people joking about their age and losing their account of 7+ years

kind pewter
#

hi,
Im trying to setup a dev environment for the actual PaperMC github project

➜  Paper git:(master) java --version
openjdk 17.0.8 2023-07-18
OpenJDK Runtime Environment (build 17.0.8+7)
OpenJDK 64-Bit Server VM (build 17.0.8+7, mixed mode)

I have JDK17 as it says in the README To compile Paper, you need JDK 17 and an internet connection.
I applyPatches sucssesfully
But when I runDev it fails in paper-api:compileJava with:

> error: release version 17 not supported
#

also sorry I'm not familiar with java build-systems

#

also im using Intellij idea if theres an easy configuration method

#

ok so setting my java version to java-20-openjdk it seems to build correctly

#

id be interested for possible reasons behind that huh

granite valve
#

@kind pewter run ./gradlew --version in the Paper project.

#

also, are you running these tasks via intellij or on the command line?

kind pewter
#
------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------

Build time:   2023-03-03 16:41:37 UTC
Revision:     7d6581558e226a580d91d399f7dfb9e3095c2b1d

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          20.0.2 (Oracle Corporation 20.0.2+9)
OS:           Linux 6.4.8-arch1-1 amd64
kind pewter
#

on the integrated terminal thing

granite valve
#

right, so you said it worked with 20

#

but it should work with 17. set the java version back and show the gradle version

kind pewter
#

------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------

Build time:   2023-03-03 16:41:37 UTC
Revision:     7d6581558e226a580d91d399f7dfb9e3095c2b1d

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          17.0.8 (Oracle Corporation 17.0.8+7)
OS:           Linux 6.4.8-arch1-1 amd64
#

Its set back to 17

granite valve
#

and now, running ./gradlew runDev after ./gradlew applyPatches fails?

kind pewter
#

nope not anymore

#

was there some bootstrapping issue mabey?

granite valve
#

well first clean the cache

#

so do ./gradlew clean and then ./gradlew runDev --no-build-cache

#

cause it probably didn't actually recompile the api since you didn't make any changes since last compile

kind pewter
#
➜  Paper git:(master) ./gradlew runDev --no-build-cache
> Task :paper-api:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':paper-api:compileJava'.
> error: release version 17 not supported

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
3 actionable tasks: 3 executed
granite valve
#

what is your java home set to? echo $JAVA_HOME

kind pewter
#

not set

granite valve
#

ok, I think that has to be set to whatever java version

#

how are you managing multiple versions?

kind pewter
#

I using this thing archlinux-java

#

I think it comes with pacman for archlinux

granite valve
#

yeah, I'm not familiar with it. Just to see if it fixes it... put JAVA_HOME=path/to/java/bin in front of ./gradlew runDev and see what happens

#

then also check if JAVA_HOME is set when you change java versions to 20 via archlinux-java

verbal skiff
#

and then something like archlinux-java set java-17-openjdk

kind pewter
#

yeah im not sure why that utility is not setting JAVA_HOME

verbal skiff
#

it should be

#

ive never had a problem with it tbh

granite valve
#

does it not set it when you change to 20? if it doesn't set it there either, but you can still compile then it might not be the issue

verbal skiff
#

what does archlinux-java status show?

#

should look something like this

kind pewter
#

yep

verbal skiff
#

did you set java-17 ?

kind pewter
#

yep

verbal skiff
#

and then reopen the other shell?

#

what does java -version show now

kind pewter
#
➜  Paper git:(master) java -version
openjdk version "17.0.8" 2023-07-18
OpenJDK Runtime Environment (build 17.0.8+7)
OpenJDK 64-Bit Server VM (build 17.0.8+7, mixed mode)
#

its changing something...

granite valve
#

cause you said when you changed it to 20, you can compile

#

I guess also check javac --version to make sure the compiler version matches

kind pewter
#

I set it to 20

➜  Paper git:(master) java -version                          
openjdk version "20.0.2" 2023-07-18
OpenJDK Runtime Environment (build 20.0.2+9)
OpenJDK 64-Bit Server VM (build 20.0.2+9, mixed mode, sharing)

and do all the cache clean stuff.. It now doesn't compile

#

what does a good JAVA_HOME look like? /usr/lib/jvm/java-17-openjdk/

#

/usr/lib/jvm/java-17-openjdk/bin?

granite valve
#

I forget if its supposed to have /bin or not

verbal skiff
#

you shouldnt link it to a version directly, rather then symmlink

granite valve
#

I think its without the /bin. so
JAVA_HOME=/usr/lib/jvm/java-17-openjdk/ ./gradlew runDev

kind pewter
#

fails

#

java compiler also matches

granite valve
#

🤷‍♂️ I'm kinda out of ideas then...

kind pewter
#

haha no problem thanks for your time

#

I should just use windows😅

kind pewter
#

IDEA does insert some vars IDEA_JDK IDEA_CLASSPATH

granite valve
#

oh I guess try it outside of intellij all together

kind pewter
#
* What went wrong:
Execution failed for task ':paper-api:compileJava'.
> error: release version 17 not supported

Its specifically paper-api?

#

or is that just the first build target?

kind pewter
#
> Task :paper-server:runDev
System Info: Java 17 (OpenJDK 64-Bit Server VM 17.0.8+7) Host: Linux 6.4.8-arch1-1 (amd64)
Loading libraries, please wait...

Yeah in conclusion I don't know, using archlinux-java to set the JDK version to 20 seems to work for me.

#

gradle then just ignores it, finds and uses jdk17 anyway.

verbal skiff
#

or a gradle.properties in the project

#

maybe they are setting the java home variable

kind pewter
#

no it doesn't seem to be

verbal skiff
kind pewter
#

a terminal

verbal skiff
cinder ember
#

Can't exclude kotlin from shading

grand niche
#

keep in mind that this does not filter transitive dependencies

prime cliff
karmic grove
#
dependencies {
  implementation(libs.guava)
}

where libs.guava is a version catalog for guava 32.1.2-jre

distant mango
karmic grove
#

with

plugins {
  id("java-conventions")
  id("publishing-conventions")
  //alias(libs.plugins.jmh)
  id("org.gradlex.java-ecosystem-capabilities") version "1.3.1"
}
distant mango
#

do you have indra?

karmic grove
#

yeah

#

3.1.1

#

java-conventions is

plugins {
  id("base-conventions")
  id("java-library")
  id("net.kyori.indra")
  id("com.diffplug.spotless")
}

indra {
  javaVersions {
    target(17)
  }
}

base-conventions is

plugins {
  id("net.kyori.indra.git")
}

group = rootProject.group
version = rootProject.version
description = rootProject.description
distant mango
#

update it

#

3.1.2

karmic grove
#

yeah that works

#

thanks

#

i wonder why indra of all things would break it though

distant mango
#

3.1.1 ships an old version of that plugin

karmic grove
#

ah got it

woeful gate
#

Hey, I have this gradle error, when I was trying to setup paper as dependency for both modules I have there (core, api)

static urchin
#

you'll have to define the java plugin in your allProjects block via apply

#

otherwise, how would gradle ensure that all projects even have the java plugin

#

just because you happen to define it in the subprojects, does not mean that is guaranteed

#

@woeful gate ^ (ping given I am an hour late lol)

woeful gate
#

so add dependency and repository to main build.gradle and then in allProjects, something with apply

woeful gate
static urchin
#

Yea, pretty much just slap apply plugin: 'java' into the allprojects block

#

realistically tho, all of this is subprojects

#

not allprojects

woeful gate
#

wait apply plugin java?

#

I wanted to apply papermc api to all projects (both core and api)

static urchin
#

Yea

#

but to apply a dependency via compileOnly, the project needs the java plugin or some derivative of said plugin

#

so when you try to define the compileOnly dependency in a generic "allprojects" block without also defining that that project has the java plugin applied, gradle properly crashes

woeful gate
#

ooooooooh

static urchin
#

that should be groovy 😅

woeful gate
#

oops

static urchin
#

I tried to grab it from the gradle docs

#

no idea if it is correct

#

never used the groovy dsl

woeful gate
#

you started on kotlin gradle?

static urchin
#

I have been a maven enjoyer prior KEKW (don#t tell jmp)

woeful gate
#

okay seems to work, on :api project I have now this build.gradle

group = 'net.experienced.powered.staffprotect'
version = '1.0-SNAPSHOT'

do I even need it?

woeful gate
static urchin
#

Well yea, different project and potentially different version

woeful gate
#

and group?

static urchin
#

Yea

woeful gate
#

any chance I can also get version from both these projects so I can make version and I can somehow get it in project?

static urchin
woeful gate
#

oh I could do var version = version + project.version

#

xD

distant mango
#

either put it in allprojects

#

or gradle.properties

static urchin
#

gradle.properties my beloved

woeful gate
#

what

#

and now I am the confused

woeful gate
#

idk I didn't figured

woeful gate
#

nevermind, I did something, it works for me nicely

paper kestrel
#

so im trying to get a client jar working with paper mache, ive changed it so it can download the client stuff rather than server, but idk how to fix the dependency handling, as client jars have an array of downloads, rather than everything embedded in the server jar
i guess i need to add a new resolver or something?
not sure if im ready to right enough bad code atm, so i might leave it for now

edit: right so the server jar is a bundler jar, which includes the actual server jar in a sub directory

subtle solar
#

I'll add client support soon-ish. It's not high priority, but it's something I want to do. Working on writing some in-depth documentation on some of the technical aspects of it first

paper kestrel
#

https://github.com/the456gamer/paper-mache/tree/feat/add-client-support
i think i got it working? its a little hacky, but if you do smth like

mache {
    minecraftVersion.set("1.20.1")
    minecraftJarType.set("client")
}

in a version build.gradle.kts, it should download + decompile the client instead of the server

GitHub

Compilable patches for the decompiled Minecraft server and client - GitHub - the456gamer/paper-mache at feat/add-client-support

paper kestrel
#

with paper mache, how do i start creating patches for a new version? (on main branch mache btw, i was having the issue on my fork too)
just adding it as a config doesnt seem to work

A problem was found with the configuration of task ':versions:23w32a:setupSources' (type 'SetupSources').
  - In plugin 'mache-lib' type 'io.papermc.mache.tasks.SetupSources' property 'failedPatchJar' specifies file '~/projects/minecraft/paper-mache-test/mache/versions/23w32a/build/mache/server/failed_patch.jar' which doesn't exist.

there is probably a magic gradle task im missing ;)

#

out of curiosity, how were the first patches done? just taken from somewhere else? done manually?

bronze ember
#

More or less done manually, sometimes compared with other decompilers

placid tiger
#

Why does the chunks load slowly on paper and not spigot?

#

I need to fix this but idk how

distant mango
stiff totem
#

hello. tomorrow I will make a pull request to bring paperweight-example up to date for 1.20, went through the process myself so may as well contribute

#

<3

static urchin
#

Eh, updating that templte iirc is pretty annoying, as you have to update and force push all branches 😅

#

@smoky violet might wanna chime in on this

hardy carbon
#

It does not work powercas

distant mango
#

but it works in the other directory?

#

Might have to restart your pc after installing it

#

idk how windows does that stuff

hardy carbon
#

It works when I open terminal on windows and run it there

#

But not in the project directory

hardy carbon
static urchin
#

because the example branches are based on the main branch

#

so when the main branch is updated, all others are rebased onto the main branch

#

which requires a force push

stiff totem
#

I can see that the histories diverge after d64a2d0 but with the same commit messages, but I'm not following why. If I wanted to change the paperweight version number, for example, that would go into (and rewrite the history of) a previous commit?

static urchin
#

Oh

#

they aren#t actually on this repo skully

#

jmp usually just rebases those

#

at least with the userdev example

#

I guess, feel free to open a PR. Given he has not responded to the ping either, can't blame you for trying to help us out

stiff totem
#

I'll update each branch how I would normally do it, do the pull request for the main branch and mention the other branches, and y'all can do whatever you want with those

stable cove
#

Is there a similar feature in gradle?

granite valve
#

it happens automatically with gradle afaik

daring cliff
#

Reposting from #paper-dev :

Bit of a silly question, but does anyone know how to change the name of the jar generated by the reObf jar task? It always uses my submodule name which is not ideal.

My build task:
build {
dependsOn(reobfJar)
}

Usually I would do something like:
jar {
archiveBaseName.set("TestName")
}

Edit:
In addition, there are some external dependencies I need to include in the classpath for my plugin. Should I create a fat jar that includes those dependencies? If so, how can I do this in combination with the reobfJar step?

slim mauve
#

And I think you can just use normal shadow jar logic to shade dependencies?

#

paperweight-userdev automatically detects shadow and will use shadowJar as input for reobfJar. This means no extra configuration is required to use paperweight-userdev with shadow. See the shadow branch on this repository for an exmaple usage of shadow with paperweight-userdev.

#

@daring cliff

daring cliff
#

Perfect, thank you!

hardy carbon
verbal skiff
#

you are also forced to restart after updates for example

#

and like 90% of the time when you install something new, you also have to restart

worthy umbra
#

Hiya! I'm trying to build a plugin I found on GitHub, any idea what is causing this?

boreal marsh
keen idol
#

I am using paperweight to clone another project and this is what I got so far

paperweight {
    serverProject.set(project(":project-server"))
    remapRepo.set(projectMavenPublicUrl)
    decompileRepo.set(projectMavenPublicUrl)
    useStandardUpstream("name") {
        url = github("owner", "repo")
        ref = providers.gradleProperty("commit")
        withStandardPatcher {
            apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
            apiOutputDir.set(layout.projectDirectory.dir("Project-API"))
            serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
            serverOutputDir.set(layout.projectDirectory.dir("Project-Server"))
        }
    }
}

But when I run it, it keeps printing kotlin org.gradle.execution.TaskSelectionException: Task 'prepareForDownstream' not found in project ':name' and its subprojects.
As I am completely new to paperweight and cannot find any documentation I am a bit overwhelmed by this. Sure I know what the error "means" but I have no idea how or where to create such a task.

lament scarab
#

er

#

define "another project"

keen idol
#

Bungeecord

versed valve
#
A problem occurred configuring project ':naturerevive-spigot:nms:nms-1_17'.
> Cannot set the value of property 'downloadService' of type io.papermc.paperweight.DownloadService using a provider of type io.papermc.paperweight.DownloadService.```
I'm trying to build a project that uses paperweight and I get this error
acoustic belfry
#

Error downloading original jar
java.io.FileNotFoundException: https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at java.base/java.net.URL.openStream(URL.java:1161)
at org.apache.commons.io.FileUtils.copyURLToFile(FileUtils.java:1460)
at com.destroystokyo.paperclip.Paperclip.main(Paperclip.java:90)

acoustic belfry
distant mango
#

that is 1.8.8

#

wrong channel

#

and the endpoint that had 1.8.8 got changed

acoustic belfry
distant mango
#

#paper-help normally but, 1.8.8 and 1.12.2 are not supported

keen idol
lament scarab
#

Bungee also doesn't use gradle, and so you'd probably just wanna copy what waterfall does

versed valve
# lament scarab Paperweight is designed for working with projects which use paperweight
A problem occurred configuring project ':naturerevive-spigot:nms:nms-1_17'.
> Cannot set the value of property 'downloadService' of type io.papermc.paperweight.DownloadService using a provider of type io.papermc.paperweight.DownloadService.```

I'm trying to build a project that uses paperweight and I get this error
https://pastebin.com/uB9vgQ34
This is the build file
lament scarab
#

Please don’t randomly reply to me for the sake of pinging me

distant mango
#

why do you have spigot api

pulsar herald
#

Hello there, I have a multi module project with a Core module depending on paperweight-userdev, and a Plugin module that just uses Paper
I also have an API module but I've had no problems combining that.
My problems come from me combining core and plugin into a final jar, I have tried this in my shadowJar task:
dependsOn(project(":Parabots-Core").tasks.getByName("reobfJar"))
But I've checked the output classes and they still use mojang mappings (giving me exceptions)

Where have I missed a step 🙂

#

Currently have my shadowJar and final publish tasks in the Plugin module

lament scarab
#

You'd sepcify the configuration for the project

#

Setting depends on just says that it depends on a task running, it doesn't automatically consume the output of that (afaik)

pulsar herald
#

Thanks, I just need a little more help setting up the config for that:
I have:
configurations {
create("reobfCfg")
}

But setting the config to have just the reobfJar's output, I haven't been able to figure out the correct syntax

lament scarab
#

You don’t setup a confit, paperweight already does that

keen idol
distant mango
#

look at the paperweight-examples repository

#

i believe it’s called

lament scarab
#

I mean, paperweight is intended for paper and all the stuff that entails

#

It’s literally useless for random software

#

Use git patcher

keen idol
distant mango
#

paperweight?

#

no

lament scarab
#

Once again, the tooling is intended for paper

#

The entire thing is solely wired up for the process of decompiling a mojang server jar, etc,etc

#

Gitpatcher is a plug-in which purely exists to handle patches

distant mango
keen idol
#

Thanks for the help guys. I think I'll go with gitpatcher then. ^^

pulsar herald
#

'REMAPPER_CONFIG' is this the one? Not home yet so can't test, just looked thru the repo

lament scarab
#

No, the project thing

#

That method thing

#

Has a configuration arg iirc

#

Was either reobfJar or reobf

#

On a tablet with 0.5 eyes

pulsar herald
#

So project("My-Core:reobf") ?

#

Or Jar haha if it's that one

lament scarab
#

No

#

It’s an extra argument

#

Proeject(“”, config = blah ) or something like that

pulsar herald
#

Got it ty

paper kestrel
#

is there any nasty side effects that im not seeing by setting the gradle property "publishDevBundle" in the paper repo, changing the dev bundle artifact id, and publishing to maven local for testing a pr (brig command pr to be exact)

#

the only thing maybe is using the wrong version of the stuff, probably cause i dont know how the dev bundles work. are all the patches / whatever inside the dev bundle, or does it need to resolve other artifacts as well (and can i change them so they stay seperate?)

#

alright when i tried getting it to change the api and mojang api coords it didnt work, so im guessing the custom dev bundle name is still resolving from offical paper repos (or the otherway round, and this way will interfer if i want to build against offical paper)

cunning glen
#

Is it possible to add paper through paperweight-userdev to a specific gradle configuration? Nevermind, I got it working.

cold spindle
#

How do I commit to the server/api repo when using paperweight without submodules?

#

IntelliJ always makes me commit to the root repo thingy

distant mango
#

don't use intellij to make the commits

cold spindle
#

Git command line?

lament scarab
#

Yes

#

I mean, that's how I do it

cold spindle
#

Ok, I'll use submodules

#

Thank you

lament scarab
#

ik mini often uses the VCS UI, but, er

cold spindle
#

Nah, I have to work with people on this who don't really know what they're doing. I can't subject them to that

lament scarab
#

pretty sure the submodule less thing still sets up submodules

#

it just doesn't expect the paper repo its consuming to be already added as a git submodule it needs to checkout and manage like that

cold spindle
#

It might have just been glitched because I'm renaming things

cold spindle
#

Now my userdev-bundle is weird. It says it can't decompile, but those classes I didn't touch. https://pastes.dev/q6c5wSael5
All I did was steal the SlimeWorld format patch from https://github.com/InfernalSuite/AdvancedSlimePaper/

GitHub

Advanced Slime World Manager as a Paper Fork. Contribute to InfernalSuite/AdvancedSlimePaper development by creating an account on GitHub.

#

I already checked, toolchain is on Java 17

distant mango
#

what's the gradle error

cold spindle
lament scarab
#

and the log file?

#

oh

#

general advice is to look at the thing and see what blew up

lament scarab
#

make sure that you're using the sane decmpiler + version as paper

cold spindle
#

I also checked again, I do use the classes a bit, so the decompiler might not like that.

lament scarab
#

well, big one is that you need to make sure that you're using the same decompiler as paper otherwise your dev bundle might decompile something diff

#

otherwise, not sure, no means to test, etc

cold spindle
#

Yep, the decompiler version was it

#

thanks again

hardy harbor
#

Howdy!
I'm working on a conventions plugin for a multi-module gradle project, migrating from Spigot to Paper. I can't seem to crack the right layout/syntax to get the paper dev-bundle working for the plugin modules.
I can get the script building by providing the plugin id and version in buildSrc's build.gradle and declaring the paperweightDevelopmentBundle in the dependencies, but it doesn't appear to apply to the subsequent implementation of the convention script itself.
And attempting to apply the paperweightDevelopmentBundle within the convention script yields errors concerning declaring a versioned plugin:
Invalid plugin request [id: 'io.papermc.paperweight.userdev', version: '1.5.5']. Plugin requests from precompiled scripts must not include a version number...,
but this version is required it seems to get the dependency to resolve.
In other words, I can only get the paperweightDevelopmentBundle to build by declaring it in buildSrc:build.gradle, but that does not appear to have bearing on the library-conventions script, or any plugin modules that reference it.
Bit niche, just wondering if anyone has tackled this problem previously

frozen berry
hardy harbor
#

Oh, thank you thank you! Its not quite the same, but the handling of it in the multi-module context might be enough clues to figure it out

lament scarab
#

your issue is that you defined a plugin version

#

iirc, you'd basically add that as a build script dependency or something, I don't remember the specifics though

hardy harbor
#

Hm, ok. The problem was, when I supplied no version, it would produce: Plugin [id: 'io.papermc.paperweight.userdev'] was not found in any of the following sources:, however with the version, it resolves just fine

lament scarab
#

you need to add the library to the dependencies for the precompiled scripts

#

the entire notion is that it cannot pull that stuff in at that phase, it needs to be there earlier

#

but, it can apply it

hardy harbor
#

Mmm, I may not be doing what I thought I was then...

hardy harbor
#

I'm sorry, I'm feeling incredibly stupid right now...
https://pastes.io/trgadco2sk
https://pastes.io/holvor9bls
Am I even remotely on the right track here?
The dependencies for the precompiled scripts are declared in the build.gradle if I understand correctly?
The library that I need to add there though, that might be what I'm not getting right.
The second paste is the convention file, and you're saying I can apply the plugin there, if its already in the dependencies?

hardy carbon
distant mango
#

worldguard is on version 7.1.0-SNAPSHOT rn

#

7.0.9 is the latest release

hardy carbon
#

latest file on bukkit is 7.0.9-dist

distant mango
#

you're using 1.0.1 lol

hardy carbon
#

I made a mistake with finding the core lol

#

Same error still Factory:main: Could not find com.sk89q.worldguard:worldguard-bukkit:7.0.9-dist.

#

Rest is same

distant mango
#

remove the dist

smoky violet
#

rebasing would end up making more conflicts in the long run due to how much they differ

#

the test-plugin is the one I rebase and force push

#

if you want to handle updating it, that's fine with me as long as you go through that process for the other branches

#

can compare some of the upstream/version update commits I've pushed in the past to see the differences; the main annoying thing is half use submodules and half don't, and half have mojangapi and half don't

south fossil
#

When using gradle, what's the difference between gradle task: build and idea's build?

lament scarab
#

if IJs build button calls gradle, nothing

#

otherwise, it would be using IJs built in compiler which is entirely detatched

#

it does try to derive some aspects of the configuration from the build system, but, I wouldn't rely on it

south fossil
#

I see. thank you

south fossil
#

So, I set up a command in paper-plugin.yml, but getCommand() returns null

#

I think gradle may forgot to pack .yml into .jar

#

Can someone take a look?

distant mango
#

what can’t use the command plugin with paper plugins

#

use the command map or a command framework

south fossil
distant mango
#

or something like cloud

south fossil
proud jay
#

then...

south fossil
south fossil
#

line 10 is the .register one

distant mango
#

send logs

#

also

south fossil
#

right sorry

south fossil