package info.u_team.u_team_core.gui.elements;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;

public class ImageButton extends UButton {
	
	protected ResourceLocation resource;
	
	public ImageButton(int x, int y, int width, int height, ResourceLocation resource) {
		this(x, y, width, height, resource, EMTPY_PRESSABLE);
	}
	
	public ImageButton(int x, int y, int width, int height, ResourceLocation resource, IPressable pressable) {
		super(x, y, width, height, "", pressable);
		this.resource = resource;
	}
	
	public ResourceLocation getResource() {
		return resource;
	}
	
	public void setResource(ResourceLocation resource) {
		this.resource = resource;
	}
	
	@Override
	public void renderButton(int mouseX, int mouseY, float partial) {
		super.renderButton(mouseX, mouseY, partial);
		resetColor();
		Minecraft.getInstance().getTextureManager().bindTexture(resource);
		innerBlit(x + 2, x + width - 2, y + 2, y + height - 2, 0, 0, 1, 0, 1);
	}
	
	protected void resetColor() {
		GL11.glColor4f(1, 1, 1, 1);
	}
}

@@ -71,16 +71,63 @@
 .GL11;%0A%0A
+import com.mojang.blaze3d.matrix.MatrixStack;%0A%0A
 import n
@@ -200,16 +200,50 @@
 ocation;
+%0Aimport net.minecraft.util.text.*;
 %0A%0Apublic
@@ -609,10 +609,43 @@
 ht, 
-%22%22
+ITextComponent.func_241827_a_(null)
 , pr
@@ -863,29 +863,56 @@
 ic void 
-renderButton(
+func_230431_b_(MatrixStack matrixStack, 
 int mous
@@ -956,21 +956,36 @@
 per.
-renderButton(
+func_230431_b_(matrixStack, 
 mous
@@ -1097,57 +1097,172 @@
 ;%0A%09%09
-innerBlit(x + 2, x + width - 2, y + 2, y + height
+func_238461_a_(matrixStack.getLast().getMatrix(), field_230690_l_ + 2, field_230690_l_ + field_230688_j_ - 2, field_230691_m_ + 2, field_230691_m_ + field_230689_k_
  - 2

Fix image button