2012-03-02 02:16:45 +01:00
|
|
|
package com.massivecraft.factions.event;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
public class FPlayerJoinEvent extends Event implements Cancellable
|
|
|
|
{
|
2013-04-10 09:34:14 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// REQUIRED EVENT CODE
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2012-03-02 02:16:45 +01:00
|
|
|
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 FPlayer fplayer;
|
|
|
|
private Faction faction;
|
|
|
|
private PlayerJoinReason reason;
|
|
|
|
|
|
|
|
private boolean cancelled = false;
|
|
|
|
@Override public boolean isCancelled() { return this.cancelled; }
|
|
|
|
@Override public void setCancelled(boolean cancelled) { this.cancelled = cancelled; }
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// CONSTRUCT
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public FPlayerJoinEvent(FPlayer fplayer, Faction faction, PlayerJoinReason reason)
|
2012-03-02 02:16:45 +01:00
|
|
|
{
|
2013-04-10 09:34:14 +02:00
|
|
|
this.fplayer = fplayer;
|
|
|
|
this.faction = faction;
|
|
|
|
this.reason = reason;
|
2012-03-02 02:16:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public FPlayer getFPlayer()
|
|
|
|
{
|
|
|
|
return fplayer;
|
|
|
|
}
|
|
|
|
public Faction getFaction()
|
|
|
|
{
|
|
|
|
return faction;
|
|
|
|
}
|
|
|
|
public PlayerJoinReason getReason()
|
|
|
|
{
|
|
|
|
return reason;
|
|
|
|
}
|
2013-04-10 09:34:14 +02:00
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// INTERNAL ENUM
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public enum PlayerJoinReason
|
2012-03-02 02:16:45 +01:00
|
|
|
{
|
2013-04-10 09:34:14 +02:00
|
|
|
CREATE, LEADER, COMMAND
|
2012-03-02 02:16:45 +01:00
|
|
|
}
|
2013-04-10 09:34:14 +02:00
|
|
|
|
2012-03-02 02:16:45 +01:00
|
|
|
}
|