GamblingEconomyHandler

Handles gambling-specific economy operations including debt management. This class ensures safety-first transaction processing for gambling operations.

Constructors

Link copied to clipboard
public void GamblingEconomyHandler()

Properties

Link copied to clipboard
public static double houseEarnings
Tracks total house earnings (money won by the house from players).
Link copied to clipboard
public final static double MAX_DEBT
Maximum amount of debt a player can accumulate from gambling.

Functions

Link copied to clipboard
public static void awardWinnings(UUID uuid, double amount)
Awards winnings to a player.
Link copied to clipboard
public static double calculatePayout(double betAmount, double multiplier)
Calculates payout for a win based on bet amount and multiplier.
Link copied to clipboard
public static boolean canAffordBet(UUID uuid, double betAmount)
Checks if a player can afford a bet, including using credit (going into debt).
Link copied to clipboard
public static double getAvailableCredit(UUID uuid)
Gets the player's available credit (how much more debt they can take on).
Link copied to clipboard
public static double getBalance(UUID uuid)
Gets the player's current balance (convenience method).
Link copied to clipboard
public static double getDebt(UUID uuid)
Gets the player's current gambling debt.
Link copied to clipboard
public static String getFinancialStatus(UUID uuid)
Formats the player's financial status as a string for display.
Link copied to clipboard
public static String getFormattedHouseEarnings()
Gets the formatted house earnings string for display.
Link copied to clipboard
public static double getHouseEarnings()
Tracks total house earnings (money won by the house from players).
Link copied to clipboard
public static double getMaxBet(UUID uuid)
Gets the maximum bet a player can make based on their balance and available credit.
Link copied to clipboard
public static void initialize()
Initializes the house earnings tracking system.
Link copied to clipboard
public static boolean isInDebt(UUID uuid)
Checks if a player is currently in gambling debt.
Link copied to clipboard
public static boolean placeBet(UUID uuid, double betAmount)
Places a bet for a player.
Link copied to clipboard
public static void recordHouseLoss(double amount)
Records a loss for the house (when a player wins).
Link copied to clipboard
public static void recordHouseWin(double amount)
Records earnings for the house (when a player loses).
Link copied to clipboard
public static double resolveOutcome(UUID uuid, double payoutAmount)
Central resolution point for all gambling game outcomes.
Link copied to clipboard
public static void saveHouseEarnings()
Saves the house earnings to disk.
Link copied to clipboard
public static void shutdown()
Shuts down the handler and saves data.