MapView to ItemStack

Discussion in 'Plugin Development' started by DjTamo, Dec 28, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    DjTamo

    I have made some custom MapRenderers and have created some MapViews with those renderers but I cannot figure out how to put them into an ItemStack. I'm sure I'm missing something obvious. Any help would be appreciated! Thanks!

    AoH_Ruthless Perhaps you know?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  2. Offline

    Syd

    new ItemStack(Material.MAP, 1, mapview.getId());
    should work...
     
  3. Offline

    DjTamo

    getId() is Deprecated and there are usually better alternatives to deprecated methods, but if this is the only way then I guess I'll have to use it.
     
  4. Offline

    Syd

    DjTamo
    As far as I know it's the only way to identify maps, so you have to use it...^^
     
  5. Offline

    DjTamo

    Alright thanks alot Syd! Appreciate it. Even if it does bug me thats its deprecated :)
     
  6. Offline

    AoH_Ruthless

    DjTamo Syd
    Code:java
    1. short data = YourDataValue;
    2. ItemStack is = new ItemStack(Material.MAP);
    3. is.setDurability(data);

    I don't think this is deprecated, either, but I could be wrong.
     
Thread Status:
Not open for further replies.

Share This Page