    001package cpw.mods.fml.client.registry;
    002
    003import cpw.mods.fml.common.registry.GameRegistry;
    004import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
    005import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
    006import net.minecraft.tileentity.TileEntity;
    007
    008public class ClientRegistry
    009{
    010    /**
    011     *
    012     * Utility method for registering a tile entity and it's renderer at once - generally you should register them separately
    013     *
    014     * @param tileEntityClass
    015     * @param id
    016     * @param specialRenderer
    017     */
    018    public static void registerTileEntity(Class <? extends TileEntity > tileEntityClass, String id, TileEntitySpecialRenderer specialRenderer)
    019    {
    020        GameRegistry.registerTileEntity(tileEntityClass, id);
    021        bindTileEntitySpecialRenderer(tileEntityClass, specialRenderer);
    022    }
    023
    024    public static void bindTileEntitySpecialRenderer(Class <? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer)
    025    {
    026        TileEntityRenderer.instance.specialRendererMap.put(tileEntityClass, specialRenderer);
    027        specialRenderer.setTileEntityRenderer(TileEntityRenderer.instance);
    028    }
    029}