ItemStack question!

Discussion in 'Plugin Development' started by ThrustLP, Jan 15, 2017.

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

    ThrustLP

    Hey there, One very short question: These is the Bukkit ItemStack (org.bukkit.inventory.ItemStack) we use normaly and then there is the NMS ItemStack(net.minecraft.server.v1_8_R3.ItemStack) . But what is this used for? One thing I noticed is, that I can only cache a skull with texture in an NMS ItemStack but NOT in an bukkit ItemStack. Why?

    Thanks!
     
  2. Offline

    timtower Administrator Administrator Moderator

    @ThrustLP One is the api ItemStack (won't change a lot)
    Other is the server ItemStack (obfuscated)
     
  3. Offline

    ThrustLP

    Thanks. But why cant the api stack store an texture/keep an texture loaded but the other one can? And do you have another example for me where I would youe the NMS one? Sorry for all those questions but I really want to unserstand, not only copy n paste :3
     
  4. Offline

    timtower Administrator Administrator Moderator

    @ThrustLP To be honest? I have no idea.
    Never needed the NMS one either (more a command guy)
     
  5. @ThrustLP
    I don't know how much you know about the bukkit api, but here's a quick rundown. The Bukkit API is built on top of the regular minecraft server code. The Bukkit API code is nice and clean and rarley ever changes, so you are sure it can always be used. The NMS code however, is mojangs code, which is very likely to change between updates, so you should avoid using it.

    The reason the NMS one has more functionality is simply because that's what the game uses. If you want bukkit to have a similar method, submit a feature request to Spigot.
     
  6. Offline

    ThrustLP

    Thanks you two! So the Bukkit-Coders took some of the ItemStack NMS-Functions and put it in their "clean" api, and some they left out/didn't recognise etc?
     
  7. @ThrustLP
    You can think of it that way, yes.
     
Thread Status:
Not open for further replies.

Share This Page