aboutsummaryrefslogtreecommitdiff
path: root/src/client/java/dev/isxander/yacl/mixin
diff options
context:
space:
mode:
authorXander <xander@isxander.dev>2023-04-25 16:28:41 +0100
committerGitHub <noreply@github.com>2023-04-25 16:28:41 +0100
commit13c7ba45ff201423eb8dba8a40cfb66ebb531439 (patch)
tree1e799aa9da11fbc0833bc6b7c6e6799633c2ec50 /src/client/java/dev/isxander/yacl/mixin
parent8ba7196ae990fe9aa98680aba1b387e385fff99c (diff)
downloadYetAnotherConfigLib-13c7ba45ff201423eb8dba8a40cfb66ebb531439.tar.gz
YetAnotherConfigLib-13c7ba45ff201423eb8dba8a40cfb66ebb531439.tar.bz2
YetAnotherConfigLib-13c7ba45ff201423eb8dba8a40cfb66ebb531439.zip
Architectury! (#61)
Diffstat (limited to 'src/client/java/dev/isxander/yacl/mixin')
-rw-r--r--src/client/java/dev/isxander/yacl/mixin/client/AbstractSelectionListMixin.java26
-rw-r--r--src/client/java/dev/isxander/yacl/mixin/client/OptionInstanceAccessor.java13
2 files changed, 0 insertions, 39 deletions
diff --git a/src/client/java/dev/isxander/yacl/mixin/client/AbstractSelectionListMixin.java b/src/client/java/dev/isxander/yacl/mixin/client/AbstractSelectionListMixin.java
deleted file mode 100644
index 978fd16..0000000
--- a/src/client/java/dev/isxander/yacl/mixin/client/AbstractSelectionListMixin.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package dev.isxander.yacl.mixin.client;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.components.AbstractSelectionList;
-import org.objectweb.asm.Opcodes;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Redirect;
-
-import java.util.List;
-
-@Mixin(AbstractSelectionList.class)
-public abstract class AbstractSelectionListMixin<E extends AbstractSelectionList.Entry<E>> {
- @Shadow public abstract List<E> children();
-
- /**
- * Mojang use the field access of children to get max index to loop through keyboard navigation to find the next entry.
- * YACL modifies these children() method to filter out hidden entries, so we need to redirect the field access to the
- * method, so we don't get ArrayIndexOutOfBoundsException.
- */
- @Redirect(method = "nextEntry(Lnet/minecraft/client/gui/navigation/ScreenDirection;Ljava/util/function/Predicate;Lnet/minecraft/client/gui/components/AbstractSelectionList$Entry;)Lnet/minecraft/client/gui/components/AbstractSelectionList$Entry;", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/components/AbstractSelectionList;children:Ljava/util/List;", opcode = Opcodes.GETFIELD))
- private List<E> modifyChildrenCall(AbstractSelectionList<E> instance) {
- return children();
- }
-}
diff --git a/src/client/java/dev/isxander/yacl/mixin/client/OptionInstanceAccessor.java b/src/client/java/dev/isxander/yacl/mixin/client/OptionInstanceAccessor.java
deleted file mode 100644
index b8df39f..0000000
--- a/src/client/java/dev/isxander/yacl/mixin/client/OptionInstanceAccessor.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package dev.isxander.yacl.mixin.client;
-
-import net.minecraft.client.OptionInstance;
-import org.jetbrains.annotations.ApiStatus;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.gen.Accessor;
-
-@ApiStatus.Internal
-@Mixin(OptionInstance.class)
-public interface OptionInstanceAccessor<T> {
- @Accessor
- T getInitialValue();
-}