Fix some component bugs in login disconnect packet (#10090)

This commit is contained in:
caramel
2023-12-30 04:51:52 +09:00
parent 09ae4f6257
commit c4e0d81696
2 changed files with 67 additions and 0 deletions

View File

@@ -3231,6 +3231,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
@@ -0,0 +0,0 @@ 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;
@@ -3738,6 +3749,20 @@ diff --git a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java b/sr
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
@@ -0,0 +0,0 @@ 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
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
public class PlayerPreLoginEvent extends Event {
private static final HandlerList handlers = new HandlerList();