package com.yolp900.itsjustacharm.client.guis;
import com.yolp900.itsjustacharm.api.affinities.IAffinity;
import com.yolp900.itsjustacharm.common.blocks.ModBlocks;
import com.yolp900.itsjustacharm.common.inventory.ContainerConstructionTable;
import com.yolp900.itsjustacharm.common.tileEntities.TileEntityConstructionTable;
import com.yolp900.itsjustacharm.reference.LibGuis;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
public class GuiConstructionTable extends ModGuiContainer {
private final TileEntityConstructionTable constructionTable;
public GuiConstructionTable(InventoryPlayer inventory, TileEntityConstructionTable tile) {
super(new ContainerConstructionTable(inventory, tile), LibGuis.ConstructionTable, 248, 255);
this.constructionTable = tile;
}
@Override
public void drawGuiContainerForeground(int x, int y) {
this.fontRendererObj.drawString(LibGuis.ConstructionTable.getTitle(), 75, 5, 0x000000);
GlStateManager.color(1F, 1F, 1F, 1F);
RenderHelper.enableGUIStandardItemLighting();
ItemStack constructionTable = new ItemStack(ModBlocks.ConstructionTable);
mc.getRenderItem().renderItemIntoGUI(constructionTable, 4, 4);
IAffinity[] affinities = this.constructionTable.getStoredAffinities(mc.thePlayer, mc.theWorld);
if (affinities[0] != null) {
mc.renderEngine.bindTexture(affinities[0].getAffinityIconTexture(mc.thePlayer, mc.theWorld));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F);
drawModalRectWithCustomSizedTexture(187, 104, 0, 0, 16, 16, 16, 16);
}
if (affinities[1] != null) {
mc.renderEngine.bindTexture(affinities[1].getAffinityIconTexture(mc.thePlayer, mc.theWorld));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F);
drawModalRectWithCustomSizedTexture(207, 104, 0, 0, 16, 16, 16, 16);
}
if (affinities[2] != null) {
mc.renderEngine.bindTexture(affinities[2].getAffinityIconTexture(mc.thePlayer, mc.theWorld));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F);
drawModalRectWithCustomSizedTexture(187, 124, 0, 0, 16, 16, 16, 16);
}
if (affinities[3] != null) {
mc.renderEngine.bindTexture(affinities[3].getAffinityIconTexture(mc.thePlayer, mc.theWorld));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F);
drawModalRectWithCustomSizedTexture(207, 124, 0, 0, 16, 16, 16, 16);
}
}
@Override
public void drawGuiContainerBackground(float partialTicks, int mouseX, int mouseY) {
}
}