package info.u_team.u_team_core.gui.elements;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.widget.list.*;

public abstract class ScrollableList<T extends AbstractList.AbstractListEntry<T>> extends ExtendedList<T> {
	
	protected int listWidth;
	protected int scrollbarPos;
	
	public ScrollableList(int width, int height, int top, int bottom, int left, int right, int slotHeight, int listWidth, int scrollbarPos) {
		super(Minecraft.getInstance(), 0, 0, 0, 0, slotHeight);
		updateSettings(width, height, top, bottom, left, right);
		this.listWidth = listWidth;
		this.scrollbarPos = scrollbarPos;
	}
	
	public void updateSettings(int width, int height, int top, int bottom, int left, int right) {
		this.width = width;
		this.height = height;
		this.y0 = top;
		this.y1 = bottom;
		this.x0 = left;
		this.x1 = right;
	}
	
	@Override
	public int getRowWidth() {
		return width - listWidth;
	}
	
	@Override
	protected int getScrollbarPosition() {
		return width + scrollbarPos;
	}
}

@@ -51,38 +51,116 @@
 ort 
-net.minecraft.client.M
+com.mojang.blaze3d.matrix.MatrixStack;%0A%0Aimport info.u_team.u_team_core.util.RenderUtil;%0Aimport net.m
 inecraft
 ;%0Aim
@@ -155,16 +155,25 @@
 inecraft
+.client.*
 ;%0Aimport
@@ -212,16 +212,59 @@
 .list.*;
+%0Aimport net.minecraft.util.math.MathHelper;
 %0A%0Apublic
@@ -1090,24 +1090,24 @@
 osition() %7B%0A
-
 %09%09return wid
@@ -1128,10 +1128,879 @@
 Pos;%0A%09%7D%0A
+%09%0A%09@Override%0A%09protected void renderList(MatrixStack matrixStack, int rowLeft, int scrollAmount, int mouseX, int mouseY, float partialTicks) %7B%0A%09%09final MainWindow window = minecraft.getMainWindow();%0A%09%09final double scaleFactor = window.getGuiScaleFactor();%0A%09%09%0A%09%09final int nativeX = MathHelper.ceil(x0 * scaleFactor);%0A%09%09final int nativeY = MathHelper.ceil(y0 * scaleFactor);%0A%09%09%0A%09%09final int nativeWidth = MathHelper.ceil((x1 - x0) * scaleFactor);%0A%09%09final int nativeHeight = MathHelper.ceil((y1 - y0) * scaleFactor);%0A%09%09%0A%09%09RenderUtil.enableScissor(nativeX, window.getHeight() - (nativeY + nativeHeight), nativeWidth, nativeHeight);%0A%09%09%0A%09%09// AbstractGui.fill(matrixStack, 0, 0, window.getScaledWidth(), window.getScaledHeight(), 0xFF00FF00); // test scissor%0A%09%09super.renderList(matrixStack, rowLeft, scrollAmount, mouseX, mouseY, partialTicks);%0A%09%09RenderUtil.disableScissor();%0A%09%7D%0A
 %7D%0A

Add scissor