@@ -119,7 +119,7 @@ public boolean hasAccount(final @NotNull String player, final @NotNull String wo
119119 public double getBalance (final @ NotNull OfflinePlayer player ) {
120120 final @ NotNull Optional <@ NotNull Account > account = Account .getVaultAccount (player );
121121 return account .map (value -> Optional .ofNullable (value .balance ).map (BigDecimal ::doubleValue )
122- .orElse (Double .POSITIVE_INFINITY )).orElse (0d );
122+ .orElse (Double .MAX_VALUE )).orElse (0d );
123123 }
124124
125125 /**
@@ -209,13 +209,13 @@ public boolean has(final @NotNull String player, final @NotNull String world, fi
209209 final @ NotNull Optional <@ NotNull Account > account = Account .getVaultAccount (player );
210210 if (account .isEmpty ()) return new EconomyResponse (amount , 0 , EconomyResponse .ResponseType .FAILURE , "Account not found" );
211211 if (!account .get ().hasFunds (BigDecimal .valueOf (amount )))
212- return new EconomyResponse (amount , Optional .ofNullable (account .get ().balance ).map (BigDecimal ::doubleValue ).orElse (Double .POSITIVE_INFINITY ), EconomyResponse .ResponseType .FAILURE , "Insufficient funds" );
212+ return new EconomyResponse (amount , Optional .ofNullable (account .get ().balance ).map (BigDecimal ::doubleValue ).orElse (Double .MAX_VALUE ), EconomyResponse .ResponseType .FAILURE , "Insufficient funds" );
213213 final @ NotNull Account serverAccount = Account .getServerAccount ().orElse (new Account .ClosedAccount ());
214214 // transfer funds to the server account since Vault just wants them "gone"
215215 account .get ().transfer (serverAccount , BigDecimal .valueOf (amount ), BankAccounts .getInstance ().config ().integrationsVaultDescription (), null );
216216 // remove funds from the server account without a transaction
217217 serverAccount .updateBalance (BigDecimal .valueOf (amount ).negate ());
218- return new EconomyResponse (amount , Optional .ofNullable (account .get ().balance ).map (BigDecimal ::doubleValue ).orElse (Double .POSITIVE_INFINITY ), EconomyResponse .ResponseType .SUCCESS , null );
218+ return new EconomyResponse (amount , Optional .ofNullable (account .get ().balance ).map (BigDecimal ::doubleValue ).orElse (Double .MAX_VALUE ), EconomyResponse .ResponseType .SUCCESS , null );
219219 }
220220 /**
221221 * Remove amount of money from player.
0 commit comments