Skip to content

Commit

Permalink
Update Version; Readd AbstractEconomy to old source branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorfromhell committed Aug 25, 2024
1 parent f158f98 commit 92bc7ae
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ How to include the API with Maven:
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultUnlockedAPI</artifactId>
<version>2.2</version><!-- Validate this is the most recent version from the CI -->
<version>2.4</version><!-- Validate this is the most recent version from the CI -->
<scope>provided</scope>
</dependency>
</dependencies>
Expand All @@ -24,7 +24,7 @@ repositories {
maven { url 'https://repo.codemc.org/repository/maven-public' }
}
dependencies {
compileOnly "net.milkbowl.vault:VaultUnlockedAPI:2.1"
compileOnly "net.milkbowl.vault:VaultUnlockedAPI:2.4"
}
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultUnlockedAPI</artifactId>
<version>2.3</version>
<version>2.4</version>


<name>VaultUnlockedAPI</name>
Expand Down
87 changes: 87 additions & 0 deletions src/main/java/net/milkbowl/vault/economy/AbstractEconomy.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package net.milkbowl.vault.economy;

import org.bukkit.OfflinePlayer;

@SuppressWarnings("deprecation")
public abstract class AbstractEconomy implements Economy {

@Override
public boolean hasAccount(OfflinePlayer player) {
if (player.getName() == null) return false;
return hasAccount(player.getName());
}

@Override
public boolean hasAccount(OfflinePlayer player, String worldName) {
if (player.getName() == null) return false;
return hasAccount(player.getName(), worldName);
}

@Override
public double getBalance(OfflinePlayer player) {
return getBalance(player.getName());
}

@Override
public double getBalance(OfflinePlayer player, String world) {
return getBalance(player.getName(), world);
}

@Override
public boolean has(OfflinePlayer player, double amount) {
if (player.getName() == null) return false;
return has(player.getName(), amount);
}

@Override
public boolean has(OfflinePlayer player, String worldName, double amount) {
if (player.getName() == null) return false;
return has(player.getName(), worldName, amount);
}

@Override
public EconomyResponse withdrawPlayer(OfflinePlayer player, double amount) {
return withdrawPlayer(player.getName(), amount);
}

@Override
public EconomyResponse withdrawPlayer(OfflinePlayer player, String worldName, double amount) {
return withdrawPlayer(player.getName(), worldName, amount);
}

@Override
public EconomyResponse depositPlayer(OfflinePlayer player, double amount) {
return depositPlayer(player.getName(), amount);
}

@Override
public EconomyResponse depositPlayer(OfflinePlayer player, String worldName, double amount) {
return depositPlayer(player.getName(), worldName, amount);
}

@Override
public EconomyResponse createBank(String name, OfflinePlayer player) {
return createBank(name, player.getName());
}

@Override
public EconomyResponse isBankOwner(String name, OfflinePlayer player) {
return isBankOwner(name, player.getName());
}

@Override
public EconomyResponse isBankMember(String name, OfflinePlayer player) {
return isBankMember(name, player.getName());
}

@Override
public boolean createPlayerAccount(OfflinePlayer player) {
return createPlayerAccount(player.getName());
}

@Override
public boolean createPlayerAccount(OfflinePlayer player, String worldName) {
return createPlayerAccount(player.getName(), worldName);
}

}

0 comments on commit 92bc7ae

Please sign in to comment.