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
|
|
|
|
2019-09-15 11:15:33 +02:00
|
|
|
private boolean cancelled = false;
|
|
|
|
private String tag;
|
|
|
|
|
|
|
|
public FactionRenameEvent(FPlayer sender, String newTag) {
|
|
|
|
super(sender.getFaction(), sender);
|
|
|
|
tag = newTag;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the player involved in the event.
|
|
|
|
*
|
|
|
|
* @return Player involved in the event.
|
|
|
|
* @deprecated use getfPlayer().getPlayer() instead.
|
|
|
|
*/
|
|
|
|
@Deprecated
|
|
|
|
public Player getPlayer() {
|
|
|
|
return getfPlayer().getPlayer();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the faction tag before it was renamed.
|
|
|
|
*
|
|
|
|
* @return old faction tag.
|
|
|
|
* @deprecated use getFaction().getTag() instead.
|
|
|
|
*/
|
|
|
|
@Deprecated
|
|
|
|
public String getOldFactionTag() {
|
|
|
|
return getFaction().getTag();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the new faction tag.
|
|
|
|
*
|
|
|
|
* @return new faction tag as String.
|
|
|
|
*/
|
|
|
|
public String getFactionTag() {
|
|
|
|
return tag;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isCancelled() {
|
|
|
|
return cancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setCancelled(boolean c) {
|
|
|
|
this.cancelled = c;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
}
|