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;
|
|
|
|
import com.massivecraft.factions.Factions;
|
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-04-04 20:55:21 +02:00
|
|
|
public class FactionCreateEvent extends Event implements Cancellable {
|
|
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
|
|
|
|
private String factionTag;
|
|
|
|
private Player sender;
|
|
|
|
private boolean cancelled;
|
|
|
|
|
|
|
|
public FactionCreateEvent(Player sender, String tag) {
|
2014-07-01 21:52:40 +02:00
|
|
|
this.factionTag = tag; this.sender = sender; this.cancelled = false;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public FPlayer getFPlayer() {
|
|
|
|
return FPlayers.i.get(sender);
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getFactionId() {
|
|
|
|
return Factions.i.getNextId();
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getFactionTag() {
|
|
|
|
return factionTag;
|
|
|
|
}
|
|
|
|
|
|
|
|
public HandlerList getHandlers() {
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static HandlerList getHandlerList() {
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isCancelled() {
|
|
|
|
return cancelled;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
@Override
|
|
|
|
public void setCancelled(boolean c) {
|
|
|
|
this.cancelled = c;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
}
|