Accept Strings as inputs instead of UUIDs.

This leaves options for other plugins to hook into us to use our vault operations. I did a first shot of this with FactionsUUID.
* This needs to be tested more in depth before being pushed to a release version as it changes how we handle a lot of our dupe checks.
This commit is contained in:
Trent Hensler
2016-05-30 16:20:36 -07:00
parent 48206f552f
commit bc9d1091e1
11 changed files with 119 additions and 75 deletions
@@ -55,14 +55,12 @@ public class VaultCommand implements CommandExecutor {
}
break;
case 2:
OfflinePlayer searchPlayer = Bukkit.getOfflinePlayer(args[0]);
if (searchPlayer == null || !searchPlayer.hasPlayedBefore()) {
sender.sendMessage(Lang.TITLE.toString() + Lang.NO_PLAYER_FOUND.toString().replaceAll("%p", args[0]));
if(!player.hasPermission("playervaults.admin")) {
player.sendMessage(Lang.TITLE.toString() + Lang.NO_PERMS.toString());
break;
}
if (VaultOperations.openOtherVault(player, searchPlayer, args[1])) {
PlayerVaults.getInstance().getInVault().put(player.getUniqueId().toString(), new VaultViewInfo(searchPlayer.getUniqueId(), Integer.parseInt(args[1])));
if (VaultOperations.openOtherVault(player, args[0], args[1])) {
PlayerVaults.getInstance().getInVault().put(player.getUniqueId().toString(), new VaultViewInfo(args[0], Integer.parseInt(args[1])));
}
break;
default: