This commit is contained in:
MistPhizzle 2014-07-19 20:18:14 -04:00
parent 6e4705d0bc
commit 4ef2e12287

View file

@ -124,6 +124,7 @@ public class Methods {
public static boolean isBender(String player, Element element) {
BendingPlayer bPlayer = getBendingPlayer(player);
if (bPlayer == null) return false;
if (bPlayer.hasElement(element)) return true;
return false;
}
@ -270,34 +271,32 @@ public class Methods {
public static void deserializeFile() {
File readFile = new File(".", "bendingPlayers.yml");
File writeFile = new File(".", "converted.yml");
if (readFile.exists()) {
// plugin.log.info("File exists");
try {
DataInputStream input = new DataInputStream(new FileInputStream(readFile));
BufferedReader reader = new BufferedReader(new InputStreamReader(input));
File writeFile = new File(".", "converted.yml");
if (readFile.exists()) {
// plugin.log.info("File exists");
try {
DataInputStream input = new DataInputStream(new FileInputStream(readFile));
BufferedReader reader = new BufferedReader(new InputStreamReader(input));
DataOutputStream output = new DataOutputStream(new FileOutputStream(writeFile));
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output));
String line;
while ((line = reader.readLine()) != null) {
if (!line.trim().contains("==: BendingPlayer")) {
writer.write(line + "\n");
}
}
DataOutputStream output = new DataOutputStream(new FileOutputStream(writeFile));
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output));
String line;
while ((line = reader.readLine()) != null) {
if (!line.trim().contains("==: BendingPlayer")) {
writer.write(line + "\n");
}
}
reader.close();
input.close();
writer.close();
output.close();
} catch (IOException e) {
e.printStackTrace();
}
}
reader.close();
input.close();
writer.close();
output.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public static void stopBending() {
List<AbilityModule> abilities = AbilityModuleManager.ability;
for (AbilityModule ab: abilities) {