Finishes the ActionCost implementation
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
This commit is contained in:
@@ -151,6 +151,20 @@ public class EconomyManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Withdraws money from a player
|
||||
*
|
||||
* @param player <p>The player to withdraw from</p>
|
||||
* @param monetaryCost <p>The cost to withdraw</p>
|
||||
* @throws IllegalArgumentException <p>If a negative cost is given</p>
|
||||
*/
|
||||
public static void withdraw(@NotNull Player player, double monetaryCost) {
|
||||
if (monetaryCost < 0) {
|
||||
throw new IllegalArgumentException("Cannot withdraw a negative amount");
|
||||
}
|
||||
economy.withdrawPlayer(player, monetaryCost);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cost of the item in the given player's main hand
|
||||
*
|
||||
|
Reference in New Issue
Block a user