From a3db62f3c26d964a9c2319bbfcbe8285c936cbc9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 31 Jul 2018 01:37:41 -0400 Subject: [PATCH] PlayerProfile.complete shouldn't throw NPE We have a result boolean for this already, and this method was meant to be "Try from cache, if that fails, look it up" So NPE'ing there just wasn't correct. --- .../0216-Basic-PlayerProfile-API.patch | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Spigot-Server-Patches/0216-Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/0216-Basic-PlayerProfile-API.patch index 9b05c7472..ca20c7cde 100644 --- a/Spigot-Server-Patches/0216-Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/0216-Basic-PlayerProfile-API.patch @@ -1,4 +1,4 @@ -From 67efca2ab5f2797aeceff4a62a7b777f2ea616d9 Mon Sep 17 00:00:00 2001 +From 9fc6ead2cb78a551d09710035213395077e6f795 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 15 Jan 2018 22:11:48 -0500 Subject: [PATCH] Basic PlayerProfile API @@ -7,10 +7,10 @@ Establishes base extension of profile systems for future edits too diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java new file mode 100644 -index 000000000..9ad5853de +index 0000000000..b151a13c1b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java -@@ -0,0 +1,281 @@ +@@ -0,0 +1,280 @@ +package com.destroystokyo.paper.profile; + +import com.destroystokyo.paper.PaperConfig; @@ -166,10 +166,9 @@ index 000000000..9ad5853de + // Make an OfflinePlayer using an offline mode UUID since the name has no profile + profile = new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name); + } -+ if (profile == null) { -+ throw new NullPointerException("Could not get UUID for Player " + name); ++ if (profile != null) { ++ this.profile = profile; + } -+ this.profile = profile; + } + + if (profile.getName() == null) { @@ -294,7 +293,7 @@ index 000000000..9ad5853de +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java new file mode 100644 -index 000000000..25836b975 +index 0000000000..25836b975b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java @@ -0,0 +1,30 @@ @@ -330,7 +329,7 @@ index 000000000..25836b975 +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java new file mode 100644 -index 000000000..3bcdb8f93 +index 0000000000..3bcdb8f93f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java @@ -0,0 +1,17 @@ @@ -353,7 +352,7 @@ index 000000000..3bcdb8f93 +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java new file mode 100644 -index 000000000..4b2a67423 +index 0000000000..4b2a67423f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java @@ -0,0 +1,29 @@ @@ -388,7 +387,7 @@ index 000000000..4b2a67423 +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java new file mode 100644 -index 000000000..3aceb0ea8 +index 0000000000..3aceb0ea8a --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java @@ -0,0 +1,11 @@ @@ -404,7 +403,7 @@ index 000000000..3aceb0ea8 + } +} diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 02940d697..4539b5601 100644 +index 02940d697f..4539b56012 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -1,6 +1,9 @@ @@ -429,7 +428,7 @@ index 02940d697..4539b5601 100644 * Calculates distance between 2 entities * @param e1 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e8bddc171..fcf6bac08 100644 +index e8bddc171c..fcf6bac08f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1018,7 +1018,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs @@ -450,7 +449,7 @@ index e8bddc171..fcf6bac08 100644 return this.W; } diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index 7ce08eb8b..6a750c25e 100644 +index 7ce08eb8bb..6a750c25eb 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java @@ -44,7 +44,7 @@ public class UserCache { @@ -486,7 +485,7 @@ index 7ce08eb8b..6a750c25e 100644 private UserCacheEntry(GameProfile gameprofile, Date date) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 77c16fe2c..2dd7ed96a 100644 +index 77c16fe2c4..2dd7ed96a4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -135,6 +135,10 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey;