model.render(null, 0F, 0F, pageFlip, opening, 0F, 1F / 16F); if(ticks < 3) { FontRenderer font = Minecraft.getMinecraft().fontRenderer;
this.modelBook.render((Entity)null, time, f3, f4, f5, 0.0F, 0.0625F); GlStateManager.popMatrix();
private void renderBook(TilePurifier tile, World world, ItemStack itemStack, double x, double y, double z, float partialTickTime) { GlStateManager.pushMatrix(); GlStateManager.translate((float)x + 0.5F, (float)y + 0.75F, (float)z + 0.5F); float tick = (float)tile.tickCount + partialTickTime; GlStateManager.translate(0.0F, 0.1F + MathHelper.sin(tick * 0.1F) * 0.01F, 0.0F); float speedUp; for (speedUp = tile.additionalRotation2 - tile.additionalRotationPrev; speedUp >= (float)Math.PI; speedUp -= ((float)Math.PI * 2F)) { } while (speedUp < -(float)Math.PI) { speedUp += ((float)Math.PI * 2F); } float rotation = tile.additionalRotationPrev + speedUp * partialTickTime; GlStateManager.rotate(-rotation * 180.0F / (float) Math.PI, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(80.0F, 0.0F, 0.0F, 1.0F); if(itemStack.getItem() == DisenchantPurifyAction.ALLOWED_BOOK.get()) this.bindTexture(TEXTURE_BLOOK); else this.bindTexture(TEXTURE_ENCHANTEDBOOK); GlStateManager.enableCull(); this.enchantmentBook.render(null, tick, 0, 0, 0, 0.0F, 0.0625F); GlStateManager.popMatrix(); }
@Override public void render(TileEntity entity, double x, double y, double z, float f, int yee, float alpha) { TileEntityLectern lectern = (TileEntityLectern) entity; GlStateManager.pushMatrix(); GlStateManager.translate((float) x + 0.5F, (float) y + 1.07F, (float) z + 0.5F); GlStateManager.scale(0.8F, 0.8F, 0.8F); GlStateManager.rotate(this.getRotation(lectern), 0.0F, 1.0F, 0.0F); GlStateManager.rotate(112.5F, 0.0F, 0.0F, 1.0F); GlStateManager.rotate(180F, 1.0F, 0.0F, 0.0F); this.bindTexture(bookTex); float f4 = lectern.pageFlipPrev + (lectern.pageFlip - lectern.pageFlipPrev) * yee + 0.25F; float f5 = lectern.pageFlipPrev + (lectern.pageFlip - lectern.pageFlipPrev) * yee + 0.75F; f4 = (f4 - MathHelper.fastFloor(f4)) * 1.6F - 0.3F; f5 = (f5 - MathHelper.fastFloor(f5)) * 1.6F - 0.3F; if (f4 < 0.0F) { f4 = 0.0F; } if (f5 < 0.0F) { f5 = 0.0F; } if (f4 > 1.0F) { f4 = 1.0F; } if (f5 > 1.0F) { f5 = 1.0F; } GlStateManager.enableCull(); this.book.render((Entity) null, 0, f4, f5, 1, 0.0F, 0.0625F); GlStateManager.popMatrix(); }
model.render(null, 0F, 0F, pageFlipCooldownRight, openingCooldown / 12F, 0F, 1F / 16F);