// Path: src/main/java/com/github/lunatrius/ingameinfo/reference/Reference.java
// public class Reference {
//     public static final String MODID = "ingameinfoxml";
//     public static final String NAME = "InGame Info XML";
//     public static final String VERSION = "${version}";
//     public static final String FORGE = "${forgeversion}";
//     public static final String MINECRAFT = "${mcversion}";
//     public static final String PROXY_SERVER = "com.github.lunatrius.ingameinfo.proxy.ServerProxy";
//     public static final String PROXY_CLIENT = "com.github.lunatrius.ingameinfo.proxy.ClientProxy";
//     public static final String GUI_FACTORY = "com.github.lunatrius.ingameinfo.client.gui.config.GuiFactory";
// 
//     public static Logger logger = LogManager.getLogger(Reference.MODID);
// }


import com.github.lunatrius.core.client.gui.GuiHelper;
import com.github.lunatrius.core.util.vector.Vector2f;
import com.github.lunatrius.ingameinfo.reference.Reference;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;

    public void setDisplayDimensions(final int displayX, final int displayY, final int displayWidth, final int displayHeight) {
        this.displayWidth = displayWidth;
        this.displayHeight = displayHeight;

        this.xy0.set(displayX, displayY);
        this.xy1.set(displayX + displayWidth, displayY + displayHeight);
    }

    public void setTextureData(final int iconX, final int iconY, final int iconWidth, final int iconHeight, final int textureWidth, final int textureHeight) {
        this.uv0.set((float) iconX / textureWidth, (float) iconY / textureHeight);
        this.uv1.set((float) (iconX + iconWidth) / textureWidth, (float) (iconY + iconHeight) / textureHeight);
    }

    @Override
    public void drawInfo() {
        try {
            textureManager.bindTexture(this.resourceLocation);

            GlStateManager.translate(getX(), getY(), 0);

            final Tessellator tessellator = Tessellator.getInstance();
            final BufferBuilder buffer = tessellator.getBuffer();

            buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
            GuiHelper.drawTexturedRectangle(buffer, this.xy0.x, this.xy0.y, this.xy1.x, this.xy1.y, this.zLevel, this.uv0.x, this.uv0.y, this.uv1.x, this.uv1.y);
            tessellator.draw();

            GlStateManager.translate(-getX(), -getY(), 0);
        } catch (final Exception e) {
// Path: src/main/java/com/github/lunatrius/ingameinfo/reference/Reference.java
// public class Reference {
//     public static final String MODID = "ingameinfoxml";
//     public static final String NAME = "InGame Info XML";
//     public static final String VERSION = "${version}";
//     public static final String FORGE = "${forgeversion}";
//     public static final String MINECRAFT = "${mcversion}";
//     public static final String PROXY_SERVER = "com.github.lunatrius.ingameinfo.proxy.ServerProxy";
//     public static final String PROXY_CLIENT = "com.github.lunatrius.ingameinfo.proxy.ClientProxy";
//     public static final String GUI_FACTORY = "com.github.lunatrius.ingameinfo.client.gui.config.GuiFactory";
// 
//     public static Logger logger = LogManager.getLogger(Reference.MODID);
// }


// Path: src/main/java/com/github/lunatrius/ingameinfo/client/gui/overlay/InfoIcon.java
import com.github.lunatrius.core.client.gui.GuiHelper;
import com.github.lunatrius.core.util.vector.Vector2f;
import com.github.lunatrius.ingameinfo.reference.Reference;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;


    public void setDisplayDimensions(final int displayX, final int displayY, final int displayWidth, final int displayHeight) {
        this.displayWidth = displayWidth;
        this.displayHeight = displayHeight;

        this.xy0.set(displayX, displayY);
        this.xy1.set(displayX + displayWidth, displayY + displayHeight);
    }

    public void setTextureData(final int iconX, final int iconY, final int iconWidth, final int iconHeight, final int textureWidth, final int textureHeight) {
        this.uv0.set((float) iconX / textureWidth, (float) iconY / textureHeight);
        this.uv1.set((float) (iconX + iconWidth) / textureWidth, (float) (iconY + iconHeight) / textureHeight);
    }

    @Override
    public void drawInfo() {
        try {
            textureManager.bindTexture(this.resourceLocation);

            GlStateManager.translate(getX(), getY(), 0);

            final Tessellator tessellator = Tessellator.getInstance();
            final BufferBuilder buffer = tessellator.getBuffer();

            buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
            GuiHelper.drawTexturedRectangle(buffer, this.xy0.x, this.xy0.y, this.xy1.x, this.xy1.y, this.zLevel, this.uv0.x, this.uv0.y, this.uv1.x, this.uv1.y);
            tessellator.draw();

            GlStateManager.translate(-getX(), -getY(), 0);
        } catch (final Exception e) {
            Reference.logger.debug(e);