[SPIGOT-1835] Create Convenience Method in org.bukkit.Server to get OfflinePlayer from a String UUID Created: 07/Mar/16 Updated: 08/Mar/16 Resolved: 08/Mar/16 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature | Priority: | Minor |
Reporter: | Jasper Reddin | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 0 |
Labels: | api, bukkit, spigot |
Description |
Just a quick suggestion: Add a convenience method in org.bukkit.Server to get an OfflinePlayer object with a UUID string. Currently anyone who wishes to get an offline player if they have the UUID in string form, they have to use this: Bukkit.getOfflinePlayer(UUID.fromString("<uuid of player>"));
This can be done simply by putting the line above in a method in org.bukkit.Server: public OfflinePlayer getOfflinePlayerWithUUID(String uuid){ return this.getOfflinePlayer(UUID.fromString(uuid)); } |
Comments |
Comment by Black Hole [ 07/Mar/16 ] |
And that's the catch: To support multiple UUID formats. The method requires an UUID, so just create it. You might even reuse the UUID object for other methods. |
Comment by Eddie Brown [ 07/Mar/16 ] |
Would be nice if it accepted trimmed and un-trimmed uuids. (Eg. with and without the dashes) |