Skip to content

Commit 6a609a9

Browse files
committed
📝 Fix coins engine
1 parent 2899ce4 commit 6a609a9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/java/fr/traqueur/currencies/providers/CoinsEngineProvider.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,29 @@
33
import fr.traqueur.currencies.CurrencyProvider;
44
import org.bukkit.OfflinePlayer;
55
import su.nightexpress.coinsengine.api.CoinsEngineAPI;
6-
import su.nightexpress.coinsengine.api.currency.Currency;
76

87
import java.math.BigDecimal;
98

109
public class CoinsEngineProvider implements CurrencyProvider {
1110

12-
private final Currency currency;
11+
private final String currencyName;
1312

1413
public CoinsEngineProvider(String currencyName) {
15-
this.currency = CoinsEngineAPI.getCurrency(currencyName);
14+
this.currencyName = currencyName;
1615
}
1716

1817
@Override
1918
public void deposit(OfflinePlayer offlinePlayer, BigDecimal amount, String reason) {
20-
CoinsEngineAPI.addBalance(offlinePlayer.getUniqueId(), this.currency, amount.doubleValue());
19+
CoinsEngineAPI.addBalance(offlinePlayer.getUniqueId(), this.currencyName, amount.doubleValue());
2120
}
2221

2322
@Override
2423
public void withdraw(OfflinePlayer offlinePlayer, BigDecimal amount, String reason) {
25-
CoinsEngineAPI.removeBalance(offlinePlayer.getUniqueId(), this.currency, amount.doubleValue());
24+
CoinsEngineAPI.removeBalance(offlinePlayer.getUniqueId(), this.currencyName, amount.doubleValue());
2625
}
2726

2827
@Override
2928
public BigDecimal getBalance(OfflinePlayer offlinePlayer) {
30-
return BigDecimal.valueOf(CoinsEngineAPI.getBalance(offlinePlayer.getUniqueId(), this.currency));
29+
return BigDecimal.valueOf(CoinsEngineAPI.getBalance(offlinePlayer.getUniqueId(), this.currencyName));
3130
}
3231
}

0 commit comments

Comments
 (0)