2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
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
|
2022-03-01 04:25:13 +01:00
|
|
|
index 5623398d3c6fc804a078c10af4bdc24cb63d6ef6..3c176d48e6b1a8e165b5860cd443b36c65397ce9 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2021-11-24 06:44:21 +01:00
|
|
|
@@ -606,8 +606,10 @@ public abstract class PlayerList {
|
2021-06-11 14:02:28 +02:00
|
|
|
Player player = entity.getBukkitEntity();
|
|
|
|
PlayerLoginEvent event = new PlayerLoginEvent(player, hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.getRawAddress()).getAddress());
|
|
|
|
|
2021-06-13 16:14:18 +02:00
|
|
|
- if (this.getBans().isBanned(gameprofile) && !this.getBans().get(gameprofile).hasExpired()) {
|
2021-06-11 14:02:28 +02:00
|
|
|
- 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) {
|