diff --git a/bootstrap/mod/build.gradle.kts b/bootstrap/mod/build.gradle.kts index c43f123ec..074b45bb6 100644 --- a/bootstrap/mod/build.gradle.kts +++ b/bootstrap/mod/build.gradle.kts @@ -2,9 +2,9 @@ plugins { id("geyser.modded-conventions") } -architectury { - common("neoforge", "fabric") -} +//architectury { +// common("neoforge", "fabric") +//} loom { mixin.defaultRefmapName.set("geyser-refmap.json") diff --git a/bootstrap/mod/fabric/build.gradle.kts b/bootstrap/mod/fabric/build.gradle.kts index 5b66e0f37..b4d8046b4 100644 --- a/bootstrap/mod/fabric/build.gradle.kts +++ b/bootstrap/mod/fabric/build.gradle.kts @@ -3,9 +3,28 @@ plugins { id("geyser.modrinth-uploading-conventions") } -architectury { - platformSetupLoomIde() - fabric() +//architectury { +// platformSetupLoomIde() +// fabric() +//} + +loom { + mods { + create("geyser-fabric") { + sourceSet(sourceSets.main.get()) + sourceSet("main", projects.mod) + sourceSet("main", projects.core) + } + } +} + +fabricApi { + configureTests { + createSourceSet = true + modId = "geyser-gametest" + enableClientGameTests = false + eula = true + } } dependencies { @@ -13,7 +32,7 @@ dependencies { modApi(libs.fabric.api) api(project(":mod", configuration = "namedElements")) - shadowBundle(project(path = ":mod", configuration = "transformProductionFabric")) + //shadowBundle(project(path = ":mod", configuration = "transformProductionFabric")) shadowBundle(projects.core) includeTransitive(projects.core) @@ -37,14 +56,14 @@ dependencies { include(libs.fabric.permissions.api) } -tasks.withType { - manifest.attributes["Main-Class"] = "org.geysermc.geyser.platform.fabric.GeyserFabricMain" -} - relocate("org.cloudburstmc.netty") relocate("org.cloudburstmc.protocol") tasks { + jar { + manifest.attributes["Main-Class"] = "org.geysermc.geyser.platform.fabric.GeyserFabricMain" + } + remapJar { archiveBaseName.set("Geyser-Fabric") } @@ -52,6 +71,19 @@ tasks { remapModrinthJar { archiveBaseName.set("geyser-fabric") } + + getByName("processGametestResources", ProcessResources::class) { + filesMatching("fabric.mod.json") { + expand( + "id" to "geyser", + "name" to "Geyser", + "version" to project.version, + "description" to project.description, + "url" to "https://geysermc.org", + "author" to "GeyserMC" + ) + } + } } modrinth { diff --git a/bootstrap/mod/fabric/gradle.properties b/bootstrap/mod/fabric/gradle.properties deleted file mode 100644 index 90ee7a259..000000000 --- a/bootstrap/mod/fabric/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -loom.platform=fabric \ No newline at end of file diff --git a/bootstrap/mod/fabric/src/gametest/java/org/geysermc/geyser/gametest/GeyserGameTest.java b/bootstrap/mod/fabric/src/gametest/java/org/geysermc/geyser/gametest/GeyserGameTest.java new file mode 100644 index 000000000..73aaec820 --- /dev/null +++ b/bootstrap/mod/fabric/src/gametest/java/org/geysermc/geyser/gametest/GeyserGameTest.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2025 GeyserMC. http://geysermc.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC + * @link https://github.com/GeyserMC/Geyser + */ + +package org.geysermc.geyser.gametest; + +public class GeyserGameTest { + // TODO actually add gametests +} diff --git a/bootstrap/mod/fabric/src/gametest/resources/fabric.mod.json b/bootstrap/mod/fabric/src/gametest/resources/fabric.mod.json new file mode 100644 index 000000000..246352046 --- /dev/null +++ b/bootstrap/mod/fabric/src/gametest/resources/fabric.mod.json @@ -0,0 +1,13 @@ +{ + "schemaVersion": 1, + "id": "geyser-gametest", + "version": "1.0.0", + "name": "Geyser-GameTest", + "icon": "assets/geyser/icon.png", + "environment": "*", + "entrypoints": { + "fabric-gametest": [ + "org.geysermc.geyser.gametest.GeyserGameTest" + ] + } +} diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index b87490880..a71c5ec56 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -22,7 +22,8 @@ dependencies { implementation(libs.lombok) implementation(libs.indra) implementation(libs.shadow) - implementation(libs.architectury.plugin) - implementation(libs.architectury.loom) + //implementation(libs.architectury.plugin) + //implementation(libs.architectury.loom) + implementation("fabric-loom:fabric-loom.gradle.plugin:1.12.0-alpha.45") implementation(libs.minotaur) } diff --git a/build-logic/src/main/kotlin/geyser.modded-conventions.gradle.kts b/build-logic/src/main/kotlin/geyser.modded-conventions.gradle.kts index 903d82258..4554a226a 100644 --- a/build-logic/src/main/kotlin/geyser.modded-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/geyser.modded-conventions.gradle.kts @@ -5,8 +5,9 @@ import org.gradle.kotlin.dsl.dependencies plugins { id("geyser.platform-conventions") - id("architectury-plugin") - id("dev.architectury.loom") + //id("architectury-plugin") + //id("dev.architectury.loom") + id("fabric-loom") } // These are provided by Minecraft/modded platforms already, no need to include them @@ -39,13 +40,13 @@ provided("org.ow2.asm", "asm") provided("org.incendo", ".*") provided("io.leangen.geantyref", "geantyref") -architectury { - minecraft = libs.minecraft.get().version as String -} +//architectury { +// minecraft = libs.minecraft.get().version as String +//} -loom { - silentMojangMappingsLicense() -} +//loom { +// silentMojangMappingsLicense() +//} indra { javaVersions { diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 5c7f34499..acb7f1ea9 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -4,6 +4,8 @@ plugins { alias(libs.plugins.blossom) id("geyser.publish-conventions") id("io.freefair.lombok") + // Allows gametests/fabric runServer task to work correctly + id("net.fabricmc.fabric-loom-companion") } dependencies { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d356a6316..9613514c2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -34,7 +34,7 @@ bungeecord-api = "1.21-R0.1" velocity = "3.4.0-SNAPSHOT" viaproxy = "3.3.2-SNAPSHOT" fabric-loader = "0.17.2" -fabric-api = "0.133.14+1.21.9" +fabric-api = "0.136.0+1.21.10" fabric-permissions-api = "0.4.1" neoforge-minecraft = "21.10.0-beta" mixin = "0.8.5" diff --git a/settings.gradle.kts b/settings.gradle.kts index 9aaf6ba59..e820f59bd 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,7 +20,7 @@ include(":ap") include(":api") include(":bungeecord") include(":fabric") -include(":neoforge") +//include(":neoforge") include(":mod") include(":spigot") include(":standalone") @@ -32,7 +32,7 @@ include(":core") // Specify project dirs project(":bungeecord").projectDir = file("bootstrap/bungeecord") project(":fabric").projectDir = file("bootstrap/mod/fabric") -project(":neoforge").projectDir = file("bootstrap/mod/neoforge") +//project(":neoforge").projectDir = file("bootstrap/mod/neoforge") project(":mod").projectDir = file("bootstrap/mod") project(":spigot").projectDir = file("bootstrap/spigot") project(":standalone").projectDir = file("bootstrap/standalone")