001/*
002 * The FML Forge Mod Loader suite.
003 * Copyright (C) 2012 cpw
004 *
005 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free
006 * Software Foundation; either version 2.1 of the License, or any later version.
007 *
008 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
009 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
010 *
011 * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51
012 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
013 */
014
015package net.minecraft.src;
016
017import java.awt.Dimension;
018import java.util.List;
019import java.util.logging.Level;
020import java.util.logging.Logger;
021
022import net.minecraft.block.Block;
023import net.minecraft.client.renderer.RenderBlocks;
024import net.minecraft.client.renderer.RenderEngine;
025import net.minecraft.client.renderer.texturefx.TextureFX;
026import net.minecraft.client.texturepacks.ITexturePack;
027import net.minecraft.world.IBlockAccess;
028
029import cpw.mods.fml.client.TextureFXManager;
030import cpw.mods.fml.client.registry.RenderingRegistry;
031import cpw.mods.fml.common.FMLLog;
032
033/**
034 *
035 * A static hook library for optifine and other basemod editing code to access FML functions
036 *
037 * @author cpw
038 *
039 */
040public class FMLRenderAccessLibrary
041{
042    public static Logger getLogger()
043    {
044        return FMLLog.getLogger();
045    }
046
047    public static void log(Level level, String message)
048    {
049        FMLLog.log(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    public static void setTextureDimensions(int textureId, int width, int height, List<TextureFX> textureFXList)
058    {
059        TextureFXManager.instance().setTextureDimensions(textureId, width, height, textureFXList);
060    }
061
062    public static void preRegisterEffect(TextureFX textureFX)
063    {
064        TextureFXManager.instance().onPreRegisterEffect(textureFX);
065    }
066
067    public static boolean onUpdateTextureEffect(TextureFX textureFX)
068    {
069        return TextureFXManager.instance().onUpdateTextureEffect(textureFX);
070    }
071
072    public static Dimension getTextureDimensions(TextureFX textureFX)
073    {
074        return TextureFXManager.instance().getTextureDimensions(textureFX);
075    }
076
077    public static void onTexturePackChange(RenderEngine engine, ITexturePack texturePack, List<TextureFX> textureFXList)
078    {
079        TextureFXManager.instance().onTexturePackChange(engine, texturePack, textureFXList);
080    }
081
082    @SuppressWarnings("deprecation")
083    public static boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelId)
084    {
085        return RenderingRegistry.instance().renderWorldBlock(renderer, world, x, y, z, block, modelId);
086    }
087
088    @SuppressWarnings("deprecation")
089    public static void renderInventoryBlock(RenderBlocks renderer, Block block, int metadata, int modelID)
090    {
091        RenderingRegistry.instance().renderInventoryBlock(renderer, block, metadata, modelID);
092    }
093
094    @SuppressWarnings("deprecation")
095    public static boolean renderItemAsFull3DBlock(int modelId)
096    {
097        return RenderingRegistry.instance().renderItemAsFull3DBlock(modelId);
098    }
099}