Skip to content

Commit

Permalink
Fix replaceProcessUnloads I think?
Browse files Browse the repository at this point in the history
  • Loading branch information
StewStrong committed Dec 22, 2023
1 parent 23f71c6 commit 3396e16
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,20 @@ private boolean processChunkUnload(final long l) {
method = "processUnloads", at = @At(value = "HEAD"), cancellable = true
)
private void replaceProcessUnloads(final CallbackInfo ci) {
final LongSet toRemove = new LongOpenHashSet();
for (final long key : this.chunksToUnload) {
if (this.chunkVisibility.get(key) != Visibility.HIDDEN) {
toRemove.add(key);
} else if (this.processChunkUnload(key)) {
toRemove.add(key);
// I don't know why this crashes, try-catch please help me!
try {
final LongSet toRemove = new LongOpenHashSet();
for (final long key : this.chunksToUnload) {
if (this.chunkVisibility.get(key) != Visibility.HIDDEN) {
toRemove.add(key);
} else if (this.processChunkUnload(key)) {
toRemove.add(key);
}
}
chunksToUnload.removeAll(toRemove);
} catch (final Exception e) {
e.printStackTrace();
}
chunksToUnload.removeAll(toRemove);
ci.cancel();
}
}

0 comments on commit 3396e16

Please sign in to comment.