aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/xmrvizzy/skyblocker/mixin/GenericContainerScreenMixin.java
diff options
context:
space:
mode:
authorExternalTime <84183548+ExternalTime@users.noreply.github.com>2021-10-07 19:57:25 +0200
committerExternalTime <84183548+ExternalTime@users.noreply.github.com>2021-10-10 17:08:06 +0200
commit9572664f807e2f545a2d4b6d9f2b4dfa0a9791c3 (patch)
treee9edfe6c8b847c559ccaf96dd419e251d83a496d /src/main/java/me/xmrvizzy/skyblocker/mixin/GenericContainerScreenMixin.java
parent50de2604202bdb8ac3a69d0e5625d60ede57512b (diff)
downloadSkyblocker-9572664f807e2f545a2d4b6d9f2b4dfa0a9791c3.tar.gz
Skyblocker-9572664f807e2f545a2d4b6d9f2b4dfa0a9791c3.tar.bz2
Skyblocker-9572664f807e2f545a2d4b6d9f2b4dfa0a9791c3.zip
Added an interface for solvers for minigames inside chests
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/mixin/GenericContainerScreenMixin.java')
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/mixin/GenericContainerScreenMixin.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/mixin/GenericContainerScreenMixin.java b/src/main/java/me/xmrvizzy/skyblocker/mixin/GenericContainerScreenMixin.java
new file mode 100644
index 00000000..3e6bf16a
--- /dev/null
+++ b/src/main/java/me/xmrvizzy/skyblocker/mixin/GenericContainerScreenMixin.java
@@ -0,0 +1,31 @@
+package me.xmrvizzy.skyblocker.mixin;
+
+import me.xmrvizzy.skyblocker.SkyblockerMod;
+import me.xmrvizzy.skyblocker.utils.Utils;
+import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
+import net.minecraft.client.gui.screen.ingame.HandledScreen;
+import net.minecraft.client.util.math.MatrixStack;
+import net.minecraft.entity.player.PlayerInventory;
+import net.minecraft.screen.GenericContainerScreenHandler;
+import net.minecraft.text.Text;
+import org.spongepowered.asm.mixin.Final;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Shadow;
+
+@Mixin(GenericContainerScreen.class)
+public abstract class GenericContainerScreenMixin extends HandledScreen<GenericContainerScreenHandler> {
+ @Shadow
+ @Final
+ private int rows;
+
+ public GenericContainerScreenMixin(GenericContainerScreenHandler handler, PlayerInventory inventory, Text title) {
+ super(handler, inventory, title);
+ }
+
+ @Override
+ protected void drawForeground(MatrixStack matrices, int mouseX, int mouseY) {
+ super.drawForeground(matrices, mouseX, mouseY);
+ if (Utils.isSkyblock)
+ SkyblockerMod.getInstance().containerSolverManager.onDraw(matrices, this.handler.slots.subList(0, rows * 9));
+ }
+}