public class TileEntityBackpackRenderer extends TileEntitySpecialRenderer {
public void renderTileEntityAt(TileEntityBackpack backpack, double x, double y, double z, float partialTicks) {
if ((backpack.getWorldObj() == null) && (backpack.blockType == null)) return;
ItemBackpack item = ((TileBackpack)backpack.getBlockType()).getItemType();
ItemStack stack = ((backpack.stack != null) ? backpack.stack : new ItemStack(item));
ModelBackpack backpackModel = item.getModel();
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glTranslated(x, y + 2.0, z + 1.0);
GL11.glScalef(1.0F, -1.0F, -1.0F);
GL11.glTranslated(0.5, 0.5, 0.5);
ForgeDirection orientation = ForgeDirection.getOrientation(backpack.getBlockMetadata());
int rotation = DirectionUtils.getRotation(orientation);
GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F);
float angle = backpack.prevLidAngle + (backpack.lidAngle - backpack.prevLidAngle) * partialTicks;
angle = 1.0F - angle;
angle = 1.0F - angle * angle;
backpackModel.setLidRotation((float)(angle * Math.PI / 4.0));
int renderPasses = item.getRenderPasses(0);
for (int pass = 0; pass < renderPasses; pass++) {
String type = ((pass == 0) ? null : "overlay");
bindTexture(new ResourceLocation(item.getArmorTexture(stack, null, 0, type)));
RenderUtils.setColorFromInt(item.getColorFromItemStack(stack, pass));
backpackModel.renderAll();
}
if ((backpack.stack != null) &&
(backpack.stack.isItemEnchanted())) {