Created
November 29, 2015 23:30
-
-
Save vemacs/33bd4eb9378ba0e6a8a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings("deprecation") | |
private UUID getIdFromBukkit(String name) { | |
Bukkit.getLogger().warning("Using potentially blocking Bukkit UUID lookup for: " + name); | |
UUID uuid = Bukkit.getOfflinePlayer(name).getUniqueId(); | |
// If the uuid matches the fake one from Bukkit, return it as fake | |
if (uuid.equals(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)))) { | |
return null; | |
} else { | |
return uuid; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment