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 015 package net.minecraft.src; 016 017 import java.awt.Dimension; 018 import java.util.List; 019 import java.util.logging.Level; 020 import java.util.logging.Logger; 021 022 import cpw.mods.fml.client.TextureFXManager; 023 import cpw.mods.fml.client.registry.RenderingRegistry; 024 import cpw.mods.fml.common.FMLLog; 025 026 /** 027 * 028 * A static hook library for optifine and other basemod editing code to access FML functions 029 * 030 * @author cpw 031 * 032 */ 033 public class FMLRenderAccessLibrary 034 { 035 public static Logger getLogger() 036 { 037 return FMLLog.getLogger(); 038 } 039 040 public static void log(Level level, String message) 041 { 042 FMLLog.log(level, message); 043 } 044 045 public static void log(Level level, String message, Throwable throwable) 046 { 047 FMLLog.log(level, throwable, message); 048 } 049 050 public static void setTextureDimensions(int textureId, int width, int height, List<TextureFX> textureFXList) 051 { 052 TextureFXManager.instance().setTextureDimensions(textureId, width, height, textureFXList); 053 } 054 055 public static void preRegisterEffect(TextureFX textureFX) 056 { 057 TextureFXManager.instance().onPreRegisterEffect(textureFX); 058 } 059 060 public static boolean onUpdateTextureEffect(TextureFX textureFX) 061 { 062 return TextureFXManager.instance().onUpdateTextureEffect(textureFX); 063 } 064 065 public static Dimension getTextureDimensions(TextureFX textureFX) 066 { 067 return TextureFXManager.instance().getTextureDimensions(textureFX); 068 } 069 070 public static void onTexturePackChange(RenderEngine engine, TexturePackBase texturePack, List<TextureFX> textureFXList) 071 { 072 TextureFXManager.instance().onTexturePackChange(engine, texturePack, textureFXList); 073 } 074 075 @SuppressWarnings("deprecation") 076 public static boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelId) 077 { 078 return RenderingRegistry.instance().renderWorldBlock(renderer, world, x, y, z, block, modelId); 079 } 080 081 @SuppressWarnings("deprecation") 082 public static void renderInventoryBlock(RenderBlocks renderer, Block block, int metadata, int modelID) 083 { 084 RenderingRegistry.instance().renderInventoryBlock(renderer, block, metadata, modelID); 085 } 086 087 @SuppressWarnings("deprecation") 088 public static boolean renderItemAsFull3DBlock(int modelId) 089 { 090 return RenderingRegistry.instance().renderItemAsFull3DBlock(modelId); 091 } 092 }