2012-03-13 13:58:51 +01:00
|
|
|
package com.massivecraft.factions.event;
|
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
import com.massivecraft.factions.FPlayer;
|
|
|
|
import com.massivecraft.factions.FPlayers;
|
2018-03-10 07:08:17 +01:00
|
|
|
import com.massivecraft.factions.Faction;
|
2012-03-13 13:58:51 +01:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.Cancellable;
|
|
|
|
import org.bukkit.event.Event;
|
|
|
|
import org.bukkit.event.HandlerList;
|
|
|
|
|
2014-07-09 21:01:53 +02:00
|
|
|
/**
|
|
|
|
* Event called when a Faction is created.
|
|
|
|
*/
|
2018-03-10 07:08:17 +01:00
|
|
|
public class FactionCreateEvent extends Event {
|
2014-07-09 21:01:53 +02:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
|
2018-03-10 07:08:17 +01:00
|
|
|
private final String factionTag;
|
|
|
|
private final Player sender;
|
|
|
|
private final Faction faction;
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2018-03-10 07:08:17 +01:00
|
|
|
public FactionCreateEvent(Player sender, String tag, Faction faction) {
|
2014-07-01 22:10:18 +02:00
|
|
|
this.factionTag = tag;
|
|
|
|
this.sender = sender;
|
2018-03-10 07:08:17 +01:00
|
|
|
this.faction = faction;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public FPlayer getFPlayer() {
|
2014-10-19 07:37:25 +02:00
|
|
|
return FPlayers.getInstance().getByPlayer(sender);
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
2018-03-10 07:08:17 +01:00
|
|
|
@Deprecated
|
2014-04-04 20:55:21 +02:00
|
|
|
public String getFactionTag() {
|
|
|
|
return factionTag;
|
|
|
|
}
|
|
|
|
|
2018-03-10 07:08:17 +01:00
|
|
|
public Faction getFaction() {
|
|
|
|
return this.faction;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-04-04 20:55:21 +02:00
|
|
|
public HandlerList getHandlers() {
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static HandlerList getHandlerList() {
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
|
2012-03-13 13:58:51 +01:00
|
|
|
}
|