    001package net.minecraft.client.renderer.tileentity;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import net.minecraft.client.gui.FontRenderer;
    006import net.minecraft.client.renderer.RenderEngine;
    007import net.minecraft.tileentity.TileEntity;
    008import net.minecraft.world.World;
    009
    010@SideOnly(Side.CLIENT)
    011public abstract class TileEntitySpecialRenderer
    012{
    013    /**
    014     * The TileEntityRenderer instance associated with this TileEntitySpecialRenderer
    015     */
    016    protected TileEntityRenderer tileEntityRenderer;
    017
    018    public abstract void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8);
    019
    020    /**
    021     * Binds a texture to the renderEngine given a filename from the JAR.
    022     */
    023    protected void bindTextureByName(String par1Str)
    024    {
    025        RenderEngine var2 = this.tileEntityRenderer.renderEngine;
    026
    027        if (var2 != null)
    028        {
    029            var2.bindTexture(var2.getTexture(par1Str));
    030        }
    031    }
    032
    033    /**
    034     * Binds a texture that Minecraft will attempt to load from the given URL.  (arguments: url, localFallback)
    035     */
    036    protected void bindTextureByURL(String par1Str, String par2Str)
    037    {
    038        RenderEngine var3 = this.tileEntityRenderer.renderEngine;
    039
    040        if (var3 != null)
    041        {
    042            var3.bindTexture(var3.getTextureForDownloadableImage(par1Str, par2Str));
    043        }
    044    }
    045
    046    /**
    047     * Associate a TileEntityRenderer with this TileEntitySpecialRenderer
    048     */
    049    public void setTileEntityRenderer(TileEntityRenderer par1TileEntityRenderer)
    050    {
    051        this.tileEntityRenderer = par1TileEntityRenderer;
    052    }
    053
    054    /**
    055     * Called when the ingame world being rendered changes (e.g. on world -> nether travel) due to using one renderer
    056     * per tile entity type, rather than instance
    057     */
    058    public void onWorldChange(World par1World) {}
    059
    060    public FontRenderer getFontRenderer()
    061    {
    062        return this.tileEntityRenderer.getFontRenderer();
    063    }
    064}