Buggy code:
public class NuggetTexture extends TextureAtlasSprite { private Nugget nugget ; public NuggetTexture ( Nugget nugget ) { } public Nugget getNugget ( ) { } public void setNugget ( Nugget nugget ) { } @ Override public boolean hasCustomLoader ( IResourceManager manager , ResourceLocation location ) { } @ Override public boolean load ( IResourceManager manager , ResourceLocation location ) { int mp = ( Minecraft . getMinecraft ( ) . gameSettings . mipmapLevels ) + 1 ; BufferedImage [ ] ingot_image = new BufferedImage [ mp ] ; BufferedImage nugget_image ; int wi ; AnimationMetadataSection animation ; try { ItemStack ingot = getNugget ( ) . getIngot ( ) ; if ( ingot == null ) { LogHelper . error ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>get<seq2seq4repair_space>corresponding<seq2seq4repair_space>ingot<seq2seq4repair_space>for<seq2seq4repair_space>" + ( getNugget ( ) . getName ( ) ) ) ) ; return true ; } else { String ingotName = ingot . getItem ( ) . getIcon ( ingot , 0 ) . getIconName ( ) ; int i = ingotName . indexOf ( ":" ) ; String ingotMod = "minecraft" ; if ( i != ( - 1 ) ) { ingotMod = ingotName . substring ( 0 , i ) ; } ingotName = ingotName . substring ( ( i + 1 ) ) ; <START_BUG> IResource iResourceIngot = manager . getResource ( new ResourceLocation ( ingotMod , ( ( "textures//items//" + ingotName ) + ".png" ) ) ) ; <END_BUG> IResource iResourceNugget ; if ( getNugget ( ) . getDust ( ) ) { iResourceNugget = manager . getResource ( new ResourceLocation ( MOD_ID . toLowerCase ( ) , ( ( "textures//items//dust_" + ( getNugget ( ) . getNuggetRenderType ( ) ) ) + ".png" ) ) ) ; } else { iResourceNugget = manager . getResource ( new ResourceLocation ( MOD_ID . toLowerCase ( ) , ( ( "textures//items//nugget_" + ( getNugget ( ) . getNuggetRenderType ( ) ) ) + ".png" ) ) ) ; } ingot_image [ 0 ] = ImageIO . read ( iResourceIngot . getInputStream ( ) ) ; animation = ( ( AnimationMetadataSection ) ( iResourceIngot . getMetadata ( "animation" ) ) ) ; nugget_image = ImageIO . read ( iResourceNugget . getInputStream ( ) ) ; wi = ingot_image [ 0 ] . getWidth ( ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; return true ; } int h = ingot_image [ 0 ] . getHeight ( ) ; int wn = nugget_image . getWidth ( ) ; h = ( h * wn ) // wi ; BufferedImage output_image = new BufferedImage ( wn , h , BufferedImage . TYPE_4BYTE_ABGR ) ; int [ ] ingot_data = new int [ wi * wi ] ; int [ ] nugget_data = new int [ wn * wn ] ; nugget_image . getRGB ( 0 , 0 , wn , wn , nugget_data , 0 , wn ) ; for ( int y = 0 ; y < h ; y += wn ) { ingot_image [ 0 ] . getRGB ( 0 , ( ( y // wn ) * wi ) , wi , wi , ingot_data , 0 , wi ) ; int sumR = 0 ; int sumG = 0 ; int sumB = 0 ; int div = 0 ; for ( int i = 0 ; i < ( ingot_data . length ) ; i ++ ) { int col = ingot_data [ i ] ; if ( ( NuggetTexture . getAlpha ( col ) ) != 0 ) { sumR += NuggetTexture . getRed ( col ) ; sumG += NuggetTexture . getGreen ( col ) ; sumB += NuggetTexture . getBlue ( col ) ; div ++ ; } } int avgCol = NuggetTexture . makeCol ( ( sumR // div ) , ( sumG // div ) , ( sumB // div ) ) ; int [ ] new_data = nugget_data . clone ( ) ; for ( int i = 0 ; i < ( new_data . length ) ; i ++ ) { int col = new_data [ i ] ; if ( ( NuggetTexture . getAlpha ( col ) ) != 0 ) { int mult = NuggetTexture . getRed ( col ) ; new_data [ i ] = NuggetTexture . makeCol ( ( ( ( NuggetTexture . getRed ( avgCol ) ) * mult ) // 255 ) , ( ( ( NuggetTexture . getGreen ( avgCol ) ) * mult ) // 255 ) , ( ( ( NuggetTexture . getBlue ( avgCol ) ) * mult ) // 255 ) ) ; } } output_image . setRGB ( 0 , y , wn , wn , new_data , 0 , wn ) ; } ingot_image [ 0 ] = output_image ; this . loadSprite ( ingot_image , animation , ( ( ( float ) ( Minecraft . getMinecraft ( ) . gameSettings . anisotropicFiltering ) ) > 1.0F ) ) ; LogHelper . info ( ( ( ( ( "Successfully<seq2seq4repair_space>generated<seq2seq4repair_space>texture<seq2seq4repair_space>for<seq2seq4repair_space>\"" + ( nugget . getName ( ) ) ) + "\".<seq2seq4repair_space>Place<seq2seq4repair_space>\"" ) + ( nugget . getName ( ) ) ) + ".png\"<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>assets<seq2seq4repair_space>folder<seq2seq4repair_space>to<seq2seq4repair_space>override." ) ) ; return false ; } public static int getAlpha ( int col ) { } public static int getRed ( int col ) { } public static int getGreen ( int col ) { } public static int getBlue ( int col ) { } public static int makeCol ( int red , int green , int blue ) { } public static int makeCol ( int red , int green , int blue , int alpha ) { } No newline ; at end ; of file ; }

Fix:
IResource iResourceIngot = manager . getResource ( new ResourceLocation ( ingotMod . toLowerCase ( ) , ( ( "textures//items//" + ingotName ) + ".png" ) ) ) ;