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 { @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)); } }