Saving and Setting Inventory - not refreshing

Discussion in 'Plugin Development' started by jojohnson1, Mar 3, 2013.

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

    jojohnson1

    Hello,
    I've got some code how to save and load a player's inventory from a hashmap, and how to assign it to a player.
    However, when I change the player's inventory, the game only seems to refresh the item in hand, so that the whole inventory is still how it has been before, just the ItemInHand has changed. Only after a re-login, the changes become visible.
    I tried player.updateInventory(); which is deprecated but it worked! The source code says that "This method should not be relied upon" but as I said, it worked!

    So is there a better way to refresh the inventory? Or shall I use the deprecated method?
    Thanks
    jojohnson1
     
  2. Offline

    minoneer

    No, there is no better way right now. player.updateInventory() is the way to go.
     
  3. Offline

    jojohnson1

Thread Status:
Not open for further replies.

Share This Page