mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-30 01:34:04 +00:00
Skip hotloads while a touched pack JSON does not parse
A bad save still hotloaded: the loaders return null for unparseable files, so the pack lost those biomes or regions. The new PackHotloadGuard keeps files that fail to parse until they parse, skips the hotload, logs it and sends a failed studio hotload message. Both the Bukkit generator and the modded studio hotload service gate on it, and the callback returns normally so the watcher does not retry. v3: fe825040a
This commit is contained in:
1 parent
5efffcd0b2
commit
0b5aa54df7
6 files changed
+304
-3
No files matched your search
+9
-2
@@ -22,6 +22,7 @@ import art.arcane.iris.modded.ModdedIrisLog;
|
||||
import art.arcane.iris.core.gui.PregeneratorJob;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.project.PackHotloadFolder;
|
||||
import art.arcane.iris.core.project.PackHotloadGuard;
|
||||
import art.arcane.iris.core.tools.WorldMaintenance;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.EnginePlatformHooks;
|
||||
@@ -262,9 +263,15 @@ public final class ModdedStudioHotloadService implements ModdedTickableService,
|
||||
if (watch.engine != engine) {
|
||||
watch.close();
|
||||
watch.engine = engine;
|
||||
File packFolder = engine.getData().getDataFolder();
|
||||
PackHotloadGuard hotloadGuard = new PackHotloadGuard(packFolder);
|
||||
watch.folder = PackHotloadFolder.watch(
|
||||
engine.getData().getDataFolder(),
|
||||
(KList<File> created, KList<File> changed, KList<File> deleted) -> hotload(dimensionId, generator, engine));
|
||||
packFolder,
|
||||
(KList<File> created, KList<File> changed, KList<File> deleted) -> {
|
||||
if (hotloadGuard.allowsHotload(PackHotloadGuard.touched(created, changed))) {
|
||||
hotload(dimensionId, generator, engine);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
ReactiveFolder folder = watch.folder;
|
||||
|
||||
Reference in new issue
Block a user