Package com.booksaw.betterTeams.cost
Class CostManager.NoCost
java.lang.Object
com.booksaw.betterTeams.cost.CommandCost
com.booksaw.betterTeams.cost.CostManager.NoCost
- Enclosing class:
- CostManager
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
hasBalance
(org.bukkit.entity.Player player) boolean
runCommand
(org.bukkit.entity.Player player) Run when a player runs the command to subtract the cost of the commandMethods inherited from class com.booksaw.betterTeams.cost.CommandCost
getCommand, getCost
-
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 classCommandCost
- 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 classCommandCost
- Parameters:
player
- the player to check for- Returns:
- if a player has the money to run that command (to check before executing the command)
-