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.FLocation;
|
|
|
|
import com.massivecraft.factions.Faction;
|
2012-03-11 18:28:31 +01:00
|
|
|
import com.massivecraft.factions.FPlayer;
|
|
|
|
import org.bukkit.entity.Player;
|
2012-03-02 02:16:45 +01:00
|
|
|
|
|
|
|
public class LandClaimEvent extends Event implements Cancellable
|
|
|
|
{
|
|
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
|
|
|
|
private boolean cancelled;
|
|
|
|
private FLocation location;
|
2012-03-11 18:28:31 +01:00
|
|
|
private Faction faction;
|
|
|
|
private FPlayer fplayer;
|
2012-03-02 02:16:45 +01:00
|
|
|
|
2012-03-11 18:28:31 +01:00
|
|
|
public LandClaimEvent(FLocation loc, Faction f, FPlayer p)
|
2012-03-02 02:16:45 +01:00
|
|
|
{
|
|
|
|
cancelled = false;
|
|
|
|
location = loc;
|
2012-03-11 18:28:31 +01:00
|
|
|
faction = f;
|
|
|
|
fplayer = p;
|
2012-03-02 02:16:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public HandlerList getHandlers()
|
|
|
|
{
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static HandlerList getHandlerList()
|
|
|
|
{
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
|
2012-03-11 18:28:31 +01:00
|
|
|
public FLocation getLocation()
|
2012-03-13 14:27:03 +01:00
|
|
|
{
|
|
|
|
return this.location;
|
|
|
|
}
|
2012-03-11 18:28:31 +01:00
|
|
|
|
|
|
|
public Faction getFaction()
|
2012-03-02 02:16:45 +01:00
|
|
|
{
|
2012-03-13 14:27:03 +01:00
|
|
|
return faction;
|
2012-03-02 02:16:45 +01:00
|
|
|
}
|
|
|
|
|
2012-03-11 18:28:31 +01:00
|
|
|
public String getFactionId()
|
2012-03-02 02:16:45 +01:00
|
|
|
{
|
2012-03-13 14:27:03 +01:00
|
|
|
return faction.getId();
|
2012-03-02 02:16:45 +01:00
|
|
|
}
|
|
|
|
|
2012-03-11 18:28:31 +01:00
|
|
|
public String getFactionTag()
|
|
|
|
{
|
2012-03-13 14:27:03 +01:00
|
|
|
return faction.getTag();
|
2012-03-11 18:28:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public FPlayer getFPlayer()
|
|
|
|
{
|
|
|
|
return fplayer;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Player getPlayer()
|
2012-03-02 02:16:45 +01:00
|
|
|
{
|
2012-03-13 14:27:03 +01:00
|
|
|
return fplayer.getPlayer();
|
2012-03-02 02:16:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isCancelled()
|
|
|
|
{
|
|
|
|
return cancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setCancelled(boolean c)
|
|
|
|
{
|
|
|
|
this.cancelled = c;
|
|
|
|
}
|
|
|
|
}
|