Finishes the ActionCost implementation
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good

This commit is contained in:
2024-11-27 23:06:33 +01:00
parent e3dbeccc14
commit b01ccfc537
10 changed files with 242 additions and 54 deletions

View File

@@ -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
*