Stop hotloading production worlds

This commit is contained in:
DanLT 2021-09-02 11:59:12 -08:00
parent bac66dfbf9
commit 923a42e9a3

View File

@ -93,7 +93,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
this.dimensionKey = dimensionKey;
this.folder = new ReactiveFolder(dataLocation, (_a, _b, _c) -> hotload());
setupEngine();
this.hotloader = new Looper() {
this.hotloader = studio ? new Looper() {
@Override
protected long loop() {
if (hotloadChecker.flip()) {
@ -102,11 +102,15 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
return 250;
}
};
} : null;
if(studio)
{
hotloader.setPriority(Thread.MIN_PRIORITY);
hotloader.start();
hotloader.setName(getTarget().getWorld().name() + " Hotloader");
}
}
private void setupEngine() {
IrisData data = IrisData.get(dataLocation);
@ -232,7 +236,11 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
@Override
public void close() {
withExclusiveControl(() -> {
if(isStudio())
{
hotloader.interrupt();
}
getEngine().close();
});
}
@ -244,6 +252,11 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
@Override
public void hotload() {
if(!isStudio())
{
return;
}
withExclusiveControl(() -> getEngine().hotload());
}