Fix some component bugs in login disconnect packet (#10090)
This commit is contained in:
parent
5e978d3a3d
commit
e56e53f83a
7 changed files with 104 additions and 37 deletions
|
@ -3227,10 +3227,21 @@ index 9c68c3f2d61500479f48b80264f625aaae2f3204..399afcd19fcb6acd24857ed6ab48cf0d
|
|||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancel = false;
|
||||
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
index 9866c07c999f46cb585709804aaad710c3031d5a..c7c45e2de8cca1bf8b8e12752e08db62403efa6a 100644
|
||||
index 9866c07c999f46cb585709804aaad710c3031d5a..3432872303aa0df97b5d9090fe98b269ef3cb9f4 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -10,11 +10,18 @@ import org.jetbrains.annotations.NotNull;
|
||||
* Stores details for players attempting to log in.
|
||||
* <p>
|
||||
* This event is asynchronous, and not run using main thread.
|
||||
+ * <p>
|
||||
+ * When this event is fired, the player's locale is not
|
||||
+ * available. Therefore, any translatable component will be
|
||||
+ * rendered with the default locale, {@link java.util.Locale#US}.
|
||||
+ * <p>
|
||||
+ * Consider rendering any translatable yourself with {@link net.kyori.adventure.translation.GlobalTranslator#render}
|
||||
+ * if the client's language is known.
|
||||
*/
|
||||
public class AsyncPlayerPreLoginEvent extends Event {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private Result result;
|
||||
|
@ -3239,7 +3250,7 @@ index 9866c07c999f46cb585709804aaad710c3031d5a..c7c45e2de8cca1bf8b8e12752e08db62
|
|||
private final String name;
|
||||
private final InetAddress ipAddress;
|
||||
private final UUID uniqueId;
|
||||
@@ -27,7 +27,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -27,7 +34,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId) {
|
||||
super(true);
|
||||
this.result = Result.ALLOWED;
|
||||
|
@ -3248,7 +3259,7 @@ index 9866c07c999f46cb585709804aaad710c3031d5a..c7c45e2de8cca1bf8b8e12752e08db62
|
|||
this.name = name;
|
||||
this.ipAddress = ipAddress;
|
||||
this.uniqueId = uniqueId;
|
||||
@@ -79,6 +79,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -79,6 +86,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
this.result = result == null ? null : Result.valueOf(result.name());
|
||||
}
|
||||
|
||||
|
@ -3256,7 +3267,7 @@ index 9866c07c999f46cb585709804aaad710c3031d5a..c7c45e2de8cca1bf8b8e12752e08db62
|
|||
/**
|
||||
* Gets the current kick message that will be used if getResult() !=
|
||||
* Result.ALLOWED
|
||||
@@ -86,7 +87,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -86,7 +94,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
* @return Current kick message
|
||||
*/
|
||||
@NotNull
|
||||
|
@ -3265,7 +3276,7 @@ index 9866c07c999f46cb585709804aaad710c3031d5a..c7c45e2de8cca1bf8b8e12752e08db62
|
|||
return message;
|
||||
}
|
||||
|
||||
@@ -95,16 +96,66 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -95,16 +103,66 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
*
|
||||
* @param message New kick message
|
||||
*/
|
||||
|
@ -3334,7 +3345,7 @@ index 9866c07c999f46cb585709804aaad710c3031d5a..c7c45e2de8cca1bf8b8e12752e08db62
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -112,10 +163,12 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -112,10 +170,12 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
*
|
||||
* @param result New result for disallowing the player
|
||||
* @param message Kick message to display to the user
|
||||
|
@ -3348,7 +3359,7 @@ index 9866c07c999f46cb585709804aaad710c3031d5a..c7c45e2de8cca1bf8b8e12752e08db62
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -130,7 +183,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -130,7 +190,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@Deprecated
|
||||
public void disallow(@NotNull final PlayerPreLoginEvent.Result result, @NotNull final String message) {
|
||||
this.result = result == null ? null : Result.valueOf(result.name());
|
||||
|
@ -3735,10 +3746,24 @@ index 2bc81b0aa73f7f5b0352121f6bf18fa63acf7a83..eaa0548cf430bf5b58ff84e0a4403c45
|
|||
this.message = message;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
|
||||
index fb066251f793ec3b41bfc075b9478901b15ee549..6800132c6288b4588fd02b08d26f016c38f27129 100644
|
||||
index fb066251f793ec3b41bfc075b9478901b15ee549..175ed12dd1698f4d153c9acdac8340c15a427ea5 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
|
||||
@@ -19,7 +19,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -9,6 +9,13 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Stores details for players attempting to log in
|
||||
+ * <p>
|
||||
+ * When this event is fired, the player's locale is not
|
||||
+ * available. Therefore, any translatable component will be
|
||||
+ * rendered with the default locale, {@link java.util.Locale#US}.
|
||||
+ * <p>
|
||||
+ * Consider rendering any translatable yourself with {@link net.kyori.adventure.translation.GlobalTranslator#render}
|
||||
+ * if the client's language is known.
|
||||
*
|
||||
* @deprecated This event causes synchronization from the login thread; {@link
|
||||
* AsyncPlayerPreLoginEvent} is preferred to keep the secondary threads
|
||||
@@ -19,7 +26,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class PlayerPreLoginEvent extends Event {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private Result result;
|
||||
|
@ -3747,7 +3772,7 @@ index fb066251f793ec3b41bfc075b9478901b15ee549..6800132c6288b4588fd02b08d26f016c
|
|||
private final String name;
|
||||
private final InetAddress ipAddress;
|
||||
private final UUID uniqueId;
|
||||
@@ -31,7 +31,7 @@ public class PlayerPreLoginEvent extends Event {
|
||||
@@ -31,7 +38,7 @@ public class PlayerPreLoginEvent extends Event {
|
||||
|
||||
public PlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId) {
|
||||
this.result = Result.ALLOWED;
|
||||
|
@ -3756,7 +3781,7 @@ index fb066251f793ec3b41bfc075b9478901b15ee549..6800132c6288b4588fd02b08d26f016c
|
|||
this.name = name;
|
||||
this.ipAddress = ipAddress;
|
||||
this.uniqueId = uniqueId;
|
||||
@@ -56,6 +56,7 @@ public class PlayerPreLoginEvent extends Event {
|
||||
@@ -56,6 +63,7 @@ public class PlayerPreLoginEvent extends Event {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
|
@ -3764,7 +3789,7 @@ index fb066251f793ec3b41bfc075b9478901b15ee549..6800132c6288b4588fd02b08d26f016c
|
|||
/**
|
||||
* Gets the current kick message that will be used if getResult() !=
|
||||
* Result.ALLOWED
|
||||
@@ -63,7 +64,7 @@ public class PlayerPreLoginEvent extends Event {
|
||||
@@ -63,7 +71,7 @@ public class PlayerPreLoginEvent extends Event {
|
||||
* @return Current kick message
|
||||
*/
|
||||
@NotNull
|
||||
|
@ -3773,7 +3798,7 @@ index fb066251f793ec3b41bfc075b9478901b15ee549..6800132c6288b4588fd02b08d26f016c
|
|||
return message;
|
||||
}
|
||||
|
||||
@@ -72,16 +73,51 @@ public class PlayerPreLoginEvent extends Event {
|
||||
@@ -72,16 +80,51 @@ public class PlayerPreLoginEvent extends Event {
|
||||
*
|
||||
* @param message New kick message
|
||||
*/
|
||||
|
@ -3827,7 +3852,7 @@ index fb066251f793ec3b41bfc075b9478901b15ee549..6800132c6288b4588fd02b08d26f016c
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -89,10 +125,12 @@ public class PlayerPreLoginEvent extends Event {
|
||||
@@ -89,10 +132,12 @@ public class PlayerPreLoginEvent extends Event {
|
||||
*
|
||||
* @param result New result for disallowing the player
|
||||
* @param message Kick message to display to the user
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent
|
|||
This will allow you to change the players name or skin on login.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
index c7c45e2de8cca1bf8b8e12752e08db62403efa6a..c30b44ff26f8f253902754452a0816f07c7fd035 100644
|
||||
index 6aaeba3feb66462ce352dacabd845f8d8283f54b..e4afc428e9a8625bf6f5967cb659987c14f65ba6 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
@@ -2,6 +2,9 @@ package org.bukkit.event.player;
|
||||
|
@ -19,7 +19,7 @@ index c7c45e2de8cca1bf8b8e12752e08db62403efa6a..c30b44ff26f8f253902754452a0816f0
|
|||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -15,9 +18,9 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -22,9 +25,9 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private Result result;
|
||||
private net.kyori.adventure.text.Component message; // Paper
|
||||
|
@ -31,7 +31,7 @@ index c7c45e2de8cca1bf8b8e12752e08db62403efa6a..c30b44ff26f8f253902754452a0816f0
|
|||
|
||||
@Deprecated
|
||||
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress) {
|
||||
@@ -25,12 +28,37 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -32,12 +35,37 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
}
|
||||
|
||||
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId) {
|
||||
|
@ -71,7 +71,7 @@ index c7c45e2de8cca1bf8b8e12752e08db62403efa6a..c30b44ff26f8f253902754452a0816f0
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -193,7 +221,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -200,7 +228,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
*/
|
||||
@NotNull
|
||||
public String getName() {
|
||||
|
@ -80,7 +80,7 @@ index c7c45e2de8cca1bf8b8e12752e08db62403efa6a..c30b44ff26f8f253902754452a0816f0
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -213,7 +241,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -220,7 +248,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
*/
|
||||
@NotNull
|
||||
public UUID getUniqueId() {
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add raw address to AsyncPlayerPreLoginEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
index c30b44ff26f8f253902754452a0816f07c7fd035..34e4d666b6af58f64c6c001df80fadf818847e6a 100644
|
||||
index e4afc428e9a8625bf6f5967cb659987c14f65ba6..35176b16d208c9756bd00ac74b2a1dcc3fc9febb 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
@@ -20,6 +20,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -27,6 +27,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
private net.kyori.adventure.text.Component message; // Paper
|
||||
//private String name; // Paper - Not used anymore
|
||||
private final InetAddress ipAddress;
|
||||
|
@ -16,7 +16,7 @@ index c30b44ff26f8f253902754452a0816f07c7fd035..34e4d666b6af58f64c6c001df80fadf8
|
|||
//private UUID uniqueId; // Paper - Not used anymore
|
||||
|
||||
@Deprecated
|
||||
@@ -50,7 +51,23 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -57,7 +58,23 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
this.profile = profile;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ index c30b44ff26f8f253902754452a0816f07c7fd035..34e4d666b6af58f64c6c001df80fadf8
|
|||
super(true);
|
||||
this.profile = profile;
|
||||
// Paper end
|
||||
@@ -58,6 +75,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -65,6 +82,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
this.message = net.kyori.adventure.text.Component.empty(); // Paper
|
||||
//this.name = name; // Paper - Not used anymore
|
||||
this.ipAddress = ipAddress;
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Added getHostname to AsyncPlayerPreLoginEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
index 34e4d666b6af58f64c6c001df80fadf818847e6a..fc2d9e85b65347b90bde3b0b13ccae759e33d466 100644
|
||||
index 35176b16d208c9756bd00ac74b2a1dcc3fc9febb..da07fc4ab0c299c1bb06ede36e7230626bbc28c9 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
@@ -22,6 +22,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -29,6 +29,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
private final InetAddress ipAddress;
|
||||
private final InetAddress rawAddress; // Paper
|
||||
//private UUID uniqueId; // Paper - Not used anymore
|
||||
|
@ -16,7 +16,7 @@ index 34e4d666b6af58f64c6c001df80fadf818847e6a..fc2d9e85b65347b90bde3b0b13ccae75
|
|||
|
||||
@Deprecated
|
||||
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress) {
|
||||
@@ -67,7 +68,14 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -74,7 +75,14 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
this(name, ipAddress, ipAddress, uniqueId, profile);
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ index 34e4d666b6af58f64c6c001df80fadf818847e6a..fc2d9e85b65347b90bde3b0b13ccae75
|
|||
super(true);
|
||||
this.profile = profile;
|
||||
// Paper end
|
||||
@@ -77,6 +85,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -84,6 +92,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
this.ipAddress = ipAddress;
|
||||
this.rawAddress = rawAddress; // Paper
|
||||
//this.uniqueId = uniqueId; // Paper - Not used anymore
|
||||
|
@ -39,7 +39,7 @@ index 34e4d666b6af58f64c6c001df80fadf818847e6a..fc2d9e85b65347b90bde3b0b13ccae75
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -262,6 +271,19 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
@@ -269,6 +278,19 @@ public class AsyncPlayerPreLoginEvent extends Event {
|
||||
return profile.getId(); // Paper
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue