aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0339-Fix-MC-158900.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0339-Fix-MC-158900.patch')
-rw-r--r--patches/server/0339-Fix-MC-158900.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/patches/server/0339-Fix-MC-158900.patch b/patches/server/0339-Fix-MC-158900.patch
new file mode 100644
index 0000000000..8b69e5c5a8
--- /dev/null
+++ b/patches/server/0339-Fix-MC-158900.patch
@@ -0,0 +1,25 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Spottedleaf <[email protected]>
+Date: Tue, 13 Aug 2019 06:35:17 -0700
+Subject: [PATCH] Fix MC-158900
+
+The problem was we were checking isExpired() on the entry, but if it
+was expired at that point, then it would be null.
+
+diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
+index 1b53a2c29734a955b290d196799109047de5b45c..81aee8c195307fd3cd4a89c29ebb7ebc25436c83 100644
+--- a/src/main/java/net/minecraft/server/players/PlayerList.java
++++ b/src/main/java/net/minecraft/server/players/PlayerList.java
+@@ -606,8 +606,10 @@ public abstract class PlayerList {
+ Player player = entity.getBukkitEntity();
+ PlayerLoginEvent event = new PlayerLoginEvent(player, hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.getRawAddress()).getAddress());
+
+- if (this.getBans().isBanned(gameprofile) && !this.getBans().get(gameprofile).hasExpired()) {
+- UserBanListEntry gameprofilebanentry = (UserBanListEntry) this.bans.get(gameprofile);
++ // Paper start - Fix MC-158900
++ UserBanListEntry gameprofilebanentry;
++ if (getBans().isBanned(gameprofile) && (gameprofilebanentry = getBans().get(gameprofile)) != null) {
++ // Paper end
+
+ chatmessage = new TranslatableComponent("multiplayer.disconnect.banned.reason", new Object[]{gameprofilebanentry.getReason()});
+ if (gameprofilebanentry.getExpires() != null) {