Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void renderTileEntityAt(TileEntityRockTumbler te, double x, double y, double z, float partialTicks, int destroyStage) {
- GlStateManager.pushAttrib();
- GlStateManager.pushMatrix();
- // Translate to the location of our tile entity
- GlStateManager.translate(x, y, z);
- GlStateManager.disableRescaleNormal();
- // Render the rotating handles
- renderBarrel(te);
- GlStateManager.popMatrix();
- GlStateManager.popAttrib();
- }
- private void renderBarrel(TileEntityRockTumbler te) {
- GlStateManager.pushMatrix();
- GlStateManager.translate(0.375, 0.625, 0);
- long angle = (System.currentTimeMillis() / 10) % 360;
- GlStateManager.rotate(angle, 0, 0, 1);
- GlStateManager.translate(-0.375, -0.625, 0);
- // RenderHelper.disableStandardItemLighting();
- this.bindTexture(TextureMap.locationBlocksTexture);
- // if (Minecraft.isAmbientOcclusionEnabled()) {
- // GlStateManager.shadeModel(GL11.GL_SMOOTH);
- // } else {
- // GlStateManager.shadeModel(GL11.GL_FLAT);
- // }
- World world = te.getWorld();
- // Translate back to local view coordinates so that we can do the acual rendering here
- GlStateManager.translate(-te.getPos().getX(), -te.getPos().getY(), -te.getPos().getZ());
- Tessellator tessellator = Tessellator.getInstance();
- tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
- Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModel(
- world,
- getBakedModel(),
- world.getBlockState(te.getPos()),
- te.getPos(),
- Tessellator.getInstance().getBuffer(), false);
- tessellator.draw();
- // RenderHelper.enableStandardItemLighting();
- GlStateManager.popMatrix();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement