1.7 compatibility

This commit is contained in:
DNx5 2015-10-23 00:23:12 +07:00
parent beb46ebf6f
commit a2381fa025

View File

@ -108,8 +108,8 @@ public class DataManager {
continue;
}
try {
File playerFile = new File(plugin.getServer().getWorldContainer() + File.separator + Settings.defaultWorld + File.separator + "players" + File.separator + player.getUniqueId() + ".dat");
try {
File playerFile = new File(plugin.getServer().getWorldContainer() + File.separator + Settings.defaultWorld + File.separator + "players" + File.separator + player.getUniqueId() + ".dat");
playerFile.delete();
i++;
} catch(Exception ignore) {
@ -129,12 +129,12 @@ public class DataManager {
public void purgeEssentials(List<String> cleared) {
int i = 0;
for (String name : cleared) {
try {
try {
File playerFile = new File(plugin.ess.getDataFolder() + File.separator + "userdata" + File.separator + plugin.getServer().getOfflinePlayer(name).getUniqueId() + ".yml");
playerFile.delete();
i++;
} catch (Exception e) {
File playerFile = new File(plugin.ess.getDataFolder() + File.separator + "userdata" + File.separator + name + ".yml");
File playerFile = new File(plugin.ess.getDataFolder() + File.separator + "userdata" + File.separator + name + ".yml");
if (playerFile.exists()) {
playerFile.delete();
i++;
@ -186,7 +186,7 @@ public class DataManager {
public Player getOnlinePlayerLower(String name) {
name = name.toLowerCase();
for (Player player : Bukkit.getOnlinePlayers()) {
for (Player player : Utils.getOnlinePlayers()) {
if (player.getName().equalsIgnoreCase(name))
return player;
}