Revert "Apparently needed to reformat."
This reverts commit 101098ae7b.
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
package com.drtshock.playervaults.vaultmanagement;
|
||||
|
||||
import com.drtshock.playervaults.PlayerVaults;
|
||||
import com.drtshock.playervaults.util.Lang;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -10,11 +15,8 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import com.drtshock.playervaults.PlayerVaults;
|
||||
import com.drtshock.playervaults.util.Lang;
|
||||
|
||||
/**
|
||||
* Class to handle vault operations with new UUIDs.
|
||||
@@ -31,7 +33,7 @@ public class UUIDVaultManager {
|
||||
|
||||
private final File directory = PlayerVaults.getInstance().getVaultData();
|
||||
|
||||
public CachedVaults getCachedVaults() {
|
||||
public CachedVaults getCachedVaults(){
|
||||
return cachedVaults;
|
||||
}
|
||||
|
||||
@@ -71,7 +73,7 @@ public class UUIDVaultManager {
|
||||
* @param number The vault number.
|
||||
*/
|
||||
public Inventory loadOwnVault(Player player, int number, int size) {
|
||||
if (cachedVaults.hasVaultCached(player.getUniqueId(), number)) {
|
||||
if(cachedVaults.hasVaultCached(player.getUniqueId(), number)){
|
||||
return cachedVaults.getCachedVault(player.getUniqueId(), number);
|
||||
}
|
||||
|
||||
@@ -117,7 +119,7 @@ public class UUIDVaultManager {
|
||||
* @param number The vault number.
|
||||
*/
|
||||
public Inventory loadOtherVault(UUID holder, int number, int size) {
|
||||
if (cachedVaults.hasVaultCached(holder, number)) {
|
||||
if(cachedVaults.hasVaultCached(holder, number)){
|
||||
return cachedVaults.getCachedVault(holder, number);
|
||||
}
|
||||
|
||||
@@ -143,7 +145,7 @@ public class UUIDVaultManager {
|
||||
}
|
||||
PlayerVaults.getInstance().getOpenInventories().put(info.toString(), inv);
|
||||
}
|
||||
|
||||
|
||||
cachedVaults.setCachedVault(holder, number, inv);
|
||||
return inv;
|
||||
}
|
||||
@@ -210,11 +212,11 @@ public class UUIDVaultManager {
|
||||
* @throws IOException Uh oh!
|
||||
*/
|
||||
public void deleteVault(CommandSender sender, UUID holder, int number) throws IOException {
|
||||
File file = new File(directory, holder.toString() + ".yml");
|
||||
File file = new File(directory, holder.toString() + ".yml");
|
||||
if (!file.exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
cachedVaults.clearVaultCache(holder);
|
||||
|
||||
FileConfiguration playerFile = YamlConfiguration.loadConfiguration(file);
|
||||
|
||||
Reference in New Issue
Block a user