Saber-Factions/src/main/java/com/massivecraft/factions/event/FactionCreateEvent.java

52 lines
1.2 KiB
Java
Raw Normal View History

package com.massivecraft.factions.event;
2014-04-04 20:55:21 +02:00
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
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
2014-04-04 20:55:21 +02:00
private static final HandlerList handlers = new HandlerList();
2018-03-26 23:43:15 +02:00
private String factionTag;
private Player sender;
private boolean cancelled;
2014-04-04 20:55:21 +02:00
2018-03-26 23:43:15 +02:00
public FactionCreateEvent(Player sender, String tag) {
2014-07-01 22:10:18 +02:00
this.factionTag = tag;
this.sender = sender;
2018-03-26 23:43:15 +02:00
this.cancelled = false;
2014-04-04 20:55:21 +02:00
}
public FPlayer getFPlayer() {
return FPlayers.getInstance().getByPlayer(sender);
2014-04-04 20:55:21 +02:00
}
public String getFactionTag() {
return factionTag;
}
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
2018-03-26 23:43:15 +02:00
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean c) {
this.cancelled = c;
}
}