Class PlayerTriggerUpgradeEvent
java.lang.Object
org.bukkit.event.Event
de.marcely.bedwars.api.event.player.PlayerTriggerUpgradeEvent
- All Implemented Interfaces:
ArenaEvent
,Cancellable
Gets called when an upgrade is bought (and thus automatically triggered) or a trap is triggered.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerTriggerUpgradeEvent
(@Nullable Player player, Arena arena, Team team, UpgradeLevel upgradeLevel) PlayerTriggerUpgradeEvent
(Player player, Arena arena, Team team, UpgradeLevel upgradeLevel, boolean broadcastingMessage, boolean broadcastingTitle, boolean broadcastingSound, boolean takingFromQueue) -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the amplifier that's being applied to this upgradegetArena()
Returns the arena in which the trap was triggered.int
Returns the duration that's being applied to this upgradestatic HandlerList
@Nullable Player
Returns the player that triggered the upgrade or trap.getTeam()
Returns the team in which the upgrade or trap belongs to.Returns the UpgradeLevel that belongs to the upgrade that's being triggered, or the trap that's being purchasedboolean
Get whether any player triggered the upgrade or trap.boolean
Get whether this upgrade was virtually done using the API.boolean
Whether or not a message will be sent out to all team players when an upgrade is purchased, or when a trap is triggeredboolean
Whether or not a sound will be played when an upgrade is purchased, or when a trap is triggeredboolean
Whether or not a title will be sent out to all team players when an upgrade is purchased, or when a trap is triggeredboolean
If true the trap will be pulled from the upgrade queue.boolean
isTrap()
Returns if the handler attached to this UpgradeLevel is a trap handlervoid
setBroadcastingMessage
(boolean broadcastingMessage) Sets whether or not a message will be sent out to all team players when an upgrade is purchased, or when a trap is triggeredvoid
setBroadcastingSound
(boolean broadcastingSound) Set whether or not a sound should be played when an upgrade is purchased, or when a trap is triggeredvoid
setBroadcastingTitle
(boolean broadcastingTitle) Sets whether or not a title will be sent out to all team players when an upgrade is purchased, or when a trap is triggeredvoid
setTakingFromQueue
(boolean takingFromQueue) If true the trap will be pulled from the upgrade queue.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bukkit.event.Cancellable
isCancelled, setCancelled
-
Constructor Details
-
PlayerTriggerUpgradeEvent
public PlayerTriggerUpgradeEvent(Player player, Arena arena, Team team, UpgradeLevel upgradeLevel, boolean broadcastingMessage, boolean broadcastingTitle, boolean broadcastingSound, boolean takingFromQueue) -
PlayerTriggerUpgradeEvent
public PlayerTriggerUpgradeEvent(@Nullable @Nullable Player player, Arena arena, Team team, UpgradeLevel upgradeLevel)
-
-
Method Details
-
getPlayer
Returns the player that triggered the upgrade or trap.It can be
null
if the upgrade was triggered using the API.- Returns:
- The player that triggered the upgrade or trap. May be
null
- See Also:
-
hasPlayer
public boolean hasPlayer()Get whether any player triggered the upgrade or trap.This may be
false
if the upgrade was triggered using the API.- Returns:
true
if there is a known player that triggered the upgrade or trap- See Also:
-
getArena
Returns the arena in which the trap was triggered.- Specified by:
getArena
in interfaceArenaEvent
- Returns:
- The arena involved
-
getTeam
Returns the team in which the upgrade or trap belongs to.- Returns:
- The team involved
-
isAPICall
public boolean isAPICall()Get whether this upgrade was virtually done using the API.- Returns:
true
if an addon triggered.false
if a player himself triggered it- See Also:
-
isTakingFromQueue
public boolean isTakingFromQueue()If true the trap will be pulled from the upgrade queue. This has no effect if this UpgradeLevel handler is not a trap- Returns:
- weather or not a trap will be pulled from the team's trap queue
-
setTakingFromQueue
public void setTakingFromQueue(boolean takingFromQueue) If true the trap will be pulled from the upgrade queue. This has no effect if this UpgradeLevel handler is not a trap- Parameters:
takingFromQueue
- weather or not a trap will be pulled from the team's trap queue
-
isBroadcastingMessage
public boolean isBroadcastingMessage()Whether or not a message will be sent out to all team players when an upgrade is purchased, or when a trap is triggered- Returns:
- if a message will be broadcast
-
setBroadcastingMessage
public void setBroadcastingMessage(boolean broadcastingMessage) Sets whether or not a message will be sent out to all team players when an upgrade is purchased, or when a trap is triggered- Parameters:
broadcastingMessage
- if a message should be broadcast
-
isBroadcastingTitle
public boolean isBroadcastingTitle()Whether or not a title will be sent out to all team players when an upgrade is purchased, or when a trap is triggered- Returns:
- if a title will be sent
-
setBroadcastingTitle
public void setBroadcastingTitle(boolean broadcastingTitle) Sets whether or not a title will be sent out to all team players when an upgrade is purchased, or when a trap is triggered- Parameters:
broadcastingTitle
- if a message should be broadcast
-
isBroadcastingSound
public boolean isBroadcastingSound()Whether or not a sound will be played when an upgrade is purchased, or when a trap is triggered- Returns:
- if the sound is being played
-
setBroadcastingSound
public void setBroadcastingSound(boolean broadcastingSound) Set whether or not a sound should be played when an upgrade is purchased, or when a trap is triggered- Parameters:
broadcastingSound
- if the sound should be played
-
getUpgradeLevel
Returns the UpgradeLevel that belongs to the upgrade that's being triggered, or the trap that's being purchased- Returns:
- UpgradeLevel that's being triggered
-
getAmplifier
public double getAmplifier()Returns the amplifier that's being applied to this upgrade- Returns:
- the amplifier for the upgrade level being triggered
-
getDuration
public int getDuration()Returns the duration that's being applied to this upgrade- Returns:
- the duration for the upgrade level being triggered
-
isTrap
public boolean isTrap()Returns if the handler attached to this UpgradeLevel is a trap handler- Returns:
- check if the upgrade level that was purchased is a trap
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-