API for offline players doesn't work #77
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm trying to get inventory of online and offline players using OpenInv API, but it only works for online players. When I'm trying to get inventory of offline player I'm getting null :/
(getting openinv instance in main plugin class)
{trying to get player inv by uuid)
Note: opeinv.getInventory() also works only for online players
(probably not related, because this code works for online players, but I'm executing it as async task)
Well, yeah, you're using
OfflinePlayer#getPlayer
to obtain your Player object. That returns null for offline players.If you want to support name input as well:
I also strongly recommend you only load the player async, then manipulate the inventory on the main thread. You're opening yourself to concurrency issues otherwise.
Thank you, but I don't want to manipulate inventories for now, only read them :)