diff options
Diffstat (limited to 'patches/api/0017-Add-PlayerLocaleChangeEvent.patch')
-rw-r--r-- | patches/api/0017-Add-PlayerLocaleChangeEvent.patch | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/patches/api/0017-Add-PlayerLocaleChangeEvent.patch b/patches/api/0017-Add-PlayerLocaleChangeEvent.patch index 1dd6084278..b843aa4fc7 100644 --- a/patches/api/0017-Add-PlayerLocaleChangeEvent.patch +++ b/patches/api/0017-Add-PlayerLocaleChangeEvent.patch @@ -6,16 +6,18 @@ Subject: [PATCH] Add PlayerLocaleChangeEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerLocaleChangeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerLocaleChangeEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..bb7baa91fd4ba763fd8ce216bc9043c5e2c4b7b7 +index 0000000000000000000000000000000000000000..57f6c47e4e759abf0af9aa8962551225cc12246c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerLocaleChangeEvent.java -@@ -0,0 +1,51 @@ +@@ -0,0 +1,60 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.entity.Player; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; +import org.jetbrains.annotations.ApiStatus; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Called when the locale of the player is changed. @@ -24,11 +26,14 @@ index 0000000000000000000000000000000000000000..bb7baa91fd4ba763fd8ce216bc9043c5 + */ +@Deprecated(forRemoval = true) @ApiStatus.ScheduledForRemoval(inVersion = "1.21") +public class PlayerLocaleChangeEvent extends PlayerEvent { -+ private static final HandlerList handlers = new HandlerList(); ++ ++ private static final HandlerList HANDLER_LIST = new HandlerList(); ++ + private final String oldLocale; + private final String newLocale; + -+ public PlayerLocaleChangeEvent(final Player player, final String oldLocale, final String newLocale) { ++ @ApiStatus.Internal ++ public PlayerLocaleChangeEvent(final @NotNull Player player, final @Nullable String oldLocale, final @NotNull String newLocale) { + super(player); + this.oldLocale = oldLocale; + this.newLocale = newLocale; @@ -39,8 +44,9 @@ index 0000000000000000000000000000000000000000..bb7baa91fd4ba763fd8ce216bc9043c5 + * + * @return player's old locale + */ ++ @Nullable + public String getOldLocale() { -+ return oldLocale; ++ return this.oldLocale; + } + + /** @@ -48,16 +54,19 @@ index 0000000000000000000000000000000000000000..bb7baa91fd4ba763fd8ce216bc9043c5 + * + * @return player's new locale + */ ++ @NotNull + public String getNewLocale() { -+ return newLocale; ++ return this.newLocale; + } + + @Override ++ @NotNull + public HandlerList getHandlers() { -+ return handlers; ++ return HANDLER_LIST; + } + ++ @NotNull + public static HandlerList getHandlerList() { -+ return handlers; ++ return HANDLER_LIST; + } +} |