Class DeathPriceEvent
java.lang.Object
org.bukkit.event.Event
com.palmergames.bukkit.towny.event.deathprice.DeathPriceEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
- Direct Known Subclasses:
NationPaysDeathPriceEvent
,PlayerPaysDeathPriceEvent
,TownPaysDeathPriceEvent
public abstract class DeathPriceEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDeathPriceEvent
(Account payer, double amount, Resident deadResident, org.bukkit.entity.Player killer) -
Method Summary
Modifier and TypeMethodDescriptiondouble
static org.bukkit.event.HandlerList
org.bukkit.event.HandlerList
@Nullable org.bukkit.entity.Player
getPayer()
boolean
Whether the event has been cancelled or the amount has been made 0 or less.boolean
void
setAmount
(double amount) void
setCancelled
(boolean cancel) Set the event to cancelled.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Field Details
-
cancelled
protected boolean cancelled -
payer
-
amount
protected double amount -
deadResident
-
killer
protected final org.bukkit.entity.Player killer
-
-
Constructor Details
-
DeathPriceEvent
-
-
Method Details
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
getPayer
- Returns:
- the payer
-
getAmount
public double getAmount()- Returns:
- the amount
-
setAmount
public void setAmount(double amount) - Parameters:
amount
- the amount to set
-
getDeadResident
- Returns:
- the deadResident
-
getKiller
@Nullable public @Nullable org.bukkit.entity.Player getKiller()- Returns:
- killer, the Player who is getting paid, or null if this was not a PVP death.
-
isPVPDeath
public boolean isPVPDeath()- Returns:
- true when this is a PVP related death.
-
isCancelled
public boolean isCancelled()Whether the event has been cancelled or the amount has been made 0 or less.- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) Set the event to cancelled. False meaning money will be lost, True meaning no money will be lost.- Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-