Fix compile issue

This commit is contained in:
nossr50 2020-05-01 14:38:58 -07:00
parent 7615ff472d
commit 7114ff02e5

View File

@ -40,9 +40,11 @@ public class WorldBlacklist {
}
private void loadBlacklist(File blackListFile) {
FileReader fileReader = null;
BufferedReader bufferedReader = null;
try {
FileReader fileReader = new FileReader(blackListFile);
BufferedReader bufferedReader = new BufferedReader(fileReader);
fileReader = new FileReader(blackListFile);
bufferedReader = new BufferedReader(fileReader);
String currentLine;
@ -54,20 +56,29 @@ public class WorldBlacklist {
if(!blacklist.contains(currentLine))
blacklist.add(currentLine);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e)
{
} catch (IOException e) {
e.printStackTrace();
} finally {
//Close readers
if(bufferedReader != null) bufferedReader.close();
if(fileReader != null) fileReader.close();
closeRead(bufferedReader);
closeRead(fileReader);
}
plugin.getLogger().info(blacklist.size()+" entries in mcMMO World Blacklist");
}
private void closeRead(Reader reader) {
if(reader != null) {
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public static boolean isWorldBlacklisted(World world)
{