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;
|
|
|
|
import com.massivecraft.factions.FPlayers;
|
2012-03-13 13:58:51 +01:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.Cancellable;
|
|
|
|
import org.bukkit.event.Event;
|
|
|
|
import org.bukkit.event.HandlerList;
|
|
|
|
|
2014-07-09 21:01:53 +02:00
|
|
|
/**
|
|
|
|
* Event called when a Faction is created.
|
|
|
|
*/
|
2018-03-26 23:43:15 +02:00
|
|
|
public class FactionCreateEvent extends Event implements Cancellable {
|
2014-07-09 21:01:53 +02:00
|
|
|
|
2019-09-15 11:02:53 +02:00
|
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
|
|
|
|
private String factionTag;
|
|
|
|
private Player sender;
|
|
|
|
private boolean cancelled;
|
|
|
|
|
|
|
|
public FactionCreateEvent(Player sender, String tag) {
|
|
|
|
this.factionTag = tag;
|
|
|
|
this.sender = sender;
|
|
|
|
this.cancelled = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static HandlerList getHandlerList() {
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
|
|
|
|
public FPlayer getFPlayer() {
|
|
|
|
return FPlayers.getInstance().getByPlayer(sender);
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getFactionTag() {
|
|
|
|
return factionTag;
|
|
|
|
}
|
|
|
|
|
|
|
|
public HandlerList getHandlers() {
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isCancelled() {
|
|
|
|
return cancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setCancelled(boolean c) {
|
|
|
|
this.cancelled = c;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
}
|