From 7c7d0abcc2a89011a5bd44f67088d6446c7cd676 Mon Sep 17 00:00:00 2001 From: Llm Dl Date: Wed, 3 Aug 2022 16:03:48 -0500 Subject: [PATCH] Implement requested changes. - Added renameAccount(UUID, String). - Remove @Nullable annotation and remove repo/dependency from pom.xml. - Fixed typo in javadoc in Economy. --- pom.xml | 11 -------- .../net/milkbowl/vault/economy/Economy.java | 2 +- .../net/milkbowl/vault2/economy/Economy.java | 27 ++++++++++++------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 1739da8..4a0800c 100644 --- a/pom.xml +++ b/pom.xml @@ -44,10 +44,6 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms spigot-repo https://hub.spigotmc.org/nexus/content/groups/public/ - - central - https://repo1.maven.org/maven2 - @@ -65,13 +61,6 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms ${bukkitVersion} provided - - - org.jetbrains - annotations - 23.0.0 - provided - junit diff --git a/src/main/java/net/milkbowl/vault/economy/Economy.java b/src/main/java/net/milkbowl/vault/economy/Economy.java index ceb1668..d37c725 100644 --- a/src/main/java/net/milkbowl/vault/economy/Economy.java +++ b/src/main/java/net/milkbowl/vault/economy/Economy.java @@ -23,7 +23,7 @@ import org.bukkit.OfflinePlayer; /** * 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 { diff --git a/src/main/java/net/milkbowl/vault2/economy/Economy.java b/src/main/java/net/milkbowl/vault2/economy/Economy.java index a79ba93..c60f576 100644 --- a/src/main/java/net/milkbowl/vault2/economy/Economy.java +++ b/src/main/java/net/milkbowl/vault2/economy/Economy.java @@ -20,8 +20,6 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import org.jetbrains.annotations.Nullable; - /** * The main economy API * @@ -29,7 +27,7 @@ import org.jetbrains.annotations.Nullable; public interface Economy { /* - * Economy plugin-related methods follow. + * Economy plugin-related methods follow. */ /** @@ -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 getUUIDNameMap(); + public Map 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); /** @@ -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 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 map. + * @return true if the name change is successful. + */ + public boolean renameAccount(UUID uuid, String name); + /** * Gets balance of a UUID *