Preload chunks up to the configured limit, cancel preloading on EditSession complete

This commit is contained in:
dordsor21
2021-08-17 12:07:48 +01:00
parent da7aca8ef8
commit 8c11ba7fea
2 changed files with 9 additions and 1 deletions

View File

@ -19,6 +19,7 @@
package com.sk89q.worldedit;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.FaweCache;
import com.fastasyncworldedit.core.configuration.Caption;
import com.fastasyncworldedit.core.configuration.Settings;
@ -1250,6 +1251,10 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
player.print(Caption.of("fawe.error.lighting"));
e.printStackTrace();
}
// Cancel any preloader associated with the actor if present
if (getPlayer() != null) {
Fawe.imp().getPreloader(false).cancel(getPlayer());
}
// Enqueue it
if (getChangeSet() != null) {
if (Settings.IMP.HISTORY.COMBINE_STAGES) {