2012-03-02 02:16:45 +01:00
|
|
|
package com.massivecraft.factions.event;
|
|
|
|
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.Cancellable;
|
|
|
|
import org.bukkit.event.Event;
|
|
|
|
import org.bukkit.event.HandlerList;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.FPlayer;
|
|
|
|
import com.massivecraft.factions.FPlayers;
|
2012-03-09 23:09:33 +01:00
|
|
|
import com.massivecraft.factions.Factions;
|
2012-03-02 02:16:45 +01:00
|
|
|
|
|
|
|
public class FactionCreateEvent extends Event implements Cancellable
|
|
|
|
{
|
|
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
|
|
|
|
private String factionTag;
|
|
|
|
private Player sender;
|
|
|
|
private boolean cancelled;
|
|
|
|
|
2012-03-09 23:09:33 +01:00
|
|
|
public FactionCreateEvent(Player sender, String tag)
|
2012-03-02 02:16:45 +01:00
|
|
|
{
|
|
|
|
this.factionTag = tag;
|
|
|
|
this.sender = sender;
|
|
|
|
this.cancelled = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public FPlayer getFPlayer()
|
|
|
|
{
|
|
|
|
return FPlayers.i.get(sender);
|
|
|
|
}
|
|
|
|
|
2012-03-09 23:09:33 +01:00
|
|
|
public String getFactionId()
|
|
|
|
{
|
|
|
|
return Factions.i.getNextId();
|
|
|
|
}
|
|
|
|
|
2012-03-02 02:16:45 +01:00
|
|
|
public String getFactionTag()
|
|
|
|
{
|
|
|
|
return factionTag;
|
|
|
|
}
|
2012-03-09 23:09:33 +01:00
|
|
|
|
2012-03-02 02:16:45 +01:00
|
|
|
public HandlerList getHandlers()
|
|
|
|
{
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static HandlerList getHandlerList()
|
|
|
|
{
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isCancelled()
|
|
|
|
{
|
|
|
|
return cancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setCancelled(boolean c)
|
|
|
|
{
|
|
|
|
this.cancelled = c;
|
|
|
|
}
|
|
|
|
}
|