Skip to content

Commit

Permalink
Ignore existing level.dat files to prevent memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mircokroon committed Jul 8, 2020
1 parent d5f0d7e commit 031c4f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/game/data/WorldManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ private static void saveLevelData() throws IOException {
File levelDat = Paths.get(Game.getExportDirectory(), "level.dat").toFile();

// if there is no level.dat yet, make one from the default
// TODO: fix memory leak caused by duplicates in the NBT tags
InputStream fileInput;
if (levelDat.isFile()) {
if (false && levelDat.isFile()) {
fileInput = new FileInputStream(levelDat);
} else {
fileInput = WorldManager.class.getClassLoader().getResourceAsStream("level.dat");
Expand Down

0 comments on commit 031c4f5

Please sign in to comment.