Skip to content

Commit c125ef8

Browse files
kevinthegreat1lineargraph
authored andcommitted
Make NEUItems reload atomic
1 parent 9315976 commit c125ef8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/io/github/moulberry/repo/NEUItems.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class NEUItems implements IReloadable {
1818

1919
@Override
2020
public void reload(NEURepository repository) throws NEURepositoryException {
21-
items = new HashMap<>();
21+
Map<String, NEUItem> items = new HashMap<>();
2222
try (Stream<NEURepoFile> itemSources = repository.tree("items")
2323
.filter(NEURepoFile::isFile)
2424
.filter(it -> it.getFsPath().getFileName().toString().toLowerCase(Locale.ROOT).endsWith(".json"))) {
@@ -27,6 +27,7 @@ public void reload(NEURepository repository) throws NEURepositoryException {
2727
items.put(item.getSkyblockItemId(), item);
2828
}
2929
}
30+
this.items = items;
3031
}
3132

3233
@Nullable

0 commit comments

Comments
 (0)