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/src | |
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/src')
6 files changed, 0 insertions, 134 deletions
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" - ] -} |