forked from GlowstoneMC/Glowkit-Legacy
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a64ce65
commit 3e050e6
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
src/main/java/com/destroystokyo/paper/event/player/PlayerLocaleChangeEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |