Reformat.

This commit is contained in:
drtshock
2015-04-27 12:03:11 -05:00
parent d690786803
commit f97ba1e694
12 changed files with 73 additions and 55 deletions
@@ -33,8 +33,8 @@ public class UUIDVaultManager {
* Saves the inventory to the specified player and vault number.
*
* @param inventory The inventory to be saved.
* @param player The player of whose file to save to.
* @param number The vault number.
* @param player The player of whose file to save to.
* @param number The vault number.
*
* @throws java.io.IOException Uh oh!
*/
@@ -132,8 +132,8 @@ public class UUIDVaultManager {
* Get an inventory from file. Returns null if the inventory doesn't exist. SHOULD ONLY BE USED INTERNALLY
*
* @param playerFile the YamlConfiguration file.
* @param size the size of the vault.
* @param number the vault number.
* @param size the size of the vault.
* @param number the vault number.
*
* @return inventory if exists, otherwise null.
*/
@@ -162,7 +162,9 @@ public class UUIDVaultManager {
YamlConfiguration playerFile = getPlayerVaultFile(holder);
List<String> data = playerFile.getStringList("vault" + number);
OfflinePlayer player = Bukkit.getPlayer(holder);
if (player == null) return null;
if (player == null) {
return null;
}
if (data == null) {
VaultHolder vaultHolder = new VaultHolder(number);
Inventory inv = Bukkit.createInventory(vaultHolder, VaultOperations.getMaxVaultSize(player), Lang.VAULT_TITLE.toString().replace("%number", String.valueOf(number)).replace("%p", player.getName()));
@@ -234,7 +236,7 @@ public class UUIDVaultManager {
* Save the players vault file.
*
* @param holder The vault holder of whose file to save.
* @param yaml The config to save.
* @param yaml The config to save.
*
* @throws IOException Uh oh!
*/
@@ -33,8 +33,7 @@ import java.util.List;
/**
* A class for managing actual IO to the files, loading inventories, and saving them.
*/
@Deprecated
public class VaultManager {
@Deprecated public class VaultManager {
public PlayerVaults plugin;
@@ -48,8 +47,8 @@ public class VaultManager {
* Saves the inventory to the specified player and vault number.
*
* @param inventory The inventory to be saved.
* @param player The player of whose file to save to.
* @param number The vault number.
* @param player The player of whose file to save to.
* @param number The vault number.
*
* @throws IOException Uh oh!
*/
@@ -151,8 +150,8 @@ public class VaultManager {
* Get an inventory from file. Returns null if the inventory doesn't exist. SHOULD ONLY BE USED INTERNALLY
*
* @param playerFile the YamlConfiguration file.
* @param size the size of the vault.
* @param number the vault number.
* @param size the size of the vault.
* @param number the vault number.
*
* @return inventory if exists, otherwise null.
*/
@@ -254,7 +253,7 @@ public class VaultManager {
* Save the players vault file.
*
* @param holder The vault holder of whose file to save.
* @param yaml The config to save.
* @param yaml The config to save.
*
* @throws IOException Uh oh!
*/
@@ -42,8 +42,8 @@ public class VaultOperations {
}
/**
* Sets whether or not player vaults are locked. If set to true, this
* will kick anyone who is currently using their vaults out.
* Sets whether or not player vaults are locked. If set to true, this will kick anyone who is currently using their
* vaults out.
*
* @param locked true for locked, false otherwise
*/
@@ -111,7 +111,9 @@ public class VaultOperations {
* @return Whether or not the player was allowed to open it.
*/
public static boolean openOwnVault(Player player, String arg) {
if (isLocked()) return false;
if (isLocked()) {
return false;
}
int number;
try {
number = Integer.parseInt(arg);
@@ -149,7 +151,9 @@ public class VaultOperations {
* @return Whether or not the player was allowed to open it.
*/
public static boolean openOtherVault(Player player, Player holder, String arg) {
if (isLocked()) return false;
if (isLocked()) {
return false;
}
if (player.hasPermission("playervaults.admin")) {
int number = 0;
try {
@@ -181,7 +185,9 @@ public class VaultOperations {
* @param arg The vault number to delete.
*/
public static void deleteOwnVault(Player player, String arg) {
if (isLocked()) return;
if (isLocked()) {
return;
}
if (arg.matches("^[0-9]{1,2}$")) {
int number = 0;
try {
@@ -214,7 +220,9 @@ public class VaultOperations {
* @param arg The vault number to delete.
*/
public static void deleteOtherVault(CommandSender sender, Player holder, String arg) {
if (isLocked()) return;
if (isLocked()) {
return;
}
if (sender.hasPermission("playervaults.delete")) {
if (arg.matches("^[0-9]{1,2}$")) {
int number = 0;