Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. public static void renderInventorySlot(int slot, int x, int y, float partialTicks)
  2. {
  3. GL11.glEnable(GL12.GL_RESCALE_NORMAL);
  4. RenderHelper.enableGUIStandardItemLighting();
  5. ItemStack itemstack = Minecraft.getMinecraft().player.inventory.mainInventory.get(slot);
  6. if (itemstack != null)
  7. {
  8. float f1 = (float)itemstack.getAnimationsToGo() - partialTicks;
  9. if (f1 > 0.0F)
  10. {
  11. GL11.glPushMatrix();
  12. float f2 = 1.0F + f1 / 5.0F;
  13. GL11.glTranslatef((float)(x + 8), (float)(y + 12), 0.0F);
  14. GL11.glScalef(1.0F / f2, (f2 + 1.0F) / 2.0F, 1.0F);
  15. GL11.glTranslatef((float)(-(x + 8)), (float)(-(y + 12)), 0.0F);
  16. }
  17. Minecraft.getMinecraft().getRenderItem().renderItemAndEffectIntoGUI(itemstack, x, y);
  18. if (f1 > 0.0F)
  19. {
  20. GL11.glPopMatrix();
  21. }
  22. Minecraft.getMinecraft().getRenderItem().renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, itemstack, x, y, null);
  23. }
  24. RenderHelper.disableStandardItemLighting();
  25. GL11.glDisable(GL12.GL_RESCALE_NORMAL);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement