-
Notifications
You must be signed in to change notification settings - Fork 0
Obtaining a Person Object
HelightDev edited this page Sep 2, 2019
·
2 revisions
You generally have three options to obtain a Person object.
Using the UserAPI
UserAPI.getPerson("PlayerNameOrUUID");
- Can resolve UUID and Name [+]
- Is thread-blocking and should therefor only be used in asynchronous Processes [/]
- Does multiple Database Queries [-]
Using SpecificPerson Implementations
Person person = BukkitPerson.fromPlayer(player);
- Doesn't need any Database Connection and therefor is very fast [+]
- Isn't thread-blocking and can therefor be used in the mainthread without interrupting the heartbeat [/]
- Code is platform-specific [-]
Person person = new Person(null,"YourUUID","YourName");
- Completely depends on the way, the arguments are obtained [/]