// Path: src/main/java/uk/kihira/tails/client/RenderHelper.java
// public class RenderHelper
// {
//     public static void startGlScissor(int x, int y, int width, int height)
//     {
//         // TODO
// //        Minecraft mc = Minecraft.getInstance();
// //        ScaledResolution reso = new ScaledResolution(mc);
// //
// //        double scaleW = (double)mc.displayWidth / reso.getScaledWidth_double();
// //        double scaleH = (double)mc.displayHeight / reso.getScaledHeight_double();
// //
// //        GL11.glEnable(GL11.GL_SCISSOR_TEST);
// //        GL11.glScissor((int)Math.floor((double)x * scaleW), (int)Math.floor((double)mc.displayHeight - ((double)(y + height) * scaleH)), (int)Math.floor((double)(x + width) * scaleW) - (int)Math.floor((double)x * scaleW), (int)Math.floor((double)mc.displayHeight - ((double)y * scaleH)) - (int)Math.floor((double)mc.displayHeight - ((double)(y + height) * scaleH))); //starts from lower left corner (minecraft starts from upper left)
//     }
// 
//     public static void endGlScissor()
//     {
//         GL11.glDisable(GL11.GL_SCISSOR_TEST);
//     }
// }


import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.gui.widget.list.AbstractList;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import uk.kihira.tails.client.RenderHelper;
import net.minecraft.client.Minecraft;
import java.util.List;
package uk.kihira.tails.client.gui;



@OnlyIn(Dist.CLIENT)
public class GuiList<T extends AbstractList.AbstractListEntry<T>> extends AbstractList<T>
{
    private final IListCallback<T> parent;

    public GuiList(IListCallback<T> parent, int width, int height, int top, int bottom, int slotHeight, List<T> entries)
    {
        super(Minecraft.getInstance(), width, height, top, bottom, slotHeight);
        this.parent = parent;
        this.x0 = -3;

        entries.forEach(this::addEntry);
    }

    @Override
    public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks)
    {
// Path: src/main/java/uk/kihira/tails/client/RenderHelper.java
// public class RenderHelper
// {
//     public static void startGlScissor(int x, int y, int width, int height)
//     {
//         // TODO
// //        Minecraft mc = Minecraft.getInstance();
// //        ScaledResolution reso = new ScaledResolution(mc);
// //
// //        double scaleW = (double)mc.displayWidth / reso.getScaledWidth_double();
// //        double scaleH = (double)mc.displayHeight / reso.getScaledHeight_double();
// //
// //        GL11.glEnable(GL11.GL_SCISSOR_TEST);
// //        GL11.glScissor((int)Math.floor((double)x * scaleW), (int)Math.floor((double)mc.displayHeight - ((double)(y + height) * scaleH)), (int)Math.floor((double)(x + width) * scaleW) - (int)Math.floor((double)x * scaleW), (int)Math.floor((double)mc.displayHeight - ((double)y * scaleH)) - (int)Math.floor((double)mc.displayHeight - ((double)(y + height) * scaleH))); //starts from lower left corner (minecraft starts from upper left)
//     }
// 
//     public static void endGlScissor()
//     {
//         GL11.glDisable(GL11.GL_SCISSOR_TEST);
//     }
// }


// Path: src/main/java/uk/kihira/tails/client/gui/GuiList.java
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.gui.widget.list.AbstractList;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import uk.kihira.tails.client.RenderHelper;
import net.minecraft.client.Minecraft;
import java.util.List;

package uk.kihira.tails.client.gui;



@OnlyIn(Dist.CLIENT)
public class GuiList<T extends AbstractList.AbstractListEntry<T>> extends AbstractList<T>
{
    private final IListCallback<T> parent;

    public GuiList(IListCallback<T> parent, int width, int height, int top, int bottom, int slotHeight, List<T> entries)
    {
        super(Minecraft.getInstance(), width, height, top, bottom, slotHeight);
        this.parent = parent;
        this.x0 = -3;

        entries.forEach(this::addEntry);
    }

    @Override
    public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks)
    {
        RenderHelper.startGlScissor(this.x0, this.y0, this.width + 3, this.height);