Saber-Factions/src/main/java/com/massivecraft/factions/event/FactionDisbandEvent.java

55 lines
1.2 KiB
Java
Raw Normal View History

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;
2014-04-04 20:55:21 +02:00
public class FactionDisbandEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
2014-04-04 20:55:21 +02:00
private boolean cancelled;
private String id;
private Player sender;
2014-04-04 20:55:21 +02:00
public FactionDisbandEvent(Player sender, String factionId) {
2014-07-01 22:10:18 +02:00
cancelled = false;
this.sender = sender;
this.id = factionId;
2014-04-04 20:55:21 +02:00
}
2014-04-04 20:55:21 +02:00
public HandlerList getHandlers() {
return handlers;
}
2014-04-04 20:55:21 +02:00
public static HandlerList getHandlerList() {
return handlers;
}
2014-04-04 20:55:21 +02:00
public Faction getFaction() {
return Factions.i.get(id);
}
2014-04-04 20:55:21 +02:00
public FPlayer getFPlayer() {
return FPlayers.i.get(sender);
}
2014-04-04 20:55:21 +02:00
public Player getPlayer() {
return sender;
}
2014-04-04 20:55:21 +02:00
@Override
public boolean isCancelled() {
return cancelled;
}
2014-04-04 20:55:21 +02:00
@Override
public void setCancelled(boolean c) {
cancelled = c;
}
}