public static IIcon[] unstitchIcons(IIconRegister iconRegister, String name, int numIcons) {
return unstitchIcons(iconRegister, name, numIcons, 1);
}
public static IIcon[] unstitchIcons(IIconRegister iconRegister, String name, int columns, int rows) {
TextureMap textureMap = (TextureMap) iconRegister;
int numIcons = rows * columns;
IIcon[] icons = new IIcon[numIcons];
for (int i = 0; i < numIcons; i++) {
String texName = name + "." + i;
TextureAtlasSheet texture = new TextureAtlasSheet(texName, i, rows, columns);
textureMap.setTextureEntry(texName, texture);
icons[i] = texture;
}
return icons;
}