From 7817b0770c5ff458f1c84146c414edbbf591a9f9 Mon Sep 17 00:00:00 2001 From: Allink Date: Sat, 20 May 2023 06:11:24 +0100 Subject: [PATCH] Refactor arithmetic operations in EconomicEntityData to be more in-line with Transaction --- .../java/me/totalfreedom/datura/user/SimpleUserData.java | 8 ++++---- .../java/me/totalfreedom/economy/EconomicEntityData.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Datura/src/main/java/me/totalfreedom/datura/user/SimpleUserData.java b/Datura/src/main/java/me/totalfreedom/datura/user/SimpleUserData.java index 556ec60..82d086d 100644 --- a/Datura/src/main/java/me/totalfreedom/datura/user/SimpleUserData.java +++ b/Datura/src/main/java/me/totalfreedom/datura/user/SimpleUserData.java @@ -220,15 +220,15 @@ public class SimpleUserData implements UserData } @Override - public void addToBalance(long amount) + public long addToBalance(long amount) { - balance.addAndGet(amount); + return balance.addAndGet(amount); } @Override - public void removeFromBalance(long amount) + public long removeFromBalance(long amount) { - balance.addAndGet(-amount); + return balance.addAndGet(-amount); } @Override diff --git a/Patchwork/src/main/java/me/totalfreedom/economy/EconomicEntityData.java b/Patchwork/src/main/java/me/totalfreedom/economy/EconomicEntityData.java index 356daac..308a6c0 100644 --- a/Patchwork/src/main/java/me/totalfreedom/economy/EconomicEntityData.java +++ b/Patchwork/src/main/java/me/totalfreedom/economy/EconomicEntityData.java @@ -6,9 +6,9 @@ public interface EconomicEntityData long getBalance(); - void addToBalance(final long amount); + long addToBalance(final long amount); - void removeFromBalance(final long amount); + long removeFromBalance(final long amount); void setBalance(final long newBalance); }