diff --git a/build.gradle.kts b/build.gradle.kts index 9fb0007..85079d2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,8 +2,15 @@ import org.jetbrains.kotlin.gradle.utils.extendsFrom import java.nio.charset.StandardCharsets import java.text.SimpleDateFormat import java.util.* +import dev.architectury.plugin.ArchitectPluginExtension +import net.fabricmc.loom.api.LoomGradleExtensionAPI +import net.fabricmc.loom.task.RemapJarTask +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { + // This is an Architectury repository, as such the relevant plugins are needed + id("architectury-plugin") version "3.4-SNAPSHOT" + id("dev.architectury.loom") version "1.5-SNAPSHOT" apply false // The shadow plugin is used by the fabric subproject to include dependencies // I'm temporarily using a fork of the original plugin to resolve "Unsupported java classfile major version 65" // see: https://github.com/johnrengelman/shadow/issues/911 @@ -14,19 +21,23 @@ plugins { // For generating documentation based on comments in the code id("org.jetbrains.dokka") version "1.9.10" java - // Required for NeoGradle - id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7" // For publishing the mod id("me.modmuss50.mod-publish-plugin") version "0.5.1" } val minecraftVersion: String by project +architectury { + minecraft = minecraftVersion +} + repositories { mavenCentral() } subprojects { + apply(plugin = "dev.architectury.loom") + apply(plugin = "architectury-plugin") apply(plugin = "java") apply(plugin = "kotlin") apply(plugin = "org.jetbrains.dokka") @@ -45,6 +56,10 @@ subprojects { archivesName.set("$modId-$modLoader-$minecraftVersion") } + configure { + silentMojangMappingsLicense() + } + extensions.configure { toolchain.languageVersion.set(JavaLanguageVersion.of(17)) withSourcesJar() @@ -52,7 +67,7 @@ subprojects { repositories { mavenCentral() - maven(url = "https://maven.neoforged.net/releases/") + maven(url = "https://maven.architectury.dev/") maven("https://repo.spongepowered.org/repository/maven-public/") { name = "Sponge / Mixin" } maven("https://maven.blamejared.com") { name = "BlameJared Maven (JEI / CraftTweaker / Bookshelf)" } // For the parchment mappings @@ -79,25 +94,43 @@ subprojects { val shadowBotDep by configurations.creating { isTransitive = true } - // Configuration for JiJ-ed dependencies - val includeBotDep by configurations.creating { - isTransitive = false + // This shadowCommon configuration is used to shade the + // common project + val shadowCommon by configurations.creating { + isCanBeConsumed = false + isCanBeResolved = true } // Configuration for libraries that are needed at runtime val runtimeLib by configurations.creating { isTransitive = true } configurations.implementation.extendsFrom(configurations.named("shadowBotDep")) - configurations.implementation.extendsFrom(configurations.named("includeBotDep")) configurations.implementation.extendsFrom(configurations.named("runtimeLib")) dependencies { + // Minecraft Mod dependencies + "minecraft"("::$minecraftVersion") + + @Suppress("UnstableApiUsage") + "mappings"(project.the().layered { + val parchmentVersion: String by project + + officialMojangMappings() + + parchment( + create( + group = "org.parchmentmc.data", + name = "parchment-$minecraftVersion", + version = parchmentVersion + ) + ) + }) + runtimeLib("org.xerial:sqlite-jdbc:$sqliteJDBCVersion") - includeBotDep("org.xerial:sqlite-jdbc:$sqliteJDBCVersion") + if (!isCommon) "include"("org.xerial:sqlite-jdbc:$sqliteJDBCVersion") runtimeLib("org.commonmark:commonmark:$commonmarkVersion") - includeBotDep("org.commonmark:commonmark:$commonmarkVersion") - + if (!isCommon) "include"("org.commonmark:commonmark:$commonmarkVersion") arrayOf( // Library used to communicate with Discord, see https://jda.wiki @@ -134,6 +167,9 @@ subprojects { } tasks.jar { + // Results in the not remapped jars having a -dev at the end + archiveClassifier.set("dev") + from(rootProject.file("LICENSE")) { rename { "${it}_$modId" } } @@ -157,34 +193,28 @@ subprojects { tasks.processResources { val version: String by project val group: String by project - val minecraftVersionRange: String by project val fabricApiVersion: String by project val fabricLoaderVersion: String by project val fabricKotlinVersion: String by project - val neoVersion: String by project - val neoVersionRange: String by project - val kffLoaderRange: String by project val license: String by project val description: String by project val credits: String by project + val title: String by project val expandProps = mapOf( "version" to version, "group" to group, //Else we target the task's group. "minecraft_version" to minecraftVersion, - "minecraft_version_range" to minecraftVersionRange, "fabric_version" to fabricApiVersion, "fabric_loader_version" to fabricLoaderVersion, "fabric_kotlin_version" to fabricKotlinVersion, - "neoforge_version" to neoVersion, - "neoforge_loader_version_range" to neoVersionRange, - "kff_loader_range" to kffLoaderRange, "mod_name" to modName, "mod_author" to modAuthor, "mod_id" to modId, "license" to license, "description" to description, - "credits" to credits + "credits" to credits, + "title" to title ) filesMatching(listOf("pack.mcmeta", "*.mixins.json", "META-INF/mods.toml", "fabric.mod.json")) { @@ -193,12 +223,52 @@ subprojects { inputs.properties(expandProps) } - if (isCommon) { - sourceSets.main.get().resources.srcDir("src/main/generated/resources") - } else { - dependencies { - implementation(project(":common")) + if (!isCommon) { + apply(plugin = "io.github.goooler.shadow") + + configure { + platformSetupLoomIde() } + + tasks { + named("shadowJar") { + archiveClassifier.set("dev-shadow") + + configurations = listOf(shadowBotDep, shadowCommon) + + // This transforms the service files to make relocated Exposed work (see: https://github.com/JetBrains/Exposed/issues/1353) + mergeServiceFiles() + + // Relocating Exposed somewhere different so other mods not doing that don't run into issues (e.g. Ledger) + relocate("org.jetbrains.exposed", "dev.erdragh.shadowed.org.jetbrains.exposed") + + // Forge restricts loading certain classes for security reasons. + // Luckily, shadow can relocate them to a different package. + relocate("org.apache.commons.collections4", "dev.erdragh.shadowed.org.apache.commons.collections4") + + // Relocating jackson to prevent incompatibilities with other mods also bundling it (e.g. GroovyModLoader on Forge) + relocate("com.fasterxml.jackson", "dev.erdragh.shadowed.com.fasterxml.jackson") + + exclude(".cache/**") //Remove datagen cache from jar. + exclude("**/astralbot/datagen/**") //Remove data gen code from jar. + exclude("**/org/slf4j/**") + + exclude("kotlinx/**") + exclude("_COROUTINE/**") + exclude("**/org/jetbrains/annotations/*") + exclude("**/org/intellij/**") + } + + named("remapJar") { + inputFile.set(named("shadowJar").get().archiveFile) + dependsOn("shadowJar") + // Results in the remapped jar not having any extra bit in + // its file name, identifying it as the main distribution + archiveClassifier.set(null as String?) + } + } + } else { + sourceSets.main.get().resources.srcDir("src/main/generated/resources") } // Disables Gradle's custom module metadata from being published to maven. The diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 8a1ee68..74e9fcb 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -1,36 +1,14 @@ -plugins { - idea - java - `maven-publish` - id ("org.spongepowered.gradle.vanilla") version "0.2.1-SNAPSHOT" -} - -val minecraftVersion: String by project -val modId: String by project - -minecraft { - version(minecraftVersion) - if (file("src/main/resources/${modId}.accesswidener").exists()) - accessWideners(file("src/main/resources/${modId}.accesswidener")) +architectury { + val enabledPlatforms: String by rootProject + common(enabledPlatforms.split(",")) } dependencies { val fabricLoaderVersion: String by project val forgeConfigAPIVersion: String by project + // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies + // Do NOT use other classes from fabric loader + modImplementation("net.fabricmc:fabric-loader:${fabricLoaderVersion}") - api("fuzs.forgeconfigapiport:forgeconfigapiport-common-neoforgeapi:$forgeConfigAPIVersion") - compileOnly("org.spongepowered:mixin:0.8.5") -} - -publishing { - publications { - register("mavenJava", MavenPublication::class) { - artifactId = base.archivesName.get() - from(components["java"]) - } - } - - repositories { - maven("file://${System.getenv("local_maven")}") - } + api("fuzs.forgeconfigapiport:forgeconfigapiport-common:$forgeConfigAPIVersion") } \ No newline at end of file diff --git a/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotConfig.kt b/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotConfig.kt index f79246d..d6921aa 100644 --- a/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotConfig.kt +++ b/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotConfig.kt @@ -2,7 +2,7 @@ package dev.erdragh.astralbot.config import dev.erdragh.astralbot.LOGGER import dev.erdragh.astralbot.commands.discord.allCommands -import net.neoforged.neoforge.common.ModConfigSpec +import net.minecraftforge.common.ForgeConfigSpec import java.net.URL /** @@ -12,89 +12,89 @@ import java.net.URL * @author Erdragh */ object AstralBotConfig { - val SPEC: ModConfigSpec + val SPEC: ForgeConfigSpec /** * If the `DISCORD_TOKEN` environment variable isn't set, the bot will * look for a token in this config option. */ - val DISCORD_TOKEN: ModConfigSpec.ConfigValue + val DISCORD_TOKEN: ForgeConfigSpec.ConfigValue /** * Whether the default whitelisting process is respected or ignored. * Setting this to `true` will *force* every user who wants to join * the server to link their account, even Operators. */ - val REQUIRE_LINK_FOR_WHITELIST: ModConfigSpec.BooleanValue + val REQUIRE_LINK_FOR_WHITELIST: ForgeConfigSpec.BooleanValue /** * The link to the Discord servers where users can run the /link command. * Gets used when formatting the message shown to users who try to log in * without being whitelisted. */ - val DISCORD_LINK: ModConfigSpec.ConfigValue + val DISCORD_LINK: ForgeConfigSpec.ConfigValue /** * The ID of the discord channel where the messages are synchronized */ - val DISCORD_CHANNEL: ModConfigSpec.ConfigValue + val DISCORD_CHANNEL: ForgeConfigSpec.ConfigValue /** * The ID of the Discord Guild (server) where this bot will be active. * This is used to get the chat sync channel etc. */ - val DISCORD_GUILD: ModConfigSpec.ConfigValue + val DISCORD_GUILD: ForgeConfigSpec.ConfigValue /** * The ID of the Discord role given to linked members */ - val DISCORD_ROLE: ModConfigSpec.ConfigValue + val DISCORD_ROLE: ForgeConfigSpec.ConfigValue /** * If this is set to true the message sent into the Minecraft chat * will be clickable and take you to the relevant message on Discord */ - val CLICKABLE_MESSAGES: ModConfigSpec.BooleanValue + val CLICKABLE_MESSAGES: ForgeConfigSpec.BooleanValue /** * If this is on the embeds and attached files on a message will be * handled and possibly displayed in messages sent to the players */ - val HANDLE_EMBEDS: ModConfigSpec.BooleanValue + val HANDLE_EMBEDS: ForgeConfigSpec.BooleanValue /** * If this is on embeds that have a URL associated with them will * be clickable. */ - val CLICKABLE_EMBEDS: ModConfigSpec.BooleanValue + val CLICKABLE_EMBEDS: ForgeConfigSpec.BooleanValue /** * List of Strings containing the URLs that are blocked by default. * If you read this and want to add more to the default list, feel * free to open an Issue or Pull Request. */ - private val URL_BLOCKLIST: ModConfigSpec.ConfigValue> + private val URL_BLOCKLIST: ForgeConfigSpec.ConfigValue> /** * List of the names of the commands that are enabled by default. * On first startup of a server, it will be all available commands. */ - val ENABLED_COMMANDS: ModConfigSpec.ConfigValue> + val ENABLED_COMMANDS: ForgeConfigSpec.ConfigValue> /** * Enables parsing Discord messages into Minecraft's Chat Components. * This includes making links clickable, etc. */ - val ENABLE_MARKDOWN_PARSING: ModConfigSpec.BooleanValue + val ENABLE_MARKDOWN_PARSING: ForgeConfigSpec.BooleanValue /** * Enables converting detected URLs into clickable links, requires * [ENABLE_MARKDOWN_PARSING] to be enabled to do anything */ - val ENABLE_AUTO_LINKS: ModConfigSpec.BooleanValue + val ENABLE_AUTO_LINKS: ForgeConfigSpec.BooleanValue init { - val builder = ModConfigSpec.Builder() + val builder = ForgeConfigSpec.Builder() builder.comment("AstralBot Config") diff --git a/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotTextConfig.kt b/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotTextConfig.kt index b052323..b41b8b5 100644 --- a/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotTextConfig.kt +++ b/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotTextConfig.kt @@ -1,42 +1,42 @@ package dev.erdragh.astralbot.config -import net.neoforged.neoforge.common.ModConfigSpec +import net.minecraftforge.common.ForgeConfigSpec object AstralBotTextConfig { - val SPEC: ModConfigSpec + val SPEC: ForgeConfigSpec - val GENERIC_ERROR: ModConfigSpec.ConfigValue - val GENERIC_SUCCESS: ModConfigSpec.ConfigValue - val GENERIC_BLOCKED: ModConfigSpec.ConfigValue + val GENERIC_ERROR: ForgeConfigSpec.ConfigValue + val GENERIC_SUCCESS: ForgeConfigSpec.ConfigValue + val GENERIC_BLOCKED: ForgeConfigSpec.ConfigValue - val FAQ_ERROR: ModConfigSpec.ConfigValue - val FAQ_NO_REGISTERED: ModConfigSpec.ConfigValue + val FAQ_ERROR: ForgeConfigSpec.ConfigValue + val FAQ_NO_REGISTERED: ForgeConfigSpec.ConfigValue - val TICK_REPORT: ModConfigSpec.ConfigValue + val TICK_REPORT: ForgeConfigSpec.ConfigValue - val PLAYER_MESSAGE: ModConfigSpec.ConfigValue + val PLAYER_MESSAGE: ForgeConfigSpec.ConfigValue - val DISCORD_MESSAGE: ModConfigSpec.ConfigValue - val DISCORD_REPLY: ModConfigSpec.ConfigValue - val DISCORD_EMBEDS: ModConfigSpec.ConfigValue + val DISCORD_MESSAGE: ForgeConfigSpec.ConfigValue + val DISCORD_REPLY: ForgeConfigSpec.ConfigValue + val DISCORD_EMBEDS: ForgeConfigSpec.ConfigValue - val RELOAD_ERROR: ModConfigSpec.ConfigValue - val RELOAD_SUCCESS: ModConfigSpec.ConfigValue + val RELOAD_ERROR: ForgeConfigSpec.ConfigValue + val RELOAD_SUCCESS: ForgeConfigSpec.ConfigValue - val LINK_NO_MINECRAFT: ModConfigSpec.ConfigValue - val LINK_MINECRAFT_TAKEN: ModConfigSpec.ConfigValue - val LINK_DISCORD_TAKEN: ModConfigSpec.ConfigValue - val LINK_SUCCESSFUL: ModConfigSpec.ConfigValue - val LINK_ERROR: ModConfigSpec.ConfigValue + val LINK_NO_MINECRAFT: ForgeConfigSpec.ConfigValue + val LINK_MINECRAFT_TAKEN: ForgeConfigSpec.ConfigValue + val LINK_DISCORD_TAKEN: ForgeConfigSpec.ConfigValue + val LINK_SUCCESSFUL: ForgeConfigSpec.ConfigValue + val LINK_ERROR: ForgeConfigSpec.ConfigValue - val LINK_COMMAND_MESSAGE: ModConfigSpec.ConfigValue - val LINK_COMMAND_ALREADY_LINKED: ModConfigSpec.ConfigValue + val LINK_COMMAND_MESSAGE: ForgeConfigSpec.ConfigValue + val LINK_COMMAND_ALREADY_LINKED: ForgeConfigSpec.ConfigValue - val UNLINK_UNLINKED: ModConfigSpec.ConfigValue - val UNLINK_NOPERMS: ModConfigSpec.ConfigValue + val UNLINK_UNLINKED: ForgeConfigSpec.ConfigValue + val UNLINK_NOPERMS: ForgeConfigSpec.ConfigValue init { - val builder = ModConfigSpec.Builder() + val builder = ForgeConfigSpec.Builder() val whitespaceRegex = Regex("\n[ \t]+") GENERIC_ERROR = builder.comment("Generic error message sent to Discord") diff --git a/common/src/main/kotlin/dev/erdragh/astralbot/handlers/MinecraftHandler.kt b/common/src/main/kotlin/dev/erdragh/astralbot/handlers/MinecraftHandler.kt index 32b65f9..326604b 100644 --- a/common/src/main/kotlin/dev/erdragh/astralbot/handlers/MinecraftHandler.kt +++ b/common/src/main/kotlin/dev/erdragh/astralbot/handlers/MinecraftHandler.kt @@ -16,7 +16,6 @@ import net.minecraft.network.chat.Component import net.minecraft.network.chat.HoverEvent import net.minecraft.network.chat.MutableComponent import net.minecraft.server.MinecraftServer -import net.minecraft.server.level.ClientInformation import net.minecraft.server.level.ServerPlayer import net.minecraft.world.item.ItemStack import java.text.DecimalFormat @@ -32,7 +31,7 @@ import kotlin.math.min */ class MinecraftHandler(private val server: MinecraftServer) : ListenerAdapter() { private val playerNames = HashSet(server.maxPlayers); - private val notchPlayer = byName("Notch")?.let { ServerPlayer(this.server, this.server.allLevels.elementAt(0), it, ClientInformation.createDefault()) } + private val notchPlayer = byName("Notch")?.let { ServerPlayer(this.server, this.server.allLevels.elementAt(0), it) } companion object { @@ -84,12 +83,12 @@ class MinecraftHandler(private val server: MinecraftServer) : ListenerAdapter() */ fun tickReport(): String { // Idea from the TPSCommand in Forge - return AstralBotTextConfig.TICK_REPORT.get().replace("{{mspt}}", numberFormat.format(server.averageTickTimeNanos * 1000)) + return AstralBotTextConfig.TICK_REPORT.get().replace("{{mspt}}", numberFormat.format(server.averageTickTime * 1000)) .replace( "{{tps}}", numberFormat.format( min( 20.0, - 1000.0 / (server.averageTickTimeNanos * 1000) + 1000.0 / (server.averageTickTime * 1000) ) ) ) diff --git a/common/src/main/kotlin/dev/erdragh/astralbot/util/MessageFormatting.kt b/common/src/main/kotlin/dev/erdragh/astralbot/util/MessageFormatting.kt index 7f8d755..646250a 100644 --- a/common/src/main/kotlin/dev/erdragh/astralbot/util/MessageFormatting.kt +++ b/common/src/main/kotlin/dev/erdragh/astralbot/util/MessageFormatting.kt @@ -100,7 +100,7 @@ fun formatHoverItems(stack: ItemStack, knownItems: MutableList, playe fun formatHoverEntity(entity: HoverEvent.EntityTooltipInfo): MessageEmbed? { if (entity.type == EntityType.PLAYER) return null return EmbedBuilder() - .setTitle(entity.name.map(Component::getString).getOrNull()) + .setTitle(entity.name?.toFlatList()?.joinToString(transform = Component::getString)) .setDescription(entity.type.description.string) .let { builder: EmbedBuilder -> val mobCategory = entity.type.category diff --git a/common/src/main/resources/astralbot-common.mixins.json b/common/src/main/resources/astralbot-common.mixins.json index c26658d..215a460 100644 --- a/common/src/main/resources/astralbot-common.mixins.json +++ b/common/src/main/resources/astralbot-common.mixins.json @@ -3,7 +3,6 @@ "minVersion": "0.8", "package": "dev.erdragh.astralbot.mixins", "compatibilityLevel": "JAVA_17", - "refmap": "${mod_id}.refmap.json", "server": [ "PlayerListMixin", "DedicatedPlayerListMixin" diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts index 27050bf..bf2a5fb 100644 --- a/fabric/build.gradle.kts +++ b/fabric/build.gradle.kts @@ -4,121 +4,35 @@ import me.modmuss50.mpp.platforms.curseforge.CurseforgeOptions import me.modmuss50.mpp.platforms.modrinth.ModrinthOptions import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -plugins { - java - idea - `maven-publish` - id("fabric-loom") version "1.6-SNAPSHOT" - id("io.github.goooler.shadow") - id("me.modmuss50.mod-publish-plugin") +architectury { + fabric() } -val modId: String by project - -val includeBotDep: Configuration by configurations.getting -val shadowBotDep: Configuration by configurations.getting +val common: Configuration by configurations.creating { + configurations.compileClasspath.get().extendsFrom(this) + configurations.runtimeClasspath.get().extendsFrom(this) + configurations["developmentFabric"].extendsFrom(this) +} dependencies { - mappings(loom.officialMojangMappings()) + common(project(":common", configuration = "namedElements")) { + isTransitive = false + } + shadowCommon(project(path = ":common", configuration = "transformProductionFabric")) { + isTransitive = false + } + val minecraftVersion: String by project val fabricLoaderVersion: String by project val fabricApiVersion: String by project val fabricKotlinVersion: String by project val forgeConfigAPIVersion: String by project - minecraft("com.mojang:minecraft:${minecraftVersion}") - modImplementation(group = "net.fabricmc", name = "fabric-loader", version = fabricLoaderVersion) modApi(group = "net.fabricmc.fabric-api", name = "fabric-api", version = "$fabricApiVersion+$minecraftVersion") modImplementation("net.fabricmc:fabric-language-kotlin:${fabricKotlinVersion}") modApi("fuzs.forgeconfigapiport:forgeconfigapiport-fabric:$forgeConfigAPIVersion") - - includeBotDep.dependencies.forEach { include(it) } -} - -loom { - if (project(":common").file("src/main/resources/${modId}.accesswidener").exists()) - accessWidenerPath.set(project(":common").file("src/main/resources/${modId}.accesswidener")) - - @Suppress("UnstableApiUsage") - mixin { defaultRefmapName.set("${modId}.refmap.json") } - - runs { - named("client") { - client() - configName = "Fabric Client" - ideConfigGenerated(true) - runDir("run") - } - named("server") { - server() - configName = "Fabric Server" - ideConfigGenerated(true) - runDir("run") - } - } -} - -tasks { - withType { - source(project(":common").sourceSets.main.get().allSource) - } - withType { - source(project(":common").sourceSets.main.get().allSource) - } - - javadoc { source(project(":common").sourceSets.main.get().allJava) } - - jar { - archiveClassifier.set("dev") - } - - shadowJar { - archiveClassifier.set("dev-shadow") - - configurations = listOf(shadowBotDep) - - // This transforms the service files to make relocated Exposed work (see: https://github.com/JetBrains/Exposed/issues/1353) - mergeServiceFiles() - - // Relocating Exposed somewhere different so other mods not doing that don't run into issues (e.g. Ledger) - relocate("org.jetbrains.exposed", "dev.erdragh.shadowed.org.jetbrains.exposed") - - // Relocating jackson to prevent incompatibilities with other mods also bundling it (e.g. GroovyModLoader on Forge) - relocate("com.fasterxml.jackson", "dev.erdragh.shadowed.com.fasterxml.jackson") - - exclude(".cache/**") //Remove datagen cache from jar. - exclude("**/astralbot/datagen/**") //Remove data gen code from jar. - exclude("**/org/slf4j/**") - - exclude("kotlinx/**") - exclude("_COROUTINE/**") - exclude("**/org/jetbrains/annotations/*") - exclude("**/org/intellij/**") - } - - remapJar { - inputFile.set(named("shadowJar").get().archiveFile) - dependsOn("shadowJar") - } - - named("sourcesJar", Jar::class) { from(project(":common").sourceSets.main.get().allSource) } - - processResources { from(project(":common").sourceSets.main.get().resources) } -} - -publishing { - publications { - register("mavenJava", MavenPublication::class) { - artifactId = base.archivesName.get() - from(components["java"]) - } - } - - repositories { - maven("file://${System.getenv("local_maven")}") - } } publishMods { diff --git a/fabric/src/main/kotlin/dev/erdragh/astralbot/fabric/BotMod.kt b/fabric/src/main/kotlin/dev/erdragh/astralbot/fabric/BotMod.kt index 890ed3e..556ae25 100644 --- a/fabric/src/main/kotlin/dev/erdragh/astralbot/fabric/BotMod.kt +++ b/fabric/src/main/kotlin/dev/erdragh/astralbot/fabric/BotMod.kt @@ -5,19 +5,19 @@ import dev.erdragh.astralbot.commands.minecraft.registerMinecraftCommands import dev.erdragh.astralbot.config.AstralBotConfig import dev.erdragh.astralbot.config.AstralBotTextConfig import dev.erdragh.astralbot.handlers.DiscordMessageComponent -import fuzs.forgeconfigapiport.fabric.api.neoforge.v4.NeoForgeConfigRegistry +import fuzs.forgeconfigapiport.api.config.v2.ForgeConfigRegistry import net.fabricmc.api.ModInitializer import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents import net.fabricmc.fabric.api.message.v1.ServerMessageEvents import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents import net.minecraft.server.level.ServerPlayer -import net.neoforged.fml.config.ModConfig +import net.minecraftforge.fml.config.ModConfig object BotMod : ModInitializer { override fun onInitialize() { - NeoForgeConfigRegistry.INSTANCE.register(MODID, ModConfig.Type.SERVER, AstralBotConfig.SPEC) - NeoForgeConfigRegistry.INSTANCE.register(MODID, ModConfig.Type.SERVER, AstralBotTextConfig.SPEC, "astralbot-text.toml") + ForgeConfigRegistry.INSTANCE.register(MODID, ModConfig.Type.SERVER, AstralBotConfig.SPEC) + ForgeConfigRegistry.INSTANCE.register(MODID, ModConfig.Type.SERVER, AstralBotTextConfig.SPEC, "astralbot-text.toml") ServerLifecycleEvents.SERVER_STARTED.register { LOGGER.info("Starting AstralBot on Fabric") diff --git a/fabric/src/main/resources/astralbot.mixins.json b/fabric/src/main/resources/astralbot.mixins.json index 2e68eba..5dfcea1 100644 --- a/fabric/src/main/resources/astralbot.mixins.json +++ b/fabric/src/main/resources/astralbot.mixins.json @@ -3,7 +3,6 @@ "minVersion": "0.8", "package": "dev.erdragh.astralbot.mixins.fabric", "compatibilityLevel": "JAVA_17", - "refmap": "${mod_id}.refmap.json", "mixins": [ ], "client": [ diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 4d4bb75..7e1d446 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -32,6 +32,6 @@ "minecraft": ">=${minecraft_version}", "java": ">=17", "fabric-language-kotlin": ">=${fabric_kotlin_version}", - "forgeconfigapiport": ">=20.0.0" + "forgeconfigapiport": ">=8.0.0" } } \ No newline at end of file diff --git a/neoforge/.gitignore b/forge/.gitignore similarity index 100% rename from neoforge/.gitignore rename to forge/.gitignore diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts new file mode 100644 index 0000000..6e43ae7 --- /dev/null +++ b/forge/build.gradle.kts @@ -0,0 +1,86 @@ +import me.modmuss50.mpp.ReleaseType +import me.modmuss50.mpp.platforms.curseforge.CurseforgeOptions +import me.modmuss50.mpp.platforms.modrinth.ModrinthOptions +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +architectury { + forge() +} + +loom { + forge { + mixinConfig("astralbot-common.mixins.json") + mixinConfig("astralbot.mixins.json") + } + // This sets up data generation. At the time of writing this + // Comment, this is useless, as there are no resources to be + // generated. I want to keep it in as a reference tho. + runs { + create("data") { + data() + programArgs("--all", "--mod", "astralbot") + programArgs("--output", project(":common").file("src/main/generated/resources").absolutePath) + programArgs("--existing", project(":common").file("src/main/resources").absolutePath) + } + } +} + +val common: Configuration by configurations.creating { + configurations.compileClasspath.get().extendsFrom(this) + configurations.runtimeClasspath.get().extendsFrom(this) + configurations["developmentForge"].extendsFrom(this) +} + +val runtimeLib by configurations.getting + +dependencies { + common(project(":common", configuration = "namedElements")) { + isTransitive = false + } + shadowCommon(project(path = ":common", configuration = "transformProductionForge")) { + isTransitive = false + } + + val minecraftVersion: String by project + val forgeVersion: String by project + val kotlinForgeVersion: String by project + + forge(group = "net.minecraftforge", name = "forge", version = "$minecraftVersion-$forgeVersion") + // Adds KFF as dependency and Kotlin libs + implementation("thedarkcolour:kotlinforforge:$kotlinForgeVersion") + + // This *should* theoretically fix the Forge development environment not having + // access to certain classes, but I haven't gotten it to work just yet. + runtimeLib.dependencies.forEach(::forgeRuntimeLibrary) +} + +publishMods { + val minecraftVersion: String by project + val title: String by project + val version: String by project + + val titles: Map by extra + val curseforgePublish: Provider by extra + val modrinthPublish: Provider by extra + + changelog = extra.get("changelog") as String + type = extra.get("type") as ReleaseType + + curseforge("curseForge") { + from(curseforgePublish) + modLoaders.add(project.name) + file.set(tasks.remapJar.get().archiveFile) + displayName = "$title $version ${titles[project.name]} $minecraftVersion" + this.version = "$version-mc$minecraftVersion-${project.name}" + requires("kotlin-for-forge") + } + + modrinth("modrinthForge") { + from(modrinthPublish) + modLoaders.add(project.name) + file.set(tasks.remapJar.get().archiveFile) + displayName = "$title $version ${titles[project.name]} $minecraftVersion" + this.version = "$version-mc$minecraftVersion-${project.name}" + requires("kotlin-for-forge") + } +} \ No newline at end of file diff --git a/forge/gradle.properties b/forge/gradle.properties new file mode 100644 index 0000000..4b5bae3 --- /dev/null +++ b/forge/gradle.properties @@ -0,0 +1,3 @@ +loom.platform=forge +forgeVersion=47.2.21 +kotlinForgeVersion=4.10.0 \ No newline at end of file diff --git a/neoforge/src/main/java/dev/erdragh/astralbot/mixins/forge/PlayerListMixin.java b/forge/src/main/java/dev/erdragh/astralbot/mixins/forge/PlayerListMixin.java similarity index 79% rename from neoforge/src/main/java/dev/erdragh/astralbot/mixins/forge/PlayerListMixin.java rename to forge/src/main/java/dev/erdragh/astralbot/mixins/forge/PlayerListMixin.java index 0ea3b04..7575879 100644 --- a/neoforge/src/main/java/dev/erdragh/astralbot/mixins/forge/PlayerListMixin.java +++ b/forge/src/main/java/dev/erdragh/astralbot/mixins/forge/PlayerListMixin.java @@ -1,14 +1,14 @@ package dev.erdragh.astralbot.mixins.forge; -import dev.erdragh.astralbot.neoforge.event.CommandMessageEvent; -import dev.erdragh.astralbot.neoforge.event.SystemMessageEvent; +import dev.erdragh.astralbot.forge.event.CommandMessageEvent; +import dev.erdragh.astralbot.forge.event.SystemMessageEvent; import net.minecraft.commands.CommandSourceStack; import net.minecraft.network.chat.ChatType; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.PlayerChatMessage; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.players.PlayerList; -import net.neoforged.neoforge.common.NeoForge; +import net.minecraftforge.common.MinecraftForge; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -20,11 +20,11 @@ public abstract class PlayerListMixin { @Inject(method = "broadcastSystemMessage(Lnet/minecraft/network/chat/Component;Ljava/util/function/Function;Z)V", at = @At("HEAD")) private void onSendGameMessage(Component message, Function playerMessageFactory, boolean overlay, CallbackInfo ci) { - NeoForge.EVENT_BUS.post(new SystemMessageEvent(message)); + MinecraftForge.EVENT_BUS.post(new SystemMessageEvent(message)); } @Inject(method = "broadcastChatMessage(Lnet/minecraft/network/chat/PlayerChatMessage;Lnet/minecraft/commands/CommandSourceStack;Lnet/minecraft/network/chat/ChatType$Bound;)V", at = @At("HEAD")) private void onSendCommandMessage(PlayerChatMessage message, CommandSourceStack source, ChatType.Bound params, CallbackInfo ci) { - NeoForge.EVENT_BUS.post(new CommandMessageEvent(message.decoratedContent())); + MinecraftForge.EVENT_BUS.post(new CommandMessageEvent(message.decoratedContent())); } } \ No newline at end of file diff --git a/neoforge/src/main/kotlin/dev/erdragh/astralbot/neoforge/BotMod.kt b/forge/src/main/kotlin/dev/erdragh/astralbot/forge/BotMod.kt similarity index 76% rename from neoforge/src/main/kotlin/dev/erdragh/astralbot/neoforge/BotMod.kt rename to forge/src/main/kotlin/dev/erdragh/astralbot/forge/BotMod.kt index 39c80df..8d65a19 100644 --- a/neoforge/src/main/kotlin/dev/erdragh/astralbot/neoforge/BotMod.kt +++ b/forge/src/main/kotlin/dev/erdragh/astralbot/forge/BotMod.kt @@ -1,22 +1,22 @@ -package dev.erdragh.astralbot.neoforge +package dev.erdragh.astralbot.forge import dev.erdragh.astralbot.* import dev.erdragh.astralbot.commands.minecraft.registerMinecraftCommands import dev.erdragh.astralbot.config.AstralBotConfig import dev.erdragh.astralbot.config.AstralBotTextConfig -import dev.erdragh.astralbot.neoforge.event.SystemMessageEvent +import dev.erdragh.astralbot.forge.event.SystemMessageEvent import dev.erdragh.astralbot.handlers.DiscordMessageComponent -import dev.erdragh.astralbot.neoforge.event.CommandMessageEvent +import dev.erdragh.astralbot.forge.event.CommandMessageEvent import net.minecraft.server.level.ServerPlayer -import net.neoforged.fml.ModLoadingContext -import net.neoforged.fml.common.Mod -import net.neoforged.fml.config.ModConfig -import net.neoforged.neoforge.event.RegisterCommandsEvent -import net.neoforged.neoforge.event.ServerChatEvent -import net.neoforged.neoforge.event.entity.player.PlayerEvent -import net.neoforged.neoforge.event.server.ServerStartedEvent -import net.neoforged.neoforge.event.server.ServerStoppingEvent -import thedarkcolour.kotlinforforge.neoforge.forge.FORGE_BUS +import net.minecraftforge.event.RegisterCommandsEvent +import net.minecraftforge.event.ServerChatEvent +import net.minecraftforge.event.entity.player.PlayerEvent +import net.minecraftforge.event.server.ServerStartedEvent +import net.minecraftforge.event.server.ServerStoppingEvent +import net.minecraftforge.fml.ModLoadingContext +import net.minecraftforge.fml.common.Mod +import net.minecraftforge.fml.config.ModConfig +import thedarkcolour.kotlinforforge.forge.FORGE_BUS @Mod("astralbot") object BotMod { @@ -35,7 +35,7 @@ object BotMod { } private fun onServerStart(event: ServerStartedEvent) { - LOGGER.info("AstralBot starting on NeoForge") + LOGGER.info("AstralBot starting on Forge") startAstralbot(event.server) } diff --git a/forge/src/main/kotlin/dev/erdragh/astralbot/forge/event/CommandMessageEvent.kt b/forge/src/main/kotlin/dev/erdragh/astralbot/forge/event/CommandMessageEvent.kt new file mode 100644 index 0000000..273aec6 --- /dev/null +++ b/forge/src/main/kotlin/dev/erdragh/astralbot/forge/event/CommandMessageEvent.kt @@ -0,0 +1,6 @@ +package dev.erdragh.astralbot.forge.event + +import net.minecraft.network.chat.Component +import net.minecraftforge.eventbus.api.Event + +class CommandMessageEvent(val message: Component) : Event() \ No newline at end of file diff --git a/forge/src/main/kotlin/dev/erdragh/astralbot/forge/event/SystemMessageEvent.kt b/forge/src/main/kotlin/dev/erdragh/astralbot/forge/event/SystemMessageEvent.kt new file mode 100644 index 0000000..cca6972 --- /dev/null +++ b/forge/src/main/kotlin/dev/erdragh/astralbot/forge/event/SystemMessageEvent.kt @@ -0,0 +1,6 @@ +package dev.erdragh.astralbot.forge.event + +import net.minecraft.network.chat.Component +import net.minecraftforge.eventbus.api.Event + +class SystemMessageEvent(var message: Component) : Event() \ No newline at end of file diff --git a/neoforge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml similarity index 54% rename from neoforge/src/main/resources/META-INF/mods.toml rename to forge/src/main/resources/META-INF/mods.toml index 4d4e7e8..3baa40f 100644 --- a/neoforge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -1,32 +1,27 @@ modLoader = "kotlinforforge" -loaderVersion = "${kff_loader_range}" +loaderVersion = "[4.6,)" license = "${license}" issueTrackerURL = "https://github.com/Erdragh/AstralBot/issues" -[[mixins]] -config = "astralbot-common.mixins.json" -[[mixins]] -config = "astralbot.mixins.json" - [[mods]] modId = "${mod_id}" version = "${version}" -displayName = "${mod_name}" +displayName = "${title}" displayURL = "https://modrinth.com/mod/astralbot" logoFile = "icon.png" -authors = "${mod_author}" +authors = "${credits}" description = "${description}" [[dependencies.${mod_id}]] -modId = "neoforge" -type = "required" -versionRange = "${neoforge_loader_version_range}" +modId = "forge" +mandatory = true +versionRange = "[47,)" ordering = "NONE" side = "BOTH" [[dependencies.${mod_id}]] modId = "minecraft" -type = "required" -versionRange = "${minecraft_version_range}" +mandatory = true +versionRange = "[1.20.1,1.20.2)" ordering = "NONE" side = "BOTH" \ No newline at end of file diff --git a/neoforge/src/main/resources/astralbot.mixins.json b/forge/src/main/resources/astralbot.mixins.json similarity index 85% rename from neoforge/src/main/resources/astralbot.mixins.json rename to forge/src/main/resources/astralbot.mixins.json index 81bac46..4b9f0a4 100644 --- a/neoforge/src/main/resources/astralbot.mixins.json +++ b/forge/src/main/resources/astralbot.mixins.json @@ -3,7 +3,6 @@ "minVersion": "0.8", "package": "dev.erdragh.astralbot.mixins.forge", "compatibilityLevel": "JAVA_17", - "refmap": "${mod_id}.refmap.json", "server": [ "PlayerListMixin" ], diff --git a/neoforge/src/main/resources/pack.mcmeta b/forge/src/main/resources/pack.mcmeta similarity index 100% rename from neoforge/src/main/resources/pack.mcmeta rename to forge/src/main/resources/pack.mcmeta diff --git a/gradle.properties b/gradle.properties index ab31f24..51e4c13 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,42 +1,33 @@ kotlin.code.style=official org.gradle.jvmargs=-Xmx3G -# Minecraft things -enabledPlatforms=fabric,neoforge - -# Fabric -fabricLoaderVersion=0.15.10 -fabricApiVersion=0.97.0 -fabricKotlinVersion=1.10.19+kotlin.1.9.23 - -# Neo -neoVersion=20.4.233 -neoVersionRange=[20.4,20.5) -kotlinForgeVersion=4.10.0 -kffLoaderRange=[4,) - +license=MIT +title=AstralBot +description=Discord Bot and Minecraft Mod in one bundle. +credits=Erdragh version=1.4.0 group=dev.erdragh.astralbot modId=astralbot modAuthor=Erdragh -license=MIT -title=AstralBot -description=Discord Bot and Minecraft Mod in one bundle. -credits=Erdragh +# Minecraft things +enabledPlatforms=fabric,forge +# Specified here because it's used in both the fabric and common subproject +fabricLoaderVersion=0.15.10 +fabricApiVersion=0.91.0 +fabricKotlinVersion=1.10.19+kotlin.1.9.23 -minecraftVersion=1.20.4 -minecraftVersionRange=[1.20.4,) -parchmentVersion=2024.04.14 +minecraftVersion=1.20.1 +parchmentVersion=2023.09.03 -forgeConfigAPIVersion=20.4.3 +forgeConfigAPIVersion=8.0.0 # Discord Interactions -jdaVersion=5.0.0-beta.24 +jdaVersion=5.0.0-beta.23 # Database Interactions -exposedVersion=0.50.1 -sqliteJDBCVersion=3.45.3.0 +exposedVersion=0.49.0 +sqliteJDBCVersion=3.44.1.0 # Message parsing commonmarkVersion=0.22.0 \ No newline at end of file diff --git a/neoforge/build.gradle.kts b/neoforge/build.gradle.kts deleted file mode 100644 index a58a14a..0000000 --- a/neoforge/build.gradle.kts +++ /dev/null @@ -1,171 +0,0 @@ -import me.modmuss50.mpp.ReleaseType -import me.modmuss50.mpp.platforms.curseforge.CurseforgeOptions -import me.modmuss50.mpp.platforms.modrinth.ModrinthOptions -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -plugins { - idea - `maven-publish` - java - id("net.neoforged.gradle.userdev") version "7.0.136" - id("io.github.goooler.shadow") -} - -val modId: String by project - -jarJar.enable() - -val includeBotDep: Configuration by configurations.getting -val shadowBotDep: Configuration by configurations.getting -val runtimeLib: Configuration by configurations.getting - -// Automatically enable neoforge AccessTransformers if the file exists -// This location is hardcoded in FML and can not be changed. -// https://github.com/neoforged/FancyModLoader/blob/a952595eaaddd571fbc53f43847680b00894e0c1/loader/src/main/java/net/neoforged/fml/loading/moddiscovery/ModFile.java#L118 -val transformerFile = file("src/main/resources/META-INF/accesstransformer.cfg") -if (transformerFile.exists()) - minecraft.accessTransformers.file(transformerFile) - -runs { - configureEach { modSource(project.sourceSets.main.get()) } - - create("client") { - systemProperty("neoforge.enabledGameTestNamespaces", modId) - - dependencies { - runtime(runtimeLib) - } - } - - create("server") { - systemProperty("neoforge.enabledGameTestNamespaces", modId) - programArgument("--nogui") - dependencies { - runtime(runtimeLib) - } - } - - create("gameTestServer") { - systemProperty("neoforge.enabledGameTestNamespaces", modId) - dependencies { - runtime(runtimeLib) - } - } - - create("data") { - programArguments.addAll( - "--mod", modId, - "--all", - "--output", file("src/generated/resources").absolutePath, - "--existing", file("src/main/resources/").absolutePath - ) - dependencies { - runtime(runtimeLib) - } - } -} - -sourceSets.main.get().resources.srcDir("src/generated/resources") - -dependencies { - val minecraftVersion: String by project - val neoVersion: String by project - val kotlinForgeVersion: String by project - - implementation(group = "net.neoforged", name = "neoforge", version = neoVersion) - // Adds KFF as dependency and Kotlin libs - implementation("thedarkcolour:kotlinforforge-neoforge:$kotlinForgeVersion") - - includeBotDep.dependencies.forEach { jarJar(it) } -} - -// NeoGradle compiles the game, but we don't want to add our common code to the game's code -val notNeoTask: Spec = Spec { !it.name.startsWith("neo") } - -tasks { - withType().matching(notNeoTask).configureEach { source(project(":common").sourceSets.main.get().allSource) } - withType().matching(notNeoTask).configureEach { - source(project(":common").sourceSets.main.get().allSource) - } - - withType().matching(notNeoTask).configureEach { source(project(":common").sourceSets.main.get().allJava) } - - shadowJar { - archiveClassifier = null - configurations = listOf(shadowBotDep) - - // This transforms the service files to make relocated Exposed work (see: https://github.com/JetBrains/Exposed/issues/1353) - mergeServiceFiles() - - // Forge restricts loading certain classes for security reasons. - // Luckily, shadow can relocate them to a different package. - relocate("org.apache.commons.collections4", "dev.erdragh.shadowed.org.apache.commons.collections4") - - // Relocating Exposed somewhere different so other mods not doing that don't run into issues (e.g. Ledger) - relocate("org.jetbrains.exposed", "dev.erdragh.shadowed.org.jetbrains.exposed") - - // Relocating jackson to prevent incompatibilities with other mods also bundling it (e.g. GroovyModLoader on Forge) - relocate("com.fasterxml.jackson", "dev.erdragh.shadowed.com.fasterxml.jackson") - - exclude(".cache/**") //Remove datagen cache from jar. - exclude("**/astralbot/datagen/**") //Remove data gen code from jar. - exclude("**/org/slf4j/**") - - exclude("kotlinx/**") - exclude("_COROUTINE/**") - exclude("**/org/jetbrains/annotations/*") - exclude("**/org/intellij/**") - } - - jarJar.configure { - dependsOn(shadowJar) - } - - named("sourcesJar", Jar::class) { from(project(":common").sourceSets.main.get().allSource) } - - processResources { from(project(":common").sourceSets.main.get().resources) } -} - -publishing { - publications { - register("mavenJava", MavenPublication::class) { - artifactId = base.archivesName.get() - artifact(tasks.jar) - } - } - - repositories { - maven("file://${System.getenv("local_maven")}") - } -} - -publishMods { - val minecraftVersion: String by project - val title: String by project - val version: String by project - - val titles: Map by extra - val curseforgePublish: Provider by extra - val modrinthPublish: Provider by extra - - changelog = extra.get("changelog") as String - type = extra.get("type") as ReleaseType - - curseforge("curseNeo") { - from(curseforgePublish) - modLoaders.add(project.name) - file.set(tasks.jarJar.get().archiveFile) - displayName = "$title $version ${titles[project.name]} $minecraftVersion" - this.version = "$version-mc$minecraftVersion-${project.name}" - requires("kotlin-for-forge") - } - - modrinth("modrinthNeo") { - from(modrinthPublish) - modLoaders.add(project.name) - file.set(tasks.jarJar.get().archiveFile) - displayName = "$title $version ${titles[project.name]} $minecraftVersion" - this.version = "$version-mc$minecraftVersion-${project.name}" - requires("kotlin-for-forge") - } -} \ No newline at end of file diff --git a/neoforge/gradle.properties b/neoforge/gradle.properties deleted file mode 100644 index e69de29..0000000 diff --git a/neoforge/src/main/kotlin/dev/erdragh/astralbot/neoforge/event/CommandMessageEvent.kt b/neoforge/src/main/kotlin/dev/erdragh/astralbot/neoforge/event/CommandMessageEvent.kt deleted file mode 100644 index a03bdf1..0000000 --- a/neoforge/src/main/kotlin/dev/erdragh/astralbot/neoforge/event/CommandMessageEvent.kt +++ /dev/null @@ -1,7 +0,0 @@ -package dev.erdragh.astralbot.neoforge.event - -import net.minecraft.network.chat.Component -import net.neoforged.bus.api.Event -import net.neoforged.bus.api.ICancellableEvent - -class CommandMessageEvent(val message: Component) : Event(), ICancellableEvent \ No newline at end of file diff --git a/neoforge/src/main/kotlin/dev/erdragh/astralbot/neoforge/event/SystemMessageEvent.kt b/neoforge/src/main/kotlin/dev/erdragh/astralbot/neoforge/event/SystemMessageEvent.kt deleted file mode 100644 index c1b358a..0000000 --- a/neoforge/src/main/kotlin/dev/erdragh/astralbot/neoforge/event/SystemMessageEvent.kt +++ /dev/null @@ -1,7 +0,0 @@ -package dev.erdragh.astralbot.neoforge.event - -import net.minecraft.network.chat.Component -import net.neoforged.bus.api.Event -import net.neoforged.bus.api.ICancellableEvent - -class SystemMessageEvent(var message: Component) : Event(), ICancellableEvent \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 11ac206..1ca0574 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,8 +5,8 @@ rootProject.name = "AstralBot" pluginManagement { repositories { mavenCentral() + maven(url = "https://maven.architectury.dev/") maven("https://maven.fabricmc.net/") { name = "Fabric" } - maven("https://maven.neoforged.net/releases/") { name = "NeoForge" } maven("https://repo.spongepowered.org/repository/maven-public/") { name = "Sponge Snapshots" } gradlePluginPortal() } @@ -16,4 +16,4 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" } -include("common", "fabric", "neoforge") \ No newline at end of file +include("common", "fabric", "forge") \ No newline at end of file