3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 02:50:09 +01:00

Don't throw when removing unplaced player in NearbyPlayers

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-09-30 15:37:00 +10:00
Ursprung 0f69290f07
Commit c4ba28a21a
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
2 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -5469,7 +5469,7 @@ index 0000000000000000000000000000000000000000..808d1449ac44ae86a650932365081fba
+}
diff --git a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
new file mode 100644
index 0000000000000000000000000000000000000000..60c7680d678f9dc6a6a3109b1f6af8150ccd9100
index 0000000000000000000000000000000000000000..a5bd0845a2445fa02561b16fb54a7cf49c114915
--- /dev/null
+++ b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
@@ -0,0 +1,203 @@
@ -5534,7 +5534,7 @@ index 0000000000000000000000000000000000000000..60c7680d678f9dc6a6a3109b1f6af815
+ public void removePlayer(final ServerPlayer player) {
+ final TrackedPlayer[] players = this.players.remove(player);
+ if (players == null) {
+ throw new IllegalStateException("Don't have player " + player);
+ return; // May be called during teleportation before the player is actually placed
+ }
+
+ for (final TrackedPlayer tracker : players) {

Datei anzeigen

@ -9,7 +9,7 @@ class to quickly retrieve nearby players instead of possible
searching all players on the server.
diff --git a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
index 60c7680d678f9dc6a6a3109b1f6af8150ccd9100..d05195358a00e498e0184ab105ebb3dc7a39e15a 100644
index a5bd0845a2445fa02561b16fb54a7cf49c114915..380fd05abe191025e12bdd6811e1df90c96e4667 100644
--- a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
+++ b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
@@ -17,7 +17,8 @@ public final class NearbyPlayers {