Only return if they are still online. Fixes a bungeecord crash mostly

This commit is contained in:
libraryaddict 2014-04-11 07:57:23 +12:00
parent 6571fe3a2d
commit d20abcb223
2 changed files with 13 additions and 4 deletions

View File

@ -64,7 +64,7 @@
<version>3.1.0</version> <version>3.1.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<version>8.0.4</version> <version>8.0.4-SNAPSHOT</version>
<distributionManagement> <distributionManagement>
<repository> <repository>

View File

@ -302,8 +302,17 @@ public class DisguiseUtilities {
if (LibVersion.getGameVersion() == LibVersion.V1_7) { if (LibVersion.getGameVersion() == LibVersion.V1_7) {
Player p = Bukkit.getPlayerExact(playerName); Player p = Bukkit.getPlayerExact(playerName);
if (p != null) { if (p != null) {
try {
Field field = ReflectionManager.getNmsClass("PlayerConnection").getDeclaredField("processedDisconnect");
field.setAccessible(true);
if (field.getBoolean(ReflectionManager.getNmsClass("EntityPlayer").getField("playerConnection")
.get(p.getClass().getDeclaredMethod("getHandle").invoke(p))))
return p.getUniqueId(); return p.getUniqueId();
} /*else if (disguise != null) { } catch (Exception e) {
e.printStackTrace();
}
}
/*else if (disguise != null) {
if (namesUuids.containsKey(playerName)) { if (namesUuids.containsKey(playerName)) {
if (namesUuids.get(playerName) != null) { if (namesUuids.get(playerName) != null) {
return UUID.fromString(namesUuids.get(playerName)); return UUID.fromString(namesUuids.get(playerName));