mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Add basic preloading (#1221)
This commit is contained in:
@ -58,6 +58,7 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
private boolean listeningImages;
|
||||
private final boolean chunksStretched;
|
||||
private final FAWEPlatformAdapterImpl platformAdapter;
|
||||
private Preloader preloader;
|
||||
|
||||
public FaweBukkit(Plugin plugin) {
|
||||
this.plugin = plugin;
|
||||
@ -277,9 +278,12 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Preloader getPreloader() {
|
||||
public Preloader getPreloader(boolean initialise) {
|
||||
if (PaperLib.isPaper()) {
|
||||
return new AsyncPreloader();
|
||||
if (preloader == null && initialise) {
|
||||
return preloader = new AsyncPreloader();
|
||||
}
|
||||
return preloader;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ public class FaweDelegateRegionManager {
|
||||
.autoQueue(false)
|
||||
.build();
|
||||
FlatRegionFunction replace = new BiomeReplace(editSession, biome);
|
||||
FlatRegionVisitor visitor = new FlatRegionVisitor(region, replace);
|
||||
FlatRegionVisitor visitor = new FlatRegionVisitor(region, replace, editSession);
|
||||
try {
|
||||
Operations.completeLegacy(visitor);
|
||||
editSession.flushQueue();
|
||||
|
@ -353,7 +353,7 @@ public class BukkitWorld extends AbstractWorld {
|
||||
int Z = pt.getBlockZ() >> 4;
|
||||
if (Fawe.isMainThread()) {
|
||||
world.getChunkAt(X, Z);
|
||||
} else {
|
||||
} else if (PaperLib.isPaper()) {
|
||||
PaperLib.getChunkAtAsync(world, X, Z, true);
|
||||
}
|
||||
//FAWE end
|
||||
|
Reference in New Issue
Block a user