Updating inventory after clear?

Discussion in 'Plugin Development' started by randomman159, Sep 6, 2011.

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

    randomman159

    So i use:

    player.getInventory().clear();

    however the player's inventory looks the same until you try to move stuff around or place a block, then it updates and actually clears the inventory. Is there any way i can fix this?

    Need more information? Please ask.
     
  2. Offline

    bergerkiller

    Made this one a while ago:

    It works really nicely, but people will probably suggest you use the deprecated inventory.updateInventory() call after you clear it. Odd enough, this never worked for me, but my custom packet sending code did. :)
     
  3. Offline

    randomman159

    Thanks! That worked... but it being deprecated and all... what's replacing it (or meant to replace it)?
     
  4. Offline

    bergerkiller

    Nothing really. I guess the intended way is to automatically update after changes were done. (the next tick?)
    It's deprecated because this should be a built-in feature...I guess
     
  5. Offline

    geekygenius

    Well, I havnt done much with stuff like this, but I know there is a way to send a chunk update to a client through the World object (I think). Maybe there is something fro an inventory update.
     
Thread Status:
Not open for further replies.

Share This Page