aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl3/mixin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/dev/isxander/yacl3/mixin')
-rw-r--r--src/main/java/dev/isxander/yacl3/mixin/ContainerEventHandlerMixin.java8
-rw-r--r--src/main/java/dev/isxander/yacl3/mixin/TabNavigationBarAccessor.java18
2 files changed, 22 insertions, 4 deletions
diff --git a/src/main/java/dev/isxander/yacl3/mixin/ContainerEventHandlerMixin.java b/src/main/java/dev/isxander/yacl3/mixin/ContainerEventHandlerMixin.java
index bd5ada0..f22af36 100644
--- a/src/main/java/dev/isxander/yacl3/mixin/ContainerEventHandlerMixin.java
+++ b/src/main/java/dev/isxander/yacl3/mixin/ContainerEventHandlerMixin.java
@@ -1,7 +1,9 @@
-/*? if !forge {*/
package dev.isxander.yacl3.mixin;
import net.minecraft.client.gui.components.events.ContainerEventHandler;
+import org.spongepowered.asm.mixin.Mixin;
+
+/*? if !forge {*/
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.components.tabs.TabNavigationBar;
import net.minecraft.client.gui.navigation.FocusNavigationEvent;
@@ -9,13 +11,11 @@ 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;
-
@Mixin(ContainerEventHandler.class)
public interface ContainerEventHandlerMixin {
// This mixin is used to prevent the tab bar from being focused when navigating left or right
@@ -30,7 +30,7 @@ public interface ContainerEventHandlerMixin {
}
}
/*?} else {*//*
-@Mixin(targets = {})
+@Mixin(ContainerEventHandler.class)
public class ContainerEventHandlerMixin {
}
diff --git a/src/main/java/dev/isxander/yacl3/mixin/TabNavigationBarAccessor.java b/src/main/java/dev/isxander/yacl3/mixin/TabNavigationBarAccessor.java
index 388407b..f0da81d 100644
--- a/src/main/java/dev/isxander/yacl3/mixin/TabNavigationBarAccessor.java
+++ b/src/main/java/dev/isxander/yacl3/mixin/TabNavigationBarAccessor.java
@@ -1,8 +1,13 @@
package dev.isxander.yacl3.mixin;
+import com.google.common.collect.ImmutableList;
+import net.minecraft.client.gui.components.TabButton;
+import net.minecraft.client.gui.components.tabs.Tab;
+import net.minecraft.client.gui.components.tabs.TabManager;
import net.minecraft.client.gui.components.tabs.TabNavigationBar;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
+import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(TabNavigationBar.class)
public interface TabNavigationBarAccessor {
@@ -13,4 +18,17 @@ public interface TabNavigationBarAccessor {
@Accessor
net.minecraft.client.gui.layouts.GridLayout getLayout();
/*?}*/
+
+ @Accessor
+ int getWidth();
+
+ @Accessor
+ TabManager getTabManager();
+
+ @Accessor
+ ImmutableList<Tab> getTabs();
+
+ @Accessor
+ ImmutableList<TabButton> getTabButtons();
+
}