package net.teamio.taam.gui.util;

import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.resources.I18n;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;

public abstract class CustomGui extends GuiContainer {

	public CustomGui(Container container) {
		super(container);
	}

	public static void drawTexturedModalRect(int x, int y, int width, int height, float zIndex) {
		Tessellator tessellator = Tessellator.getInstance();
		WorldRenderer renderer = tessellator.getWorldRenderer();
		renderer.startDrawingQuads();
		renderer.addVertexWithUV(x,			y + height,	zIndex, 0, 1);
		renderer.addVertexWithUV(x + width,	y + height,	zIndex, 1, 1);
		renderer.addVertexWithUV(x + width,	y,			zIndex, 1, 0);
		renderer.addVertexWithUV(x,			y,			zIndex, 0, 0);
		renderer.finishDrawing();
	}

	protected void drawTexturedModalRect(int x, int y, int width, int height) {
		drawTexturedModalRect(x, y, width, height, this.zLevel);
	}

	public static void drawTexturedModalRect(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, double zLevel) {
		float f = 1f / textureWidth;
		float f1 = 1f / textureHeight;
		Tessellator tessellator = Tessellator.getInstance();
		WorldRenderer renderer = tessellator.getWorldRenderer();
		renderer.startDrawingQuads();
		renderer.addVertexWithUV(x,			y + height,	zLevel, u * f,				(v + height) * f1);
		renderer.addVertexWithUV(x + width,	y + height,	zLevel, (u + width) * f,	(v + height) * f1);
		renderer.addVertexWithUV(x + width,	y,			zLevel, (u + width) * f,	v * f1);
		renderer.addVertexWithUV(x,			y,			zLevel, u * f,				v * f1);
		renderer.finishDrawing();
	}

	protected void drawTexturedModalRect(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight) {
		drawTexturedModalRect(x, y, u, v, width, height, textureWidth, textureHeight, this.zLevel);
	}
	
	public static String getTranslatedInventoryName(IInventory inventory) {
		if(inventory.hasCustomName()) {
			return inventory.getDisplayName().getFormattedText();
		} else {
			return I18n.format(inventory.getDisplayName().getFormattedText(), new Object[0]);
		}
	}
}

@@ -88,110 +88,8 @@
 er;%0A
-import net.minecraft.client.renderer.Tessellator;%0Aimport net.minecraft.client.renderer.WorldRenderer;%0A
 impo
@@ -337,1588 +337,8 @@
 ;%0A%09%7D
-%0A%0A%09public static void drawTexturedModalRect(int x, int y, int width, int height, float zIndex) %7B%0A%09%09Tessellator tessellator = Tessellator.getInstance();%0A%09%09WorldRenderer renderer = tessellator.getWorldRenderer();%0A%09%09renderer.startDrawingQuads();%0A%09%09renderer.addVertexWithUV(x,%09%09%09y + height,%09zIndex, 0, 1);%0A%09%09renderer.addVertexWithUV(x + width,%09y + height,%09zIndex, 1, 1);%0A%09%09renderer.addVertexWithUV(x + width,%09y,%09%09%09zIndex, 1, 0);%0A%09%09renderer.addVertexWithUV(x,%09%09%09y,%09%09%09zIndex, 0, 0);%0A%09%09renderer.finishDrawing();%0A%09%7D%0A%0A%09protected void drawTexturedModalRect(int x, int y, int width, int height) %7B%0A%09%09drawTexturedModalRect(x, y, width, height, this.zLevel);%0A%09%7D%0A%0A%09public static void drawTexturedModalRect(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, double zLevel) %7B%0A%09%09float f = 1f / textureWidth;%0A%09%09float f1 = 1f / textureHeight;%0A%09%09Tessellator tessellator = Tessellator.getInstance();%0A%09%09WorldRenderer renderer = tessellator.getWorldRenderer();%0A%09%09renderer.startDrawingQuads();%0A%09%09renderer.addVertexWithUV(x,%09%09%09y + height,%09zLevel, u * f,%09%09%09%09(v + height) * f1);%0A%09%09renderer.addVertexWithUV(x + width,%09y + height,%09zLevel, (u + width) * f,%09(v + height) * f1);%0A%09%09renderer.addVertexWithUV(x + width,%09y,%09%09%09zLevel, (u + width) * f,%09v * f1);%0A%09%09renderer.addVertexWithUV(x,%09%09%09y,%09%09%09zLevel, u * f,%09%09%09%09v * f1);%0A%09%09renderer.finishDrawing();%0A%09%7D%0A%0A%09protected void drawTexturedModalRect(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight) %7B%0A%09%09drawTexturedModalRect(x, y, u, v, width, height, textureWidth, textureHeight, this.zLevel);%0A%09%7D
 %0A%09%0A%09

Remove unnecessary, broken GUI code