mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-10-31 16:00:52 +01:00
Inform about the purpose of the fromItemStack (fromItemTag) method.
This commit is contained in:
parent
dbc28c0035
commit
f791e2726f
@ -112,14 +112,16 @@ public class NbtFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a wrapper for an NBT tag stored (in memory) in an item stack.
|
* Construct a wrapper for an NBT tag stored (in memory) in an item stack. This is where
|
||||||
|
* auxillary data such as enchanting, name and lore is stored. It doesn't include the items
|
||||||
|
* material, damage value or count.
|
||||||
* <p>
|
* <p>
|
||||||
* The item stack must be a wrapper for a CraftItemStack. Use
|
* The item stack must be a wrapper for a CraftItemStack. Use
|
||||||
* {@link MinecraftReflection#getBukkitItemStack(ItemStack)} if not.
|
* {@link MinecraftReflection#getBukkitItemStack(ItemStack)} if not.
|
||||||
* @param stack - the item stack.
|
* @param stack - the item stack.
|
||||||
* @return A wrapper for its NBT tag.
|
* @return A wrapper for its NBT tag.
|
||||||
*/
|
*/
|
||||||
public static NbtWrapper<?> fromItemStack(ItemStack stack) {
|
public static NbtWrapper<?> fromItemTag(ItemStack stack) {
|
||||||
if (!MinecraftReflection.isCraftItemStack(stack))
|
if (!MinecraftReflection.isCraftItemStack(stack))
|
||||||
throw new IllegalArgumentException("Stack must be a CraftItemStack.");
|
throw new IllegalArgumentException("Stack must be a CraftItemStack.");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user