package info.u_team.u_team_core.gui.elements;

import java.util.*;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.widget.Widget;
import net.minecraft.client.gui.widget.list.ExtendedList;

public abstract class ScrollableListEntry<T extends ScrollableListEntry<T>> extends ExtendedList.AbstractListEntry<T> {
	
	protected final Minecraft minecraft;
	
	private final List<Widget> widget;
	
	public ScrollableListEntry() {
		minecraft = Minecraft.getInstance();
		widget = new ArrayList<>();
	}
	
	protected <B extends Widget> B addButton(B button) {
		widget.add(button);
		return button;
	}
	
	@Override
	public boolean mouseClicked(double p_mouseClicked_1_, double p_mouseClicked_3_, int p_mouseClicked_5_) {
		widget.forEach(button -> button.mouseClicked(p_mouseClicked_1_, p_mouseClicked_3_, p_mouseClicked_5_));
		return true;
	}
	
	@Override
	public boolean mouseReleased(double p_mouseReleased_1_, double p_mouseReleased_3_, int p_mouseReleased_5_) {
		for (final Widget button : widget) {
			if (button.mouseReleased(p_mouseReleased_1_, p_mouseReleased_3_, p_mouseReleased_5_)) {
				return true;
			}
		}
		return false;
	}
	
	@Override
	public boolean mouseDragged(double p_mouseDragged_1_, double p_mouseDragged_3_, int p_mouseDragged_5_, double p_mouseDragged_6_, double p_mouseDragged_8_) {
		for (final Widget button : widget) {
			if (button.mouseDragged(p_mouseDragged_1_, p_mouseDragged_3_, p_mouseDragged_5_, p_mouseDragged_6_, p_mouseDragged_8_)) {
				return true;
			}
		}
		return false;
	}
	
	@Override
	public abstract void render(int slotIndex, int entryY, int entryX, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float partialTicks);
}
@@ -61,16 +61,63 @@
 til.*;%0A%0A
+import com.mojang.blaze3d.matrix.MatrixStack;%0A%0A
 import n
@@ -684,28 +684,30 @@
 boolean 
-mouseClicked
+func_231044_a_
 (double 
@@ -810,28 +810,30 @@
  button.
-mouseClicked
+func_231044_a_
 (p_mouse
@@ -931,29 +931,30 @@
 boolean 
-mouseReleased
+func_231048_c_
 (double 
@@ -1079,29 +1079,30 @@
 (button.
-mouseReleased
+func_231048_c_
 (p_mouse
@@ -1231,28 +1231,30 @@
 boolean 
-mouseDragged
+func_231045_a_
 (double 
@@ -1428,28 +1428,30 @@
 (button.
-mouseDragged
+func_231045_a_
 (p_mouse
@@ -1625,15 +1625,48 @@
 oid 
-render(
+func_230432_a_(MatrixStack matrixStack, 
 int 

Update scrollable list entry