2012-03-13 13:58:51 +01:00
|
|
|
package com.massivecraft.factions.event;
|
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
import com.massivecraft.factions.FPlayer;
|
2012-03-13 13:58:51 +01:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.Cancellable;
|
|
|
|
|
2014-07-09 21:00:16 +02:00
|
|
|
public class FactionRenameEvent extends FactionPlayerEvent implements Cancellable {
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-07-09 21:00:16 +02:00
|
|
|
private boolean cancelled = false;
|
2014-04-04 20:55:21 +02:00
|
|
|
private String tag;
|
|
|
|
|
|
|
|
public FactionRenameEvent(FPlayer sender, String newTag) {
|
2014-07-09 21:00:16 +02:00
|
|
|
super(sender.getFaction(), sender);
|
2014-07-01 22:10:18 +02:00
|
|
|
tag = newTag;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
2014-07-09 21:01:53 +02:00
|
|
|
/**
|
|
|
|
* Get the player involved in the event.
|
|
|
|
*
|
|
|
|
* @return Player involved in the event.
|
|
|
|
*
|
|
|
|
* @deprecated use getfPlayer().getPlayer() instead.
|
|
|
|
*/
|
2014-07-09 21:00:16 +02:00
|
|
|
@Deprecated
|
2014-04-04 20:55:21 +02:00
|
|
|
public Player getPlayer() {
|
2014-07-09 21:00:16 +02:00
|
|
|
return getfPlayer().getPlayer();
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
2014-07-09 21:01:53 +02:00
|
|
|
/**
|
|
|
|
* Get the faction tag before it was renamed.
|
|
|
|
*
|
|
|
|
* @return old faction tag.
|
|
|
|
*
|
|
|
|
* @deprecated use getFaction().getTag() instead.
|
|
|
|
*/
|
2014-07-09 21:00:16 +02:00
|
|
|
@Deprecated
|
2014-04-04 20:55:21 +02:00
|
|
|
public String getOldFactionTag() {
|
2014-07-09 21:00:16 +02:00
|
|
|
return getFaction().getTag();
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
2014-07-09 21:01:53 +02:00
|
|
|
/**
|
|
|
|
* Get the new faction tag.
|
|
|
|
*
|
|
|
|
* @return new faction tag as String.
|
|
|
|
*/
|
2014-04-04 20:55:21 +02:00
|
|
|
public String getFactionTag() {
|
2014-07-09 21:00:16 +02:00
|
|
|
return tag;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isCancelled() {
|
|
|
|
return cancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setCancelled(boolean c) {
|
|
|
|
this.cancelled = c;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
}
|