Advertisement
Creepinson

renderItem()

May 13th, 2017
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1.  
  2. private void renderItem(TileEntityPedastal_Magic te) {
  3. ItemStack stack = te.getStack();
  4. long angle = (System.currentTimeMillis() / 10) % 360;
  5.  
  6. if (!stack.isEmpty()) {
  7. RenderHelper.enableStandardItemLighting();
  8. GlStateManager.enableLighting();
  9. GlStateManager.pushMatrix();
  10. // Translate to the center of the block and .9 points higher
  11. GlStateManager.translate(.5, 1.4, .5);
  12. GlStateManager.scale(.4f, .4f, .4f);
  13. GlStateManager.rotate(angle, te.getPos().getX(), te.getPos().getY(), te.getPos().getZ());
  14.  
  15. Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE);
  16.  
  17. GlStateManager.popMatrix();
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement