resonant-induction/archive/java/dark/lib/ClientRegistryProxy.java

33 lines
1 KiB
Java
Raw Normal View History

package dark.lib;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import com.builtbroken.common.Pair;
import cpw.mods.fml.client.registry.ClientRegistry;
import dark.lib.IExtraInfo.IExtraBlockInfo;
public class ClientRegistryProxy extends RegistryProxy
{
@Override
public void registerBlock(Block block, Class<? extends ItemBlock> itemClass, String name, String modID)
{
super.registerBlock(block, itemClass, name, modID);
if (block instanceof IExtraBlockInfo)
{
List<Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer>> set = new ArrayList<Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer>>();
((IExtraBlockInfo) block).getClientTileEntityRenderers(set);
for (Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer> par : set)
{
ClientRegistry.bindTileEntitySpecialRenderer(par.left(), par.right());
}
}
}
}