diff options
| author | isxander <xander@isxander.dev> | 2024-04-11 18:43:06 +0100 |
|---|---|---|
| committer | isxander <xander@isxander.dev> | 2024-04-11 18:43:06 +0100 |
| commit | 04fe933f4c24817100f3101f088accf55a621f8a (patch) | |
| tree | feff94ca3ab4484160e69a24f4ee38522381950e /fabric | |
| parent | 831b894fdb7fe3e173d81387c8f6a2402b8ccfa9 (diff) | |
| download | YetAnotherConfigLib-04fe933f4c24817100f3101f088accf55a621f8a.tar.gz YetAnotherConfigLib-04fe933f4c24817100f3101f088accf55a621f8a.tar.bz2 YetAnotherConfigLib-04fe933f4c24817100f3101f088accf55a621f8a.zip | |
Extremely fragile and broken multiversion build with stonecutter
Diffstat (limited to 'fabric')
8 files changed, 0 insertions, 358 deletions
diff --git a/fabric/.gitignore b/fabric/.gitignore deleted file mode 100644 index b63da45..0000000 --- a/fabric/.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/fabric/build.gradle.kts b/fabric/build.gradle.kts deleted file mode 100644 index cb3dd29..0000000 --- a/fabric/build.gradle.kts +++ /dev/null @@ -1,182 +0,0 @@ -import org.gradle.jvm.tasks.Jar - -plugins { - alias(libs.plugins.architectury.loom) - alias(libs.plugins.shadow) - alias(libs.plugins.minotaur) - alias(libs.plugins.cursegradle) -} - -architectury { - platformSetupLoomIde() - fabric() -} - -loom { - silentMojangMappingsLicense() - - accessWidenerPath.set(project(":common").loom.accessWidenerPath) -} - -val common by configurations.registering -val shadowCommon by configurations.registering -configurations.compileClasspath.get().extendsFrom(common.get()) -configurations["developmentFabric"].extendsFrom(common.get()) - -val minecraftVersion = libs.versions.minecraft.get() - -dependencies { - minecraft(libs.minecraft) - mappings(loom.layered { - officialMojangMappings() - parchment(libs.parchment) - }) - modImplementation(libs.fabric.loader) - - listOf( - "fabric-resource-loader-v0", - ).forEach { modApi(fabricApi.module(it, libs.versions.fabric.api.get())) } - - libs.bundles.twelvemonkeys.imageio.let { - implementation(it) - include(it) - } - libs.bundles.quilt.parsers.let { - implementation(it) - include(it) - } - - "common"(project(path = ":common", configuration = "namedElements")) { isTransitive = false } - "shadowCommon"(project(path = ":common", configuration = "transformProductionFabric")) { isTransitive = false } -} - -java { - withSourcesJar() -} - -tasks { - processResources { - val modId: String by project - val modName: String by project - val modDescription: String by project - val githubProject: String by project - - 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) - - filesMatching("fabric.mod.json") { - expand( - "id" to modId, - "group" to project.group, - "name" to modName, - "description" to modDescription, - "version" to project.version, - "github" to githubProject, - ) - } - } - - shadowJar { - 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} (Fabric)") - versionNumber.set("${project.version}-fabric") - versionType.set(if (isBeta) "beta" else "release") - uploadFile.set(tasks["remapJar"]) - gameVersions.set(listOf("1.20.3", "1.20.4")) - loaders.set(listOf("fabric", "quilt")) - 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 = "[Fabric] ${project.version}" - }) - - id = curseforgeId - releaseType = if (isBeta) "beta" else "release" - addGameVersion("1.20.3") - addGameVersion("1.20.4") - addGameVersion("Fabric") - 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>("fabric") { - groupId = "dev.isxander.yacl" - artifactId = "yet-another-config-lib-fabric" - - from(components["java"]) - } - } -} -tasks.findByPath("publishFabricPublicationToReleasesRepository")?.let { - rootProject.tasks["releaseMod"].dependsOn(it) -} diff --git a/fabric/src/main/java/dev/isxander/yacl3/fabric/mixin/ContainerEventHandlerMixin.java b/fabric/src/main/java/dev/isxander/yacl3/fabric/mixin/ContainerEventHandlerMixin.java deleted file mode 100644 index 7e1be75..0000000 --- a/fabric/src/main/java/dev/isxander/yacl3/fabric/mixin/ContainerEventHandlerMixin.java +++ /dev/null @@ -1,35 +0,0 @@ -package dev.isxander.yacl3.fabric.mixin; - -import net.minecraft.client.gui.components.events.ContainerEventHandler; -import net.minecraft.client.gui.components.events.GuiEventListener; -import net.minecraft.client.gui.components.tabs.TabNavigationBar; -import net.minecraft.client.gui.navigation.FocusNavigationEvent; -import net.minecraft.client.gui.navigation.ScreenAxis; -import net.minecraft.client.gui.navigation.ScreenDirection; -import net.minecraft.client.gui.navigation.ScreenRectangle; -import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; - -import java.util.List; - -/** - * This is in Fabric-only because only the Fabric fork of mixin supports @Redirect on interfaces. - * This will change in the next release of Mixin. - */ -@Mixin(ContainerEventHandler.class) -public interface ContainerEventHandlerMixin { - /** - * This mixin is used to prevent the tab bar from being focused when navigating left or right - * through the YACL options screen. This can also apply to vanilla as navigating left or right - * should never result in focusing the always-at-the-top tab bar. - * Without this, navigating right from the option list focuses the tab bar, not the action buttons/description. - */ - @Redirect(method = {"nextFocusPathVaguelyInDirection", "nextFocusPathInDirection"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/components/events/ContainerEventHandler;children()Ljava/util/List;")) - default List<?> modifyFocusCandidates(ContainerEventHandler instance, ScreenRectangle screenArea, ScreenDirection direction, @Nullable GuiEventListener focused, FocusNavigationEvent event) { - if (direction.getAxis() == ScreenAxis.HORIZONTAL) - return instance.children().stream().filter(child -> !(child instanceof TabNavigationBar)).toList(); - return instance.children(); - } -} diff --git a/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLFabricEntrypoint.java b/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLFabricEntrypoint.java deleted file mode 100644 index 411ba27..0000000 --- a/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLFabricEntrypoint.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.isxander.yacl3.platform.fabric; - -import dev.isxander.yacl3.platform.YACLEntrypoint; -import dev.isxander.yacl3.platform.fabric.image.YACLImageReloadListenerFabric; -import net.fabricmc.api.ClientModInitializer; -import net.fabricmc.fabric.api.resource.ResourceManagerHelper; -import net.minecraft.server.packs.PackType; - -public class YACLFabricEntrypoint implements ClientModInitializer { - @Override - public void onInitializeClient() { - ResourceManagerHelper.get(PackType.CLIENT_RESOURCES).registerReloadListener(new YACLImageReloadListenerFabric()); - YACLEntrypoint.onInitializeClient(); - } -} diff --git a/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLPlatformImpl.java b/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLPlatformImpl.java deleted file mode 100644 index 7842f97..0000000 --- a/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLPlatformImpl.java +++ /dev/null @@ -1,23 +0,0 @@ -package dev.isxander.yacl3.platform.fabric; - -import dev.isxander.yacl3.platform.Env; -import net.fabricmc.loader.api.FabricLoader; - -import java.nio.file.Path; - -public class YACLPlatformImpl { - public static Env getEnvironment() { - return switch (FabricLoader.getInstance().getEnvironmentType()) { - case CLIENT -> Env.CLIENT; - case SERVER -> Env.SERVER; - }; - } - - public static boolean isDevelopmentEnv() { - return FabricLoader.getInstance().isDevelopmentEnvironment(); - } - - public static Path getConfigDir() { - return FabricLoader.getInstance().getConfigDir(); - } -} diff --git a/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/image/YACLImageReloadListenerFabric.java b/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/image/YACLImageReloadListenerFabric.java deleted file mode 100644 index 9eed7fe..0000000 --- a/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/image/YACLImageReloadListenerFabric.java +++ /dev/null @@ -1,12 +0,0 @@ -package dev.isxander.yacl3.platform.fabric.image; - -import dev.isxander.yacl3.gui.image.YACLImageReloadListener; -import net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener; -import net.minecraft.resources.ResourceLocation; - -public class YACLImageReloadListenerFabric extends YACLImageReloadListener implements IdentifiableResourceReloadListener { - @Override - public ResourceLocation getFabricId() { - return new ResourceLocation("yet_another_config_lib_v3", "image_reload_listener"); - } -} diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json deleted file mode 100644 index b3dd73b..0000000 --- a/fabric/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "schemaVersion": 1, - "id": "${id}", - "version": "${version}", - "name": "${name}", - "description": "${description}", - "authors": [ - "isXander" - ], - "contact": { - "homepage": "https://isxander.dev", - "issues": "https://github.com/${github}/issues", - "sources": "https://github.com/${github}" - }, - "icon": "yacl-128x.png", - "license": "LGPL-3.0-or-later", - "environment": "*", - "depends": { - "fabricloader": ">=0.14.0", - - "java": ">=17", - "fabric-resource-loader-v0": "*" - }, - "mixins": [ - "yacl.mixins.json", - "yacl-fabric.mixins.json" - ], - "entrypoints": { - "client": [ - "dev.isxander.yacl3.platform.fabric.YACLFabricEntrypoint" - ] - }, - "custom": { - "modmenu": { - "badges": ["library"] - } - } -} diff --git a/fabric/src/main/resources/yacl-fabric.mixins.json b/fabric/src/main/resources/yacl-fabric.mixins.json deleted file mode 100644 index 5374dd3..0000000 --- a/fabric/src/main/resources/yacl-fabric.mixins.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "required": true, - "package": "dev.isxander.yacl3.fabric.mixin", - "compatibilityLevel": "JAVA_17", - "injectors": { - "defaultRequire": 1 - }, - "client": [ - "ContainerEventHandlerMixin" - ] -} |
