diff options
author | isXander <xandersmith2008@gmail.com> | 2023-12-07 18:34:17 +0000 |
---|---|---|
committer | isXander <xandersmith2008@gmail.com> | 2023-12-07 18:34:17 +0000 |
commit | a694321b8952a64d43134961d58fb60e1adc0cf5 (patch) | |
tree | 5c870d853cc796771c5a1bda0c3ebdd2885a585f /forge | |
parent | 7c8661265e7116be46467b4f37f1bbcb31569ecc (diff) | |
download | YetAnotherConfigLib-a694321b8952a64d43134961d58fb60e1adc0cf5.tar.gz YetAnotherConfigLib-a694321b8952a64d43134961d58fb60e1adc0cf5.tar.bz2 YetAnotherConfigLib-a694321b8952a64d43134961d58fb60e1adc0cf5.zip |
1.20.4 + Migrate from Forge platform to NeoForge platform
Diffstat (limited to 'forge')
-rw-r--r-- | forge/.gitignore | 42 | ||||
-rw-r--r-- | forge/build.gradle.kts | 197 | ||||
-rw-r--r-- | forge/gradle.properties | 1 | ||||
-rw-r--r-- | forge/src/main/java/dev/isxander/yacl3/platform/forge/YACLForgeEntrypoint.java | 11 | ||||
-rw-r--r-- | forge/src/main/java/dev/isxander/yacl3/platform/forge/YACLPlatformImpl.java | 24 | ||||
-rw-r--r-- | forge/src/main/resources/META-INF/mods.toml | 28 | ||||
-rw-r--r-- | forge/src/main/resources/pack.mcmeta | 6 |
7 files changed, 0 insertions, 309 deletions
diff --git a/forge/.gitignore b/forge/.gitignore deleted file mode 100644 index b63da45..0000000 --- a/forge/.gitignore +++ /dev/null @@ -1,42 +0,0 @@ -.gradle -build/ -!gradle/wrapper/gradle-wrapper.jar -!**/src/main/**/build/ -!**/src/test/**/build/ - -### IntelliJ IDEA ### -.idea/modules.xml -.idea/jarRepositories.xml -.idea/compiler.xml -.idea/libraries/ -*.iws -*.iml -*.ipr -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store
\ No newline at end of file diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts deleted file mode 100644 index d4f4c0e..0000000 --- a/forge/build.gradle.kts +++ /dev/null @@ -1,197 +0,0 @@ -import org.gradle.api.component.AdhocComponentWithVariants -import org.gradle.jvm.tasks.Jar -import org.gradle.kotlin.dsl.get -import org.gradle.kotlin.dsl.libs - -plugins { - alias(libs.plugins.architectury.loom) - alias(libs.plugins.shadow) - alias(libs.plugins.minotaur) - alias(libs.plugins.cursegradle) -} - -architectury { - platformSetupLoomIde() - forge() -} - -loom { - silentMojangMappingsLicense() - - accessWidenerPath.set(project(":common").loom.accessWidenerPath) - - forge { - mixinConfig("yacl.mixins.json") - - convertAccessWideners.set(true) - extraAccessWideners.add(loom.accessWidenerPath.get().asFile.name) - } -} - -val common by configurations.registering -val shadowCommon by configurations.registering -configurations.compileClasspath.get().extendsFrom(common.get()) -configurations["developmentForge"].extendsFrom(common.get()) - -val minecraftVersion: String = libs.versions.minecraft.get() - -dependencies { - minecraft(libs.minecraft) - mappings(loom.layered { - val qm = libs.versions.quilt.mappings.get() - if (qm != "0") - mappings("org.quiltmc:quilt-mappings:${libs.versions.minecraft.get()}+build.${libs.versions.quilt.mappings.get()}:intermediary-v2") - officialMojangMappings() - }) - forge(libs.forge) - - libs.bundles.twelvemonkeys.imageio.let { - implementation(it) - include(it) - forgeRuntimeLibrary(it) - } - libs.bundles.quilt.parsers.let { - implementation(it) - include(it) - forgeRuntimeLibrary(it) - } - - "common"(project(path = ":common", configuration = "namedElements")) { isTransitive = false } - "shadowCommon"(project(path = ":common", configuration = "transformProductionForge")) { isTransitive = false } -} - -java { - withSourcesJar() -} - -tasks { - processResources { - val modId: String by rootProject - val modName: String by rootProject - val modDescription: String by rootProject - val githubProject: String by rootProject - val majorForge = libs.versions.forge.get().substringAfter('-').split('.').first() - - inputs.property("id", modId) - inputs.property("group", project.group) - inputs.property("name", modName) - inputs.property("description", modDescription) - inputs.property("version", project.version) - inputs.property("github", githubProject) - inputs.property("major_forge", majorForge) - - filesMatching(listOf("META-INF/mods.toml", "pack.mcmeta")) { - expand( - "id" to modId, - "group" to project.group, - "name" to modName, - "description" to modDescription, - "version" to project.version, - "github" to githubProject, - "major_forge" to majorForge, - ) - } - } - - shadowJar { - exclude("fabric.mod.json") - exclude("architectury.common.json") - - configurations = listOf(shadowCommon.get()) - archiveClassifier.set("dev-shadow") - } - - remapJar { - injectAccessWidener.set(true) - inputFile.set(shadowJar.get().archiveFile) - dependsOn(shadowJar) - archiveClassifier.set(null as String?) - - from(rootProject.file("LICENSE")) - } - - named<Jar>("sourcesJar") { - archiveClassifier.set("dev-sources") - val commonSources = project(":common").tasks.named<Jar>("sourcesJar") - dependsOn(commonSources) - from(commonSources.get().archiveFile.map { zipTree(it) }) - } - - remapSourcesJar { - archiveClassifier.set("sources") - } - - jar { - archiveClassifier.set("dev") - } -} - -components["java"].run { - if (this is AdhocComponentWithVariants) { - withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) { - skip() - } - } -} - -val changelogText: String by ext -val isBeta: Boolean by ext - -val modrinthId: String by project -if (modrinthId.isNotEmpty()) { - modrinth { - token.set(findProperty("modrinth.token")?.toString()) - projectId.set(modrinthId) - versionName.set("${project.version} (Forge)") - versionNumber.set("${project.version}-forge") - versionType.set(if (isBeta) "beta" else "release") - uploadFile.set(tasks["remapJar"]) - gameVersions.set(listOf("1.20.2")) - loaders.set(listOf("forge", "neoforge")) - changelog.set(changelogText) - syncBodyFrom.set(rootProject.file("README.md").readText()) - } -} -rootProject.tasks["releaseMod"].dependsOn(tasks["modrinth"]) - -val curseforgeId: String by project -if (hasProperty("curseforge.token") && curseforgeId.isNotEmpty()) { - curseforge { - apiKey = findProperty("curseforge.token") - project(closureOf<me.hypherionmc.cursegradle.CurseProject> { - mainArtifact(tasks["remapJar"], closureOf<me.hypherionmc.cursegradle.CurseArtifact> { - displayName = "[Forge] ${project.version}" - }) - - id = curseforgeId - releaseType = if (isBeta) "beta" else "release" - addGameVersion("1.20.2") - addGameVersion("Forge") - addGameVersion("NeoForge") - addGameVersion("Java 17") - - changelog = changelogText - changelogType = "markdown" - }) - - options(closureOf<me.hypherionmc.cursegradle.Options> { - forgeGradleIntegration = false - fabricIntegration = false - }) - } -} -rootProject.tasks["releaseMod"].dependsOn(tasks["curseforge"]) - -publishing { - publications { - create<MavenPublication>("forge") { - groupId = "dev.isxander.yacl" - artifactId = "yet-another-config-lib-forge" - - from(components["java"]) - } - } -} -tasks.findByPath("publishForgePublicationToReleasesRepository")?.let { - rootProject.tasks["releaseMod"].dependsOn(it) -} diff --git a/forge/gradle.properties b/forge/gradle.properties deleted file mode 100644 index 32f842a..0000000 --- a/forge/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -loom.platform=forge
\ No newline at end of file diff --git a/forge/src/main/java/dev/isxander/yacl3/platform/forge/YACLForgeEntrypoint.java b/forge/src/main/java/dev/isxander/yacl3/platform/forge/YACLForgeEntrypoint.java deleted file mode 100644 index 0301add..0000000 --- a/forge/src/main/java/dev/isxander/yacl3/platform/forge/YACLForgeEntrypoint.java +++ /dev/null @@ -1,11 +0,0 @@ -package dev.isxander.yacl3.platform.forge; - -import net.minecraftforge.fml.common.Mod; - -@Mod("yet_another_config_lib_v3") -public class YACLForgeEntrypoint { - public YACLForgeEntrypoint() { - - } - -} diff --git a/forge/src/main/java/dev/isxander/yacl3/platform/forge/YACLPlatformImpl.java b/forge/src/main/java/dev/isxander/yacl3/platform/forge/YACLPlatformImpl.java deleted file mode 100644 index 6b10cb6..0000000 --- a/forge/src/main/java/dev/isxander/yacl3/platform/forge/YACLPlatformImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package dev.isxander.yacl3.platform.forge; - -import dev.isxander.yacl3.platform.Env; -import net.minecraftforge.fml.loading.FMLEnvironment; -import net.minecraftforge.fml.loading.FMLPaths; - -import java.nio.file.Path; - -public class YACLPlatformImpl { - public static Env getEnvironment() { - return switch (FMLEnvironment.dist) { - case CLIENT -> Env.CLIENT; - case DEDICATED_SERVER -> Env.SERVER; - }; - } - - public static boolean isDevelopmentEnv() { - return !FMLEnvironment.production; - } - - public static Path getConfigDir() { - return FMLPaths.CONFIGDIR.get(); - } -} diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml deleted file mode 100644 index dbd8461..0000000 --- a/forge/src/main/resources/META-INF/mods.toml +++ /dev/null @@ -1,28 +0,0 @@ -modLoader = "javafml" -loaderVersion = "[${major_forge},)" -#issueTrackerURL = "" -license = "LGPL-3.0-or-later" - -[[mods]] -modId = "${id}" -version = "${version}" -displayName = "${name}" -authors = "isXander" -description = ''' -${description} -''' -logoFile = "yacl-128x.png" - -[["dependencies.${id}"]] -modId = "forge" -mandatory = true -versionRange = "[${major_forge},)" -ordering = "NONE" -side = "BOTH" - -[["dependencies.${id}"]] -modId = "minecraft" -mandatory = true -versionRange = "[1.20.2,)" -ordering = "NONE" -side = "BOTH" diff --git a/forge/src/main/resources/pack.mcmeta b/forge/src/main/resources/pack.mcmeta deleted file mode 100644 index a9c6340..0000000 --- a/forge/src/main/resources/pack.mcmeta +++ /dev/null @@ -1,6 +0,0 @@ -{ - "pack": { - "description": "${name}", - "pack_format": 14 - } -}
\ No newline at end of file |