Skip to content

Commit

Permalink
Implement requested changes.
Browse files Browse the repository at this point in the history
- Added renameAccount(UUID, String).
- Remove @nullable annotation and remove repo/dependency from pom.xml.
- Fixed typo in javadoc in Economy.
  • Loading branch information
LlmDl committed Aug 3, 2022
1 parent 1af24b2 commit 7c7d0ab
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
11 changes: 0 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
</repositories>

<distributionManagement>
Expand All @@ -65,13 +61,6 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms
<version>${bukkitVersion}</version>
<scope>provided</scope>
</dependency>
<!-- Annotations -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.0.0</version>
<scope>provided</scope>
</dependency>
<!-- Test Dependency -->
<dependency>
<groupId>junit</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/milkbowl/vault/economy/Economy.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* The main economy API
*
* @deprecated in lieu of the modern Vault2. To update alter your import to new.milkbowl.vault2.economy and update to use the new UUID-based methods where available.
* @deprecated in lieu of the modern Vault2. To update alter your import to net.milkbowl.vault2.economy and update to use the new UUID-based methods where available.
*/
public interface Economy {

Expand Down
27 changes: 17 additions & 10 deletions src/main/java/net/milkbowl/vault2/economy/Economy.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
import java.util.Map;
import java.util.UUID;

import org.jetbrains.annotations.Nullable;

/**
* The main economy API
*
*/
public interface Economy {

/*
* Economy plugin-related methods follow.
* Economy plugin-related methods follow.
*/

/**
Expand Down Expand Up @@ -118,23 +116,21 @@ public interface Economy {

/**
* Returns a map that represents all of the UUIDs which have accounts in the
* plugin, as well as their last-known-name whether it is null or not. This is
* used for Vault's economy converter and should be given every account
* available.
* plugin, as well as their last-known-name. This is used for Vault's economy
* converter and should be given every account available.
*
* @return a {@link Map} composed of the accounts keyed by their UUID, along
* with their associated last-known-name (null or not.)
* with their associated last-known-name.
*/
public Map<UUID, @Nullable String> getUUIDNameMap();
public Map<UUID, String> getUUIDNameMap();

/**
* Gets the last known name of an account owned by the given UUID. Required for
* messages to be more human-readable than UUIDs alone can provide.
*
* @param uuid UUID to look up.
* @return name of the account owner or null.
* @return name of the account owner.
*/
@Nullable
public String getAccountName(UUID uuid);

/**
Expand All @@ -154,6 +150,17 @@ public interface Economy {
*/
public boolean hasAccount(UUID uuid, String worldName);

/**
* A method which changes the name associated with the given UUID in the
* Map<UUID, String> received from {@link #getUUIDNameMap()}.
*
* @param uuid which is having a name change.
* @param name name that will be associated with the UUID in the
* Map<UUID, String> map.
* @return true if the name change is successful.
*/
public boolean renameAccount(UUID uuid, String name);

/**
* Gets balance of a UUID
*
Expand Down

0 comments on commit 7c7d0ab

Please sign in to comment.