3
0

Fetch player's UUID only in online mode

Spigot patch: 0141-Only-fetch-an-online-UUID-in-online-mode.patch
This commit is contained in:
Prototik 2015-05-14 22:31:09 +07:00
parent f3a73d8d68
commit 3fceb97d3a
2 changed files with 6 additions and 3 deletions

View File

@ -47,7 +47,7 @@ archivesBaseName = 'kcauldron'
ext.mcVersion = "1.7.10" ext.mcVersion = "1.7.10"
ext.cauldronVersion = "3" ext.cauldronVersion = "3"
ext.forgeVersion = "1403" ext.forgeVersion = "1403"
ext.revision = "58" ext.revision = "59"
version = "${mcVersion}-${cauldronVersion}.${forgeVersion}.${revision}" version = "${mcVersion}-${cauldronVersion}.${forgeVersion}.${revision}"
launch4j { launch4j {

View File

@ -1304,8 +1304,11 @@ public final class CraftServer implements Server {
OfflinePlayer result = getPlayerExact(name); OfflinePlayer result = getPlayerExact(name);
if (result == null) { if (result == null) {
// This is potentially blocking :( // Spigot start
GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152655_a(name); GameProfile profile = null;
if (MinecraftServer.getServer().isServerInOnlineMode() || org.spigotmc.SpigotConfig.bungee) {
profile = MinecraftServer.getServer().func_152358_ax().func_152655_a(name);
}
if (profile == null) { if (profile == null) {
// Make an OfflinePlayer using an offline mode UUID since the name has no profile // Make an OfflinePlayer using an offline mode UUID since the name has no profile
result = getOfflinePlayer(new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name)); result = getOfflinePlayer(new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name));