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;
	}
}

@@ -723,21 +723,31 @@
 %0A%09%09this.
-width
+field_230670_d_
  = width
@@ -755,22 +755,31 @@
 %0A%09%09this.
-height
+field_230671_e_
  = heigh
@@ -792,27 +792,53 @@
 his.
-y0 = top;%0A%09%09this.y1
+field_230672_i_ = top;%0A%09%09this.field_230673_j_
  = b
@@ -855,10 +855,23 @@
 his.
-x0
+field_230675_l_
  = l
@@ -886,10 +886,23 @@
 his.
-x1
+field_230674_k_
  = r
@@ -939,38 +939,51 @@
 int 
-getRowWidth() %7B%0A%09%09return width
+func_230949_c_() %7B%0A%09%09return field_230670_d_
  - l
@@ -1027,47 +1027,51 @@
 int 
-getScrollbarPosition() %7B%0A%09%09return width
+func_230952_d_() %7B%0A%09%09return field_230670_d_
  + s

Update scrollable list