probably fixes #234

This commit is contained in:
CreepyCre 2021-09-06 22:45:23 +02:00
parent 4dc56188a0
commit facd8bd4d8
2 changed files with 2 additions and 1 deletions

View file

@ -49,6 +49,7 @@ public abstract class LazyPocketGenerator extends PocketGenerator {
if (nbt.contains("lazy_modifiers")) {
NbtList modifiersNbt = nbt.getList("lazy_modifiers", 10);
for (int i = 0; i < modifiersNbt.size(); i++) {
// TODO: skip deserialization of single Modifiers on Exception.
lazyModifierList.add((LazyModifier) Modifier.deserialize(modifiersNbt.getCompound(i)));
}
}

View file

@ -76,7 +76,7 @@ public class PocketDirectory {
NbtCompound pocketsNbt = new NbtCompound();
this.pockets.entrySet().parallelStream().unordered().map(entry -> CompletableFuture.supplyAsync(() -> new Pair<>(entry.getKey().toString(), entry.getValue().toNbt(new NbtCompound()))))
.map(CompletableFuture::join).forEach(pair -> pocketsNbt.put(pair.getLeft(), pair.getRight()));
.map(CompletableFuture::join).sequential().forEach(pair -> pocketsNbt.put(pair.getLeft(), pair.getRight()));
nbt.put("pockets", pocketsNbt);
return nbt;