// glPushMatrix или glPopMatrix могут быть лишними
private void drawHotBar(RenderGameOverlayEvent e) {
if(e.type == ElementType.ALL) {
GL11.glPushMatrix();
GL11.glPushMatrix();
GL11.glTranslatef((float)(e.resolution.getScaledWidth() / 2 - 110), (float)(e.resolution.getScaledHeight() - 19), 0.0F);
Tessellator t = Tessellator.instance;
GL11.glBindTexture(3553, TextureMap.get("slot1").getGlTextureId());//Текстура
GL11.glEnable(3042);
if(this.mc.thePlayer.inventory.currentItem >= 0 && this.mc.thePlayer.inventory.currentItem <= 9) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
RenderHelper.disableStandardItemLighting();
t.startDrawingQuads();
t.addVertexWithUV((double)(-2 + this.mc.thePlayer.inventory.currentItem * 18), 0.0D, 0.0D, 0.0D, 0.0D);
t.addVertexWithUV((double)(-2 + this.mc.thePlayer.inventory.currentItem * 18), 16.0D, 0.0D, 0.0D, 1.0D);
t.addVertexWithUV((double)(16 + this.mc.thePlayer.inventory.currentItem * 18), 16.0D, 0.0D, 1.0D, 1.0D);
t.addVertexWithUV((double)(16 + this.mc.thePlayer.inventory.currentItem * 18), 0.0D, 0.0D, 1.0D, 0.0D);
t.draw();
GL11.glPopMatrix();
}
GL11.glPushMatrix();
for(int i = 0; i < 9; ++i) {
GL11.glBindTexture(3553, TextureMap.get("slot").getGlTextureId());
GL11.glEnable(3042);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
RenderHelper.disableStandardItemLighting();
t.startDrawingQuads();
t.addVertexWithUV((double)(-2 + i * 18), 0.0D, 0.0D, 0.0D, 0.0D);
t.addVertexWithUV((double)(-2 + i * 18), 18.0D, 0.0D, 0.0D, 1.0D);
t.addVertexWithUV((double)(16 + i * 18), 18.0D, 0.0D, 1.0D, 1.0D);
t.addVertexWithUV((double)(16 + i * 18), 0.0D, 0.0D, 1.0D, 0.0D);
t.draw();
this.renderInventorySlot(i, i * 18, 0, 0.0F);
}
GL11.glPopMatrix();
GL11.glPushMatrix();
for(int i = 9; i < 18; ++i) {
GL11.glTranslatef((float)(e.resolution.getScaledWidth() / 2 - 110), (float)(e.resolution.getScaledHeight() - 40), 0.0F);
GL11.glBindTexture(3553, TextureMap.get("slot").getGlTextureId());
GL11.glEnable(3042);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
RenderHelper.disableStandardItemLighting();
t.startDrawingQuads();
t.addVertexWithUV((double)(-2 + i * 18), 0.0D, 0.0D, 0.0D, 0.0D);
t.addVertexWithUV((double)(-2 + i * 18), 18.0D, 0.0D, 0.0D, 1.0D);
t.addVertexWithUV((double)(16 + i * 18), 18.0D, 0.0D, 1.0D, 1.0D);
t.addVertexWithUV((double)(16 + i * 18), 0.0D, 0.0D, 1.0D, 0.0D);
t.draw();
this.renderInventorySlot(i, i * 18, 0, 0.0F);
GL11.glPopMatrix();
}
RenderHelper.disableStandardItemLighting();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPopMatrix();
}
}