001/*
002 * Forge Mod Loader
003 * Copyright (c) 2012-2013 cpw.
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser Public License v2.1
006 * which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
008 * 
009 * Contributors:
010 *     cpw - implementation
011 */
012
013package net.minecraft.src;
014
015import java.awt.Dimension;
016import java.util.List;
017import java.util.logging.Level;
018import java.util.logging.Logger;
019
020import net.minecraft.block.Block;
021import net.minecraft.client.renderer.RenderBlocks;
022import net.minecraft.client.renderer.RenderEngine;
023import net.minecraft.client.renderer.texture.Texture;
024import net.minecraft.client.texturepacks.ITexturePack;
025import net.minecraft.world.IBlockAccess;
026
027import cpw.mods.fml.client.TextureFXManager;
028import cpw.mods.fml.client.registry.RenderingRegistry;
029import cpw.mods.fml.common.FMLLog;
030
031/**
032 *
033 * A static hook library for optifine and other basemod editing code to access FML functions
034 *
035 * @author cpw
036 *
037 */
038public class FMLRenderAccessLibrary
039{
040    public static Logger getLogger()
041    {
042        Logger l = Logger.getLogger("FMLRenderAccessLibrary");
043        l.setParent(FMLLog.getLogger());
044        return l;
045    }
046
047    public static void log(Level level, String message)
048    {
049        FMLLog.log("FMLRenderAccessLibrary", level, message);
050    }
051
052    public static void log(Level level, String message, Throwable throwable)
053    {
054        FMLLog.log(level, throwable, message);
055    }
056
057    @SuppressWarnings("deprecation")
058    public static boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelId)
059    {
060        return RenderingRegistry.instance().renderWorldBlock(renderer, world, x, y, z, block, modelId);
061    }
062
063    @SuppressWarnings("deprecation")
064    public static void renderInventoryBlock(RenderBlocks renderer, Block block, int metadata, int modelID)
065    {
066        RenderingRegistry.instance().renderInventoryBlock(renderer, block, metadata, modelID);
067    }
068
069    @SuppressWarnings("deprecation")
070    public static boolean renderItemAsFull3DBlock(int modelId)
071    {
072        return RenderingRegistry.instance().renderItemAsFull3DBlock(modelId);
073    }
074
075    public static void doTextureCopy(Texture atlas, Texture source, int targetX, int targetY)
076    {
077        TextureFXManager.instance().getHelper().doTextureCopy(atlas, source, targetX, targetY);        
078    }
079}