I have submitted a patch to Paper that Mojang is free to use - https://github.com/PaperMC/Paper/pull/2458
(the code is a bit different due to CraftBukkit changes but the same logic applies)
The relevant code is just this one line (spigot mappings), marked // NPE in PlayerList:
if (this.k.isBanned(gameprofile)) {
GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.k.get(gameprofile);
chatmessage = new ChatMessage("multiplayer.disconnect.banned.reason", new Object[]{gameprofilebanentry.getReason()}); // NPE
if (gameprofilebanentry.getExpires() != null) {
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned.expiration", new Object[]{PlayerList.g.format(gameprofilebanentry.getExpires())}));
}
the get() call will remove the relevant entry if it has expired, and then return null. Then it will clearly NPE on the marked line.
The stacktrace of this occurring on the vanilla server:
[06:30:45] [Server thread/WARN]: Failed to handle packet for /127.0.0.1:50701
java.lang.NullPointerException: null
at xv.a(SourceFile:357) ~[minecraft_server.jar:?]
at we.c(SourceFile:97) ~[minecraft_server.jar:?]
at we.b(SourceFile:63) ~[minecraft_server.jar:?]
at jc.a(SourceFile:230) ~[minecraft_server.jar:?]
at wb.c(SourceFile:171) [minecraft_server.jar:?]
at net.minecraft.server.MinecraftServer.b(SourceFile:847) [minecraft_server.jar:?]
at uk.b(SourceFile:343) [minecraft_server.jar:?]
at net.minecraft.server.MinecraftServer.a(SourceFile:774) [minecraft_server.jar:?]
at net.minecraft.server.MinecraftServer.run(SourceFile:642) [minecraft_server.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
[06:30:45] [Server thread/INFO]: com.mojang.authlib.GameProfile@664932ca[id=9a9949cc-1987-3d04-b56b-cf3286adfe51,name=searchndstroy,properties={},legacy=false] (/127.0.0.1:50701) lost connection: Internal server error
Sorry, pressing enter multiple times created multiple issues - please close this.