Merge pull request #4152 from FlXME/master

Fix various bugs
This commit is contained in:
Robert Alan Chapton 2020-05-01 14:29:35 -07:00 committed by GitHub
commit 53c5fb7328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View File

@ -54,15 +54,15 @@ public class WorldBlacklist {
if(!blacklist.contains(currentLine))
blacklist.add(currentLine);
}
//Close readers
bufferedReader.close();
fileReader.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e)
{
e.printStackTrace();
} finally {
//Close readers
if(bufferedReader != null) bufferedReader.close();
if(fileReader != null) fileReader.close();
}
plugin.getLogger().info(blacklist.size()+" entries in mcMMO World Blacklist");

View File

@ -346,7 +346,7 @@ public class HashChunkletManager implements ChunkletManager {
try {
fileIn = new FileInputStream(location);
objIn = new ObjectInputStream(fileIn);
objIn = new ObjectInputStream(new BufferedInputStream(fileIn));
storeIn = (ChunkletStore) objIn.readObject();
}
catch (IOException ex) {

View File

@ -75,7 +75,7 @@ public class BlockStoreConversionMain implements Runnable {
public void softStop() {
stop();
if (this.dataDir.exists() || this.dataDir.isDirectory()) {
if (this.dataDir.exists() && this.dataDir.isDirectory()) {
start();
return;
}

View File

@ -49,7 +49,9 @@ public class UUIDFetcher implements Callable<Map<String, UUID>> {
String body = array.toString();
writeBody(connection, body);
JsonObject[] jsonStreamArray = gson.fromJson(new InputStreamReader(connection.getInputStream()), JsonObject[].class);
InputStreamReader tempStream = new InputStreamReader(connection.getInputStream());
JsonObject[] jsonStreamArray = gson.fromJson(tempStream, JsonObject[].class);
tempStream.close();
for (JsonObject jsonProfile : jsonStreamArray) {
String id = jsonProfile.get("id").getAsString();