Fix opening of other player's vaults. Resolves #190.

This commit is contained in:
Trent Hensler
2016-06-14 14:08:25 -05:00
parent 472ff03b2c
commit edc6b0f8ae
3 changed files with 30 additions and 9 deletions
@@ -187,7 +187,20 @@ public class UUIDVaultManager {
}
}
/**
* Checks if a vault exists.
*
* @param holder holder of the vault.
* @param number vault number.
*
* @return true if the vault file and vault number exist in that file, otherwise false.
*/
public boolean vaultExists(String holder, int number) {
File file = new File(directory, holder + ".yml");
if (!file.exists()) {
return false;
}
return getPlayerVaultFile(holder).contains("vault" + number);
}