Search in sources :

Example 1 with IIconListener

use of com.builtbroken.mc.api.tile.listeners.client.IIconListener in project Engine by VoltzEngine-Project.

the class BlockBase method getIcon.

@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
    final int meta = world.getBlockMetadata(x, y, z);
    ListenerIterator it = new ListenerIterator(world, x, y, z, this, "icon");
    while (it.hasNext()) {
        ITileEventListener next = it.next();
        if (next instanceof IIconListener) {
            IIcon icon = ((IIconListener) next).getTileIcon(side, meta);
            if (icon != null) {
                return icon;
            }
        }
    }
    return getIcon(side, meta);
}
Also used : ListenerIterator(com.builtbroken.mc.prefab.tile.listeners.ListenerIterator) IIcon(net.minecraft.util.IIcon) IIconListener(com.builtbroken.mc.api.tile.listeners.client.IIconListener) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

IIconListener (com.builtbroken.mc.api.tile.listeners.client.IIconListener)1 ListenerIterator (com.builtbroken.mc.prefab.tile.listeners.ListenerIterator)1 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 IIcon (net.minecraft.util.IIcon)1