Skip to content
This repository has been archived by the owner on May 2, 2018. It is now read-only.

Commit

Permalink
Fix the selected item sometimes going invisible with utility belts
Browse files Browse the repository at this point in the history
  • Loading branch information
unascribed committed Jun 28, 2015
1 parent 5574e63 commit 09b27bc
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static void tick(Minecraft mc, ItemStack belt) {
public static void renderHotbar(Minecraft mc, ItemStack belt, float partialTicks, int width, int height, int row, ItemStack[] contents) {
mc.mcProfiler.startSection("actionBar");
byte[] locked = FarragoMod.UTILITY_BELT.getLockedSlots(belt, row);

for (int i = 0; i < InventoryPlayer.getHotbarSize(); ++i) {
int x = width / 2 - 90 + i * 20 + 2;
int y = height - 16 - 3;
Expand All @@ -140,7 +140,7 @@ public static void renderHotbar(Minecraft mc, ItemStack belt, float partialTicks
Rendering.drawTexturedModalRect(x-2, y-3, u, 0, 20, 22);
}
if (i == mc.thePlayer.inventory.currentItem) {
Rendering.drawTexturedModalRect(x-4, y-4, 0, 22, 24, 23, 60);
Rendering.drawTexturedModalRect(x-4, y-4, 0, 22, 24, 23, 1);
}
GL11.glColor3f(1.0f, 1.0f, 1.0f);
GL11.glDisable(GL11.GL_BLEND);
Expand Down Expand Up @@ -173,14 +173,15 @@ public static void renderInventorySlot(ItemStack itemstack, int x, int y, float
GL11.glScalef(1.0F / f2, (f2 + 1.0F) / 2.0F, 1.0F);
GL11.glTranslatef((float) (-(x + 8)), (float) (-(y + 12)), 0.0F);
}
itemRenderer.zLevel = 3;
itemRenderer.zLevel += 3;
itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), itemstack, x, y);

if (f1 > 0.0F) {
GL11.glPopMatrix();
}

itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.getTextureManager(), itemstack, x, y);
itemRenderer.zLevel -= 3;
GL11.glPopMatrix();
}
}
Expand Down

0 comments on commit 09b27bc

Please sign in to comment.