Class CostManager.NoCost

java.lang.Object
com.booksaw.betterTeams.cost.CommandCost
com.booksaw.betterTeams.cost.CostManager.NoCost
Enclosing class:
CostManager

public static class CostManager.NoCost extends CommandCost
This class is returned when a command does not have a cost, this is used to avoid running many null checks throughout the program. The class is used to stop any cost tracking for a specific command
Author:
booksaw
  • Constructor Details

    • NoCost

      public NoCost()
  • Method Details

    • runCommand

      public boolean runCommand(org.bukkit.entity.Player player)
      Description copied from class: CommandCost
      Run when a player runs the command to subtract the cost of the command
      Overrides:
      runCommand in class CommandCost
      Parameters:
      player - the player to add a Cost for
      Returns:
      If the player can run the command (if the transaction is a success or failure)
    • hasBalance

      public boolean hasBalance(org.bukkit.entity.Player player)
      Overrides:
      hasBalance in class CommandCost
      Parameters:
      player - the player to check for
      Returns:
      if a player has the money to run that command (to check before executing the command)