mirror of
https://github.com/filoghost/ChestCommands.git
synced 2024-11-22 18:16:14 +01:00
Close resources
This commit is contained in:
parent
022040c81f
commit
a8be658769
@ -22,6 +22,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
public class UpgradesDoneRegistry {
|
public class UpgradesDoneRegistry {
|
||||||
|
|
||||||
@ -34,9 +35,10 @@ public class UpgradesDoneRegistry {
|
|||||||
this.upgradesDone = new HashSet<>();
|
this.upgradesDone = new HashSet<>();
|
||||||
|
|
||||||
if (Files.isRegularFile(saveFile)) {
|
if (Files.isRegularFile(saveFile)) {
|
||||||
Files.lines(saveFile, StandardCharsets.UTF_8)
|
try (Stream<String> lines = Files.lines(saveFile, StandardCharsets.UTF_8)) {
|
||||||
.filter(s -> !s.startsWith("#"))
|
lines.filter(s -> !s.startsWith("#"))
|
||||||
.forEach(upgradesDone::add);
|
.forEach(upgradesDone::add);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user