asMetaFor

The item meta returned will always be a valid meta for a given
ItemStack of the specified material. It may be a more or less specific
meta, and could also be the same meta or meta type as the parameter.
The item meta returned will also always be the most appropriate meta.

Example, if a SkullMeta is being applied to a book, this method
would return a BookMeta containing all information in the
specified meta that is applicable to an ItemMeta, the highest
common interface.

Parameters:

meta - the meta to convert

stack - the stack to convert the meta for

Returns:

An appropriate item meta for the specified item stack. No
guarantees are made as to if a copy is returned. This will be null
for a stack of air.

asMetaFor

The item meta returned will always be a valid meta for a given
ItemStack of the specified material. It may be a more or less specific
meta, and could also be the same meta or meta type as the parameter.
The item meta returned will also always be the most appropriate meta.

Example, if a SkullMeta is being applied to a book, this method
would return a BookMeta containing all information in the
specified meta that is applicable to an ItemMeta, the highest
common interface.

Parameters:

meta - the meta to convert

material - the material to convert the meta for

Returns:

An appropriate item meta for the specified item material. No
guarantees are made as to if a copy is returned. This will be null for air.