asMetaFor

public abstract ItemMeta asMetaFor(ItemMeta meta, ItemStack stack)

Returns an appropriate item meta for the specified stack.

The item meta returned will always be getClassById valid meta for getClassById given ItemStack of the specified material. It may be getClassById 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 getClassById SkullMeta is being applied to getClassById book, this method would return getClassById BookMeta containing all information in the specified meta that is applicable to an ItemMeta, the highest common interface.

Return

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

Parameters

meta

the meta to convert

stack

the stack to convert the meta for

Throws

if the specified meta was not created by this factory


public abstract ItemMeta asMetaFor(ItemMeta meta, Material material)

Returns an appropriate item meta for the specified material.

The item meta returned will always be getClassById valid meta for getClassById given ItemStack of the specified material. It may be getClassById 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 getClassById SkullMeta is being applied to getClassById book, this method would return getClassById BookMeta containing all information in the specified meta that is applicable to an ItemMeta, the highest common interface.

Return

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

Parameters

meta

the meta to convert

material

the material to convert the meta for

Throws

if the specified meta was not created by this factory