Skip to content

Commit 17a9b45

Browse files
committed
Renamed getController to getHolder
Updated methods to use `getHolder` for consistency with the `CurrencyHolder` interface.
1 parent 5f5a486 commit 17a9b45

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

plugin/src/main/java/net/thenextlvl/service/wrapper/service/model/WrappedAccount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public WrappedAccount(EconomyController controller, @Nullable World world, Econo
2929
}
3030

3131
@Override
32-
public CurrencyHolder getController() {
32+
public CurrencyHolder getHolder() {
3333
return controller;
3434
}
3535

plugin/src/main/java/net/thenextlvl/service/wrapper/service/model/WrappedBank.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import net.milkbowl.vault.economy.Economy;
44
import net.thenextlvl.service.ServicePlugin;
55
import net.thenextlvl.service.api.economy.bank.Bank;
6+
import net.thenextlvl.service.api.economy.currency.CurrencyHolder;
67
import org.bukkit.OfflinePlayer;
78
import org.bukkit.World;
89
import org.bukkit.plugin.Plugin;
@@ -31,6 +32,11 @@ public WrappedBank(String name, @Nullable World world, Economy economy, Plugin p
3132
this.provider = provider;
3233
}
3334

35+
@Override
36+
public CurrencyHolder getHolder() {
37+
return controller;
38+
}
39+
3440
@Override
3541
public BigDecimal deposit(Number amount, Currency currency) {
3642
return new BigDecimal(economy.bankDeposit(name, amount.doubleValue()).balance);

src/main/java/net/thenextlvl/service/api/economy/Account.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public interface Account extends Comparable<Account> {
2020
*
2121
* @return the {@code CurrencyHolder} capable of managing currencies for the account
2222
*/
23-
CurrencyHolder getController();
2423
@Contract(pure = true)
24+
CurrencyHolder getHolder();
2525

2626
/**
2727
* Deposits the specified amount into the account balance.
@@ -32,7 +32,7 @@ public interface Account extends Comparable<Account> {
3232
*/
3333
@Deprecated(forRemoval = true, since = "3.0.0")
3434
default BigDecimal deposit(Number amount) {
35-
return deposit(amount, getController().getDefaultCurrency());
35+
return deposit(amount, getHolder().getDefaultCurrency());
3636
}
3737

3838
/**
@@ -52,7 +52,7 @@ default BigDecimal deposit(Number amount) {
5252
*/
5353
@Deprecated(forRemoval = true, since = "3.0.0")
5454
default BigDecimal getBalance() {
55-
return getBalance(getController().getDefaultCurrency());
55+
return getBalance(getHolder().getDefaultCurrency());
5656
}
5757

5858
BigDecimal getBalance(Currency currency);
@@ -66,7 +66,7 @@ default BigDecimal getBalance() {
6666
*/
6767
@Deprecated(forRemoval = true, since = "3.0.0")
6868
default BigDecimal withdraw(Number amount) {
69-
return withdraw(amount, getController().getDefaultCurrency());
69+
return withdraw(amount, getHolder().getDefaultCurrency());
7070
}
7171

7272
/**
@@ -103,7 +103,7 @@ default BigDecimal withdraw(Number amount) {
103103
@Override
104104
@Deprecated(forRemoval = true, since = "3.0.0")
105105
default int compareTo(Account account) {
106-
return compareTo(account, getController().getDefaultCurrency());
106+
return compareTo(account, getHolder().getDefaultCurrency());
107107
}
108108

109109
/**
@@ -126,7 +126,7 @@ default int compareTo(Account account, Currency currency) {
126126
*/
127127
@Deprecated(forRemoval = true, since = "3.0.0")
128128
default void setBalance(Number balance) {
129-
setBalance(balance, getController().getDefaultCurrency());
129+
setBalance(balance, getHolder().getDefaultCurrency());
130130
}
131131

132132
/**

0 commit comments

Comments
 (0)