2014-04-14 00:40:29 +00:00
|
|
|
From 39524f0f91c9945265786856e1f6935a110cd601 Mon Sep 17 00:00:00 2001
|
2014-04-12 07:17:26 +00:00
|
|
|
From: md_5 <git@md-5.net>
|
|
|
|
Date: Sat, 12 Apr 2014 17:17:10 +1000
|
|
|
|
Subject: [PATCH] Address Serious Issues with Offline Players
|
|
|
|
|
|
|
|
Such as name being entirely unresolved! This fixes the whitelist command and no doubt lots more.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
2014-04-14 00:40:29 +00:00
|
|
|
index bd98822..7af54cf 100644
|
2014-04-12 07:17:26 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
|
|
|
@@ -48,6 +48,12 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
|
|
|
if (player != null) {
|
|
|
|
return player.getName();
|
|
|
|
}
|
|
|
|
+ // Spigot Start
|
|
|
|
+ if ( profile != null )
|
|
|
|
+ {
|
|
|
|
+ return profile.getName();
|
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
|
|
|
|
2014-04-12 08:17:59 +00:00
|
|
|
// This might not match lastKnownName but if not it should be more correct
|
|
|
|
if (profile.getName() != null) {
|
2014-04-12 07:17:26 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2014-04-12 08:17:59 +00:00
|
|
|
index 4920956..c30197b 100644
|
2014-04-12 07:17:26 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2014-04-12 08:17:59 +00:00
|
|
|
@@ -1330,7 +1330,7 @@ public final class CraftServer implements Server {
|
2014-04-12 07:17:26 +00:00
|
|
|
if (result == null) {
|
|
|
|
result = offlinePlayers.get(id);
|
|
|
|
if (result == null) {
|
|
|
|
- result = new CraftOfflinePlayer(this, new GameProfile(id, null));
|
|
|
|
+ result = new CraftOfflinePlayer(this, MinecraftServer.getServer().getUserCache().a(id)); // Spigot - this is blocking, but we have no choice!
|
|
|
|
offlinePlayers.put(id, result);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
--
|
|
|
|
1.8.3.2
|
|
|
|
|