Rework operations to allow for owners of vaults to be Strings, which is more friendly to third party or group vaults. Fixes compatibility with FactionsUUID.

This commit is contained in:
Trent Hensler
2018-12-16 22:13:13 -08:00
parent 55cbea8582
commit 181bb89ac0
17 changed files with 121 additions and 124 deletions
@@ -74,7 +74,7 @@ public class UUIDVaultManager {
}
String title = Lang.VAULT_TITLE.toString().replace("%number", String.valueOf(number)).replace("%p", player.getName());
VaultViewInfo info = new VaultViewInfo(player.getUniqueId(), number);
VaultViewInfo info = new VaultViewInfo(player.getUniqueId().toString(), number);
Inventory inv;
if (PlayerVaults.getInstance().getOpenInventories().containsKey(info.toString())) {
inv = PlayerVaults.getInstance().getOpenInventories().get(info.toString());
@@ -162,7 +162,7 @@ public class UUIDVaultManager {
public Inventory getVault(UUID holder, int number) {
YamlConfiguration playerFile = getPlayerVaultFile(holder);
ConfigurationSection section = playerFile.getConfigurationSection("vault" + number);
int maxSize = VaultOperations.getMaxVaultSize(holder);
int maxSize = VaultOperations.getMaxVaultSize(holder.toString());
String title = Lang.VAULT_TITLE.toString().replace("%number", String.valueOf(number));
@@ -238,6 +238,7 @@ public class UUIDVaultManager {
}
}
String uuid = sender instanceof Player ? ((Player)sender).getUniqueId().toString() : holder;
PlayerVaults.getInstance().getOpenInventories().remove(new VaultViewInfo(holder, number).toString());
}