Factions3/src/com/massivecraft/factions/event/FactionDisbandEvent.java

69 lines
1.7 KiB
Java
Raw Normal View History

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.Faction;
2013-04-09 12:58:39 +02:00
import com.massivecraft.factions.FactionColl;
2012-03-02 02:16:45 +01:00
public class FactionDisbandEvent extends Event implements Cancellable
{
2013-04-10 09:34:14 +02:00
// -------------------------------------------- //
// REQUIRED EVENT CODE
// -------------------------------------------- //
private static final HandlerList handlers = new HandlerList();
2013-04-10 09:34:14 +02:00
@Override public HandlerList getHandlers() { return handlers; }
public static HandlerList getHandlerList() { return handlers; }
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
private boolean cancelled;
2013-04-10 09:34:14 +02:00
@Override public boolean isCancelled() { return this.cancelled; }
@Override public void setCancelled(boolean cancelled) { this.cancelled = cancelled; }
// TODO: Could the fields be reorganized to achieve symmetry?
private String id;
private Player sender;
2012-03-02 02:16:45 +01:00
public Faction getFaction()
{
return FactionColl.get().get(id);
}
2012-03-02 02:16:45 +01:00
public FPlayer getFPlayer()
{
2013-04-12 08:56:26 +02:00
return FPlayer.get(sender);
}
2012-03-02 02:16:45 +01:00
public Player getPlayer()
{
2013-04-10 09:34:14 +02:00
return this.sender;
}
2013-04-10 09:34:14 +02:00
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public FactionDisbandEvent(Player sender, String factionId)
{
2013-04-10 09:34:14 +02:00
this.cancelled = false;
this.sender = sender;
this.id = factionId;
}
2013-04-10 09:34:14 +02:00
// -------------------------------------------- //
// ASSORTED
// -------------------------------------------- //
2012-03-02 02:16:45 +01:00
2013-04-10 09:34:14 +02:00
2012-03-02 02:16:45 +01:00
}