2012-03-13 13:58:51 +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;
|
|
|
|
import com.massivecraft.factions.Faction;
|
|
|
|
import com.massivecraft.factions.Factions;
|
|
|
|
|
|
|
|
public class FactionDisbandEvent extends Event implements Cancellable
|
|
|
|
{
|
2012-03-13 14:26:54 +01:00
|
|
|
private static final HandlerList handlers = new HandlerList();
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2012-03-13 14:26:54 +01:00
|
|
|
private boolean cancelled;
|
|
|
|
private String id;
|
|
|
|
private Player sender;
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2012-03-13 14:26:54 +01:00
|
|
|
public FactionDisbandEvent(Player sender, String factionId)
|
|
|
|
{
|
|
|
|
cancelled = false;
|
|
|
|
this.sender = sender;
|
|
|
|
this.id = factionId;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2012-03-13 14:26:54 +01:00
|
|
|
public HandlerList getHandlers()
|
|
|
|
{
|
|
|
|
return handlers;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2012-03-13 14:26:54 +01:00
|
|
|
public static HandlerList getHandlerList()
|
|
|
|
{
|
|
|
|
return handlers;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2012-03-13 14:26:54 +01:00
|
|
|
public Faction getFaction()
|
|
|
|
{
|
|
|
|
return Factions.i.get(id);
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2012-03-13 14:26:54 +01:00
|
|
|
public FPlayer getFPlayer()
|
|
|
|
{
|
|
|
|
return FPlayers.i.get(sender);
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2012-03-13 14:26:54 +01:00
|
|
|
public Player getPlayer()
|
|
|
|
{
|
|
|
|
return sender;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2012-03-13 14:26:54 +01:00
|
|
|
@Override
|
|
|
|
public boolean isCancelled()
|
|
|
|
{
|
|
|
|
return cancelled;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2012-03-13 14:26:54 +01:00
|
|
|
@Override
|
|
|
|
public void setCancelled(boolean c)
|
|
|
|
{
|
|
|
|
cancelled = c;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
}
|