Convert from Bukkit ItemStack to CraftItemStack

Discussion in 'Plugin Development' started by MyPasswordIsPassword, Feb 2, 2013.

Thread Status:
Not open for further replies.
  1. How do I convert a Bukkit ItemStack to a CraftBukkit CraftItemStack? It is also important to note that I can't just copy the data and damage values because the ItemStacks I'm working with are renamed, etc.
     
  2. Offline

    Comphenix

    It is possible, though it will (inevitable) involve copying:
    Code:java
    1.  
    2. ItemStack test = new ItemStack(Material.Stone, 1);
    3. CraftItemStack item = CraftItemStack asCraftCopy(test);
    4.  
     
Thread Status:
Not open for further replies.

Share This Page