Advertisement
Guest User

Untitled

a guest
May 21st, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.94 KB | None | 0 0
  1. @Override
  2.     public void renderTileEntityAt(TileEntityRockTumbler te, double x, double y, double z, float partialTicks, int destroyStage) {
  3.         GlStateManager.pushAttrib();
  4.         GlStateManager.pushMatrix();
  5.  
  6.         // Translate to the location of our tile entity
  7.         GlStateManager.translate(x, y, z);
  8.         GlStateManager.disableRescaleNormal();
  9.  
  10.         // Render the rotating handles
  11.         renderBarrel(te);
  12.  
  13.         GlStateManager.popMatrix();
  14.         GlStateManager.popAttrib();
  15.  
  16.     }
  17.  
  18.     private void renderBarrel(TileEntityRockTumbler te) {
  19.         GlStateManager.pushMatrix();
  20.  
  21.         GlStateManager.translate(0.375, 0.625, 0);
  22.         long angle = (System.currentTimeMillis() / 10) % 360;
  23.         GlStateManager.rotate(angle, 0, 0, 1);
  24.         GlStateManager.translate(-0.375, -0.625, 0);
  25.  
  26.  
  27. //        RenderHelper.disableStandardItemLighting();
  28.        
  29.         this.bindTexture(TextureMap.locationBlocksTexture);
  30. //        if (Minecraft.isAmbientOcclusionEnabled()) {
  31. //            GlStateManager.shadeModel(GL11.GL_SMOOTH);
  32. //        } else {
  33. //            GlStateManager.shadeModel(GL11.GL_FLAT);
  34. //        }
  35.  
  36.         World world = te.getWorld();
  37.         // Translate back to local view coordinates so that we can do the acual rendering here
  38.         GlStateManager.translate(-te.getPos().getX(), -te.getPos().getY(), -te.getPos().getZ());
  39.  
  40.         Tessellator tessellator = Tessellator.getInstance();
  41.         tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
  42.         Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModel(
  43.                 world,
  44.                 getBakedModel(),
  45.                 world.getBlockState(te.getPos()),
  46.                 te.getPos(),
  47.                 Tessellator.getInstance().getBuffer(), false);
  48.         tessellator.draw();
  49.  
  50. //        RenderHelper.enableStandardItemLighting();
  51.         GlStateManager.popMatrix();
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement