62 lines
1.7 KiB
Diff
62 lines
1.7 KiB
Diff
From 3c8bd87bc36a0c83f24b14609fe615824d1b6002 Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
Date: Mon, 29 Feb 2016 18:02:25 -0600
|
|
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 0000000..17afc8c
|
|
--- /dev/null
|
|
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerLocaleChangeEvent.java
|
|
@@ -0,0 +1,47 @@
|
|
+package com.destroystokyo.paper.event.player;
|
|
+
|
|
+import org.bukkit.entity.Player;
|
|
+import org.bukkit.event.HandlerList;
|
|
+import org.bukkit.event.player.PlayerEvent;
|
|
+
|
|
+/**
|
|
+ * Called when the locale of the player is changed.
|
|
+ */
|
|
+public class PlayerLocaleChangeEvent extends PlayerEvent {
|
|
+ private static final HandlerList handlers = new HandlerList();
|
|
+ private final String oldLocale;
|
|
+ private final String newLocale;
|
|
+
|
|
+ public PlayerLocaleChangeEvent(final Player player, final String oldLocale, final String newLocale) {
|
|
+ super(player);
|
|
+ this.oldLocale = oldLocale;
|
|
+ this.newLocale = newLocale;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Gets the locale the player switched from.
|
|
+ *
|
|
+ * @return player's old locale
|
|
+ */
|
|
+ public String getOldLocale() {
|
|
+ return oldLocale;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Gets the locale the player is changed to.
|
|
+ *
|
|
+ * @return player's new locale
|
|
+ */
|
|
+ public String getNewLocale() {
|
|
+ return newLocale;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public HandlerList getHandlers() {
|
|
+ return handlers;
|
|
+ }
|
|
+
|
|
+ public static HandlerList getHandlerList() {
|
|
+ return handlers;
|
|
+ }
|
|
+}
|
|
--
|
|
2.7.2
|
|
|