Class PlayerBuyUpgradeEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
de.marcely.bedwars.api.event.player.PlayerBuyUpgradeEvent
All Implemented Interfaces:
ArenaEvent

public class PlayerBuyUpgradeEvent extends PlayerEvent implements ArenaEvent
  • Constructor Details

  • Method Details

    • getArena

      public Arena getArena()
      Returns the arena in which the player is playing.
      Specified by:
      getArena in interface ArenaEvent
      Returns:
      The arena in which the player currently is inside
    • getTeam

      public Team getTeam()
      Returns the team in which the player bought the upgrade for.
      Returns:
      the team that is being upgraded
    • isTrap

      public boolean isTrap()
      Returns if the handler attached to this upgrade level is a trap handler
      Returns:
      check if the upgrade level that was purchased is a trap
    • getUpgradeLevel

      public UpgradeLevel getUpgradeLevel()
      The upgrade level that was purchased by the player
      Returns:
      get the upgrade level that was purchased
    • isBroadcastingMessage

      public boolean isBroadcastingMessage()
      Whether or not a message will be sent out to all team players when an upgrade or trap is purchased
      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 or trap is purchased
      Parameters:
      broadcastingMessage - if a message should be broadcast
    • isBroadcastingSound

      public boolean isBroadcastingSound()
      Whether or not a sound will be played when an upgrade or trap is purchased
      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 or trap is purchased
      Parameters:
      broadcastingSound - if the sound should be played
    • getProblems

      public List<PlayerBuyUpgradeEvent.Problem> getProblems()
      Returns the problems that are preventing the item from being bought
      Returns:
      The problems
    • addProblem

      public boolean addProblem(PlayerBuyUpgradeEvent.Problem problem)
      Add a problem that will prevent the item from being bought.

      Act's similar as Cancellable.setCancelled(boolean).

      Parameters:
      problem - The problem why he can't buy it
      Returns:
      false if it already has been added
    • addProblem

      public boolean addProblem(PlayerBuyUpgradeEvent.DefaultProblem problem)
      Add a problem that will prevent the item from being bought.

      Act's similar as Cancellable.setCancelled(boolean).

      Parameters:
      problem - The problem why he can't buy it
      Returns:
      false if it already has been added
    • removeProblem

      public boolean removeProblem(PlayerBuyUpgradeEvent.Problem problem)
      Removes a problem.
      Parameters:
      problem - The problem
      Returns:
      If it has been removed or not
    • removeProblem

      public boolean removeProblem(PlayerBuyUpgradeEvent.DefaultProblem problem)
      Removes a problem.
      Parameters:
      problem - The problem
      Returns:
      If it has been removed or not
    • removeAllProblems

      public int removeAllProblems()
      Removes all problems and makes it buyable by that.
      Returns:
      The amount of problems that have been removed
    • isDoingUpgrade

      public boolean isDoingUpgrade()
      Returns whether or not the player will receive the products of the item.

      Does not concern when there are problems as he won't receive them if there are problems anyways.

      Returns:
      If he'll get the products or not
    • setDoingUpgrade

      public void setDoingUpgrade(boolean doingUpgrade)
      Define whether or not if he'll get products.

      Keep in mind that problems can prevent products being given to him.

      Parameters:
      doingUpgrade - The new value
    • isTakingPayments

      public boolean isTakingPayments()
      Returns whether or not it will take the payments from the player.

      Does not concern when there are problems as they're preventing them from being taken anyways.

      Returns:
      If the payments will be taken or not
    • setTakingPayments

      public void setTakingPayments(boolean takePayments)
      Define whether or not the payments will be taken from the player.

      Keep in mind that problems can prevent this

      Parameters:
      takePayments - The new value
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()