2012-03-13 13:58:51 +01:00
|
|
|
package com.massivecraft.factions.event;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.FPlayer;
|
|
|
|
import com.massivecraft.factions.FPlayers;
|
|
|
|
import com.massivecraft.factions.Faction;
|
|
|
|
import com.massivecraft.factions.Factions;
|
2014-04-04 20:55:21 +02:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.Cancellable;
|
|
|
|
import org.bukkit.event.Event;
|
|
|
|
import org.bukkit.event.HandlerList;
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public class FactionDisbandEvent extends Event implements Cancellable {
|
|
|
|
private static final HandlerList handlers = new HandlerList();
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
private boolean cancelled;
|
|
|
|
private String id;
|
|
|
|
private Player sender;
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public FactionDisbandEvent(Player sender, String factionId) {
|
2014-07-01 21:52:40 +02:00
|
|
|
cancelled = false; this.sender = sender; this.id = factionId;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public HandlerList getHandlers() {
|
|
|
|
return handlers;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public static HandlerList getHandlerList() {
|
|
|
|
return handlers;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public Faction getFaction() {
|
|
|
|
return Factions.i.get(id);
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public FPlayer getFPlayer() {
|
|
|
|
return FPlayers.i.get(sender);
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public Player getPlayer() {
|
|
|
|
return sender;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
@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) {
|
|
|
|
cancelled = c;
|
|
|
|
}
|
2012-03-13 13:58:51 +01:00
|
|
|
}
|