You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NR-Core provides you with a lot of utils, this one is no different! Here we contain methods for saving your inventory and armor and then reloading it to the player. We also provide the ability to turn your inventory into a string and back again!
Storing Armor and Inventory
Say you want to store the player's armor and inventory for a short period of time, (Like a duel) then give it back after!
So easy! The first function #storeAndClearInventory(); store's the player's inventory and armor into a hashmap for later use.
Then after that #setPlayerContents(); takes those items from the hashmap and give's it back to the player, getting rid of their current items. The true at the second argument tells the code to also remove the player's stored items from memory, if you aren't going to call #setPlayerContents(); again before #storeAndClearInventory();, I'd recommend leaving it at true.