diff --git a/paper-server/patches/sources/net/minecraft/server/players/UserBanListEntry.java.patch b/paper-server/patches/sources/net/minecraft/server/players/UserBanListEntry.java.patch index 40e9a043fa..df038411ce 100644 --- a/paper-server/patches/sources/net/minecraft/server/players/UserBanListEntry.java.patch +++ b/paper-server/patches/sources/net/minecraft/server/players/UserBanListEntry.java.patch @@ -5,3 +5,38 @@ package net.minecraft.server.players; import com.google.gson.JsonObject; +@@ -39,20 +40,29 @@ + + @Nullable + private static GameProfile createGameProfile(JsonObject json) { +- if (json.has("uuid") && json.has("name")) { ++ // Spigot start ++ // this whole method has to be reworked to account for the fact Bukkit only accepts UUID bans and gives no way for usernames to be stored! ++ UUID uuid = null; ++ String name = null; ++ if (json.has("uuid")) { + String s = json.get("uuid").getAsString(); + +- UUID uuid; +- + try { + uuid = UUID.fromString(s); + } catch (Throwable throwable) { +- return null; + } + +- return new GameProfile(uuid, json.get("name").getAsString()); ++ } ++ if ( json.has("name")) ++ { ++ name = json.get("name").getAsString(); ++ } ++ if ( uuid != null || name != null ) ++ { ++ return new GameProfile( uuid, name ); + } else { + return null; + } ++ // Spigot End + } + }