Skip to content

Commit

Permalink
Add PlayerLocaleChangeEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
rmsy authored and mastercoms committed Apr 3, 2016
1 parent a64ce65 commit 3e050e6
Showing 1 changed file with 47 additions and 0 deletions.
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;
}
}

0 comments on commit 3e050e6

Please sign in to comment.