Skip to content

Commit

Permalink
Merge pull request #36 from Apleax/master
Browse files Browse the repository at this point in the history
Update VaultUnlocked to 2.7. If you are using VaultUnlocked, you need to update it now.
  • Loading branch information
ColdeZhang authored Nov 5, 2024
2 parents 7e6b62a + 0c628e5 commit 6341f2a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ allprojects {
compileOnly("us.dynmap:DynmapCoreAPI:3.4")
compileOnly("me.clip:placeholderapi:2.11.6")
compileOnly("com.github.MilkBowl:VaultAPI:1.7")
compileOnly("net.milkbowl.vault:VaultUnlockedAPI:2.2")
compileOnly("net.milkbowl.vault:VaultUnlockedAPI:2.7")

if (!BuildFull) {
libraries.forEach {
Expand Down Expand Up @@ -123,4 +123,4 @@ hangarPublish {

tasks.named("publishPluginPublicationToHangar") {
dependsOn(tasks.named("jar"))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
public class Vault2 implements VaultInterface {

private Economy econ = null;

private String PluginName = null;

@Override
public boolean init(JavaPlugin plugin) {
RegisteredServiceProvider<Economy> rsp = plugin.getServer().getServicesManager().getRegistration(Economy.class);
if (rsp != null) {
econ = rsp.getProvider();
PluginName = plugin.getName();
return true;
}
XLogger.err(Localization.Utils_VaultUnlockedNotAvailable);
Expand All @@ -26,26 +28,26 @@ public boolean init(JavaPlugin plugin) {

@Override
public String currencyNamePlural() {
return econ.defaultCurrencyNamePlural();
return econ.defaultCurrencyNamePlural(PluginName);
}

@Override
public String currencyNameSingular() {
return econ.defaultCurrencyNameSingular();
return econ.defaultCurrencyNameSingular(PluginName);
}

@Override
public void withdrawPlayer(Player player, double amount) {
econ.withdraw("MPU", player.getUniqueId(), BigDecimal.valueOf(amount));
econ.withdraw(PluginName, player.getUniqueId(), BigDecimal.valueOf(amount));
}

@Override
public void depositPlayer(Player player, double amount) {
econ.deposit("MPU", player.getUniqueId(), BigDecimal.valueOf(amount));
econ.deposit(PluginName, player.getUniqueId(), BigDecimal.valueOf(amount));
}

@Override
public double getBalance(Player player) {
return econ.getBalance("MPU", player.getUniqueId()).doubleValue();
return econ.getBalance(PluginName, player.getUniqueId()).doubleValue();
}
}

0 comments on commit 6341f2a

Please sign in to comment.