2012-12-19 13:18:56 +01:00
|
|
|
package com.massivecraft.factions.event;
|
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
import com.massivecraft.factions.FPlayer;
|
|
|
|
import com.massivecraft.factions.Faction;
|
|
|
|
import org.bukkit.entity.Player;
|
2012-12-19 13:18:56 +01:00
|
|
|
import org.bukkit.event.Cancellable;
|
|
|
|
|
2014-07-09 21:01:53 +02:00
|
|
|
/**
|
|
|
|
* Event called when a player loses power.
|
|
|
|
*/
|
2014-07-09 21:00:16 +02:00
|
|
|
public class PowerLossEvent extends FactionPlayerEvent implements Cancellable {
|
2012-12-19 13:18:56 +01:00
|
|
|
|
2014-07-09 21:00:16 +02:00
|
|
|
private boolean cancelled = false;
|
2014-04-04 20:55:21 +02:00
|
|
|
private String message;
|
|
|
|
|
|
|
|
public PowerLossEvent(Faction f, FPlayer p) {
|
2014-07-09 21:00:16 +02:00
|
|
|
super(f, p);
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
2014-07-09 21:01:53 +02:00
|
|
|
/**
|
|
|
|
* Get the id of the faction.
|
|
|
|
*
|
|
|
|
* @return id of faction as String
|
|
|
|
*
|
|
|
|
* @deprecated use getFaction().getId() instead.
|
|
|
|
*/
|
2014-07-09 21:00:16 +02:00
|
|
|
@Deprecated
|
2014-04-04 20:55:21 +02:00
|
|
|
public String getFactionId() {
|
2014-07-09 21:00:16 +02:00
|
|
|
return getFaction().getId();
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
2014-07-09 21:01:53 +02:00
|
|
|
/**
|
|
|
|
* Get the tag of the faction.
|
|
|
|
*
|
|
|
|
* @return tag of faction as String
|
|
|
|
*
|
|
|
|
* @deprecated use getFaction().getTag() instead.
|
|
|
|
*/
|
2014-07-09 21:00:16 +02:00
|
|
|
@Deprecated
|
2014-04-04 20:55:21 +02:00
|
|
|
public String getFactionTag() {
|
2014-07-09 21:00:16 +02:00
|
|
|
return getFaction().getTag();
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
2014-07-09 21:01:53 +02:00
|
|
|
/**
|
|
|
|
* Get the Player involved in the event.
|
|
|
|
*
|
|
|
|
* @return Player from FPlayer.
|
|
|
|
*
|
|
|
|
* @deprecated use getfPlayer().getPlayer() instead.
|
|
|
|
*/
|
2014-07-09 21:00:16 +02:00
|
|
|
@Deprecated
|
2014-04-04 20:55:21 +02:00
|
|
|
public Player getPlayer() {
|
2014-07-09 21:00:16 +02:00
|
|
|
return getfPlayer().getPlayer();
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
2014-07-09 21:01:53 +02:00
|
|
|
/**
|
|
|
|
* Get the power loss message.
|
|
|
|
*
|
|
|
|
* @return power loss message as String.
|
|
|
|
*/
|
2014-04-04 20:55:21 +02:00
|
|
|
public String getMessage() {
|
|
|
|
return message;
|
|
|
|
}
|
|
|
|
|
2014-07-09 21:01:53 +02:00
|
|
|
/**
|
|
|
|
* Set the power loss message.
|
|
|
|
*
|
|
|
|
* @param message
|
|
|
|
*/
|
2014-04-04 20:55:21 +02:00
|
|
|
public void setMessage(String message) {
|
|
|
|
this.message = message;
|
|
|
|
}
|
2012-12-19 13:18:56 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
@Override
|
|
|
|
public boolean isCancelled() {
|
|
|
|
return cancelled;
|
|
|
|
}
|
2012-12-19 13:18:56 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
@Override
|
|
|
|
public void setCancelled(boolean c) {
|
|
|
|
this.cancelled = c;
|
|
|
|
}
|
2012-12-19 13:18:56 +01:00
|
|
|
|
|
|
|
}
|