44import lombok .Getter ;
55import lombok .RequiredArgsConstructor ;
66
7- import org .bukkit .Bukkit ;
87import org .jetbrains .annotations .ApiStatus ;
98import org .jetbrains .annotations .NotNull ;
109import org .jetbrains .annotations .ApiStatus .Internal ;
@@ -40,6 +39,8 @@ public final class AccountManager {
4039 public synchronized void create (final @ NotNull UUID uuid ) {
4140 Account account = new Account ();
4241 account .setUuid (uuid );
42+ account .setAmount (BigDecimal .ZERO );
43+ account .setTransactions (BigDecimal .ZERO );
4344
4445 create (account );
4546 }
@@ -53,6 +54,8 @@ public synchronized void create(final @NotNull UUID uuid, final @NotNull String
5354 Account account = new Account ();
5455 account .setUuid (uuid );
5556 account .setName (name );
57+ account .setAmount (BigDecimal .ZERO );
58+ account .setTransactions (BigDecimal .ZERO );
5659
5760 create (account );
5861 }
@@ -215,8 +218,8 @@ public boolean has(final @NotNull Account account, final @NotNull BigDecimal amo
215218 */
216219 public @ NotNull BigDecimal amount (final @ NotNull Account account ) {
217220 // Fake players / accounts
218- if (!Bukkit .getOfflinePlayer (account .getUuid ()).hasPlayedBefore ())
219- return account .getTransactions ().add (getValueOfPlayer (account .getUuid (), false ));
221+ // if (!Bukkit.getOfflinePlayer(account.getUuid()).hasPlayedBefore())
222+ // return account.getTransactions().add(getValueOfPlayer(account.getUuid(), false));
220223
221224 final Optional <OfflinePlayerReference > optionalOfflinePlayerReference = uuidResolver .resolveOfflinePlayer (account .getUuid ());
222225
@@ -229,7 +232,8 @@ public boolean has(final @NotNull Account account, final @NotNull BigDecimal amo
229232 }
230233
231234 // Offline players
232- return account .getAmount ().add (account .getTransactions ());
235+ //return account.getAmount().add(account.getTransactions());
236+ return account .getTransactions ().add (getValueOfPlayer (account .getUuid (), false )).add (account .getAmount ());
233237 }
234238
235239 @ Internal
0 commit comments