mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 08:57:35 +01:00
Don't throw when removing unplaced player in NearbyPlayers
This commit is contained in:
parent
0f69290f07
commit
c4ba28a21a
@ -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) {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user