package infstudio.exoticpower.gui.inventory; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.resources.I18n; import net.minecraft.inventory.Container; import net.minecraft.util.StatCollector; import java.util.Iterator; import java.util.List; public class GuiMachine extends GuiContainer { public String name; public GuiMachine(Container p_i1072_1_) { super(p_i1072_1_); } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { String s = StatCollector.translateToLocal(name); this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4718847); this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4718847); } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { // TODO Auto-generated method stub } protected void drawHoveringText(List textLines, int x, int y, FontRenderer font) { if (!textLines.isEmpty()) { GlStateManager.disableRescaleNormal(); RenderHelper.disableStandardItemLighting(); GlStateManager.disableLighting(); GlStateManager.disableDepth(); int k = 0; Iterator iterator = textLines.iterator(); while (iterator.hasNext()) { String s = (String) iterator.next(); int l = font.getStringWidth(s); if (l > k) { k = l; } } int j2 = x + 12; int k2 = y - 12; int i1 = 8; if (textLines.size() > 1) { i1 += 2 + (textLines.size() - 1) * 10; } if (j2 + k > this.width) { j2 -= 28 + k; } if (k2 + i1 + 6 > this.height) { k2 = this.height - i1 - 6; } this.zLevel = 300.0F; this.itemRender.zLevel = 300.0F; int j1 = -267386864; this.drawGradientRect(j2 - 3, k2 - 4, j2 + k + 3, k2 - 3, j1, j1); this.drawGradientRect(j2 - 3, k2 + i1 + 3, j2 + k + 3, k2 + i1 + 4, j1, j1); this.drawGradientRect(j2 - 3, k2 - 3, j2 + k + 3, k2 + i1 + 3, j1, j1); this.drawGradientRect(j2 - 4, k2 - 3, j2 - 3, k2 + i1 + 3, j1, j1); this.drawGradientRect(j2 + k + 3, k2 - 3, j2 + k + 4, k2 + i1 + 3, j1, j1); int k1 = 1347420415; int l1 = (k1 & 16711422) >> 1 | k1 & -16777216; this.drawGradientRect(j2 - 3, k2 - 3 + 1, j2 - 3 + 1, k2 + i1 + 3 - 1, k1, l1); this.drawGradientRect(j2 + k + 2, k2 - 3 + 1, j2 + k + 3, k2 + i1 + 3 - 1, k1, l1); this.drawGradientRect(j2 - 3, k2 - 3, j2 + k + 3, k2 - 3 + 1, k1, k1); this.drawGradientRect(j2 - 3, k2 + i1 + 2, j2 + k + 3, k2 + i1 + 3, l1, l1); for (int i2 = 0; i2 < textLines.size(); ++i2) { String s1 = (String) textLines.get(i2); font.drawStringWithShadow(s1, j2, k2, -1); if (i2 == 0) { k2 += 2; } k2 += 10; } this.zLevel = 0.0F; this.itemRender.zLevel = 0.0F; GlStateManager.enableLighting(); GlStateManager.enableDepth(); RenderHelper.enableStandardItemLighting(); GlStateManager.enableRescaleNormal(); } } }