From 3fceb97d3a90214899713c9abd0a7c89141eb04e Mon Sep 17 00:00:00 2001 From: Prototik Date: Thu, 14 May 2015 22:31:09 +0700 Subject: [PATCH] Fetch player's UUID only in online mode Spigot patch: 0141-Only-fetch-an-online-UUID-in-online-mode.patch --- build.gradle | 2 +- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index bba64c9..787c676 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ archivesBaseName = 'kcauldron' ext.mcVersion = "1.7.10" ext.cauldronVersion = "3" ext.forgeVersion = "1403" -ext.revision = "58" +ext.revision = "59" version = "${mcVersion}-${cauldronVersion}.${forgeVersion}.${revision}" launch4j { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index ae2922a..82930a3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1304,8 +1304,11 @@ public final class CraftServer implements Server { OfflinePlayer result = getPlayerExact(name); if (result == null) { - // This is potentially blocking :( - GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152655_a(name); + // Spigot start + GameProfile profile = null; + if (MinecraftServer.getServer().isServerInOnlineMode() || org.spigotmc.SpigotConfig.bungee) { + profile = MinecraftServer.getServer().func_152358_ax().func_152655_a(name); + } if (profile == null) { // 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));