Fix BackgroundScanHandler crashing on servers (#6660)

This commit is contained in:
Take Weiland 2020-04-27 20:06:34 +02:00 committed by GitHub
parent 940f3ed731
commit 903a400132
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -291,7 +291,7 @@ public class ModLoader
Bootstrap.register(); Bootstrap.register();
dataGeneratorConfig = new GatherDataEvent.DataGeneratorConfig(mods, path, inputs, serverGenerators, clientGenerators, devToolGenerators, reportsGenerator, structureValidator); dataGeneratorConfig = new GatherDataEvent.DataGeneratorConfig(mods, path, inputs, serverGenerators, clientGenerators, devToolGenerators, reportsGenerator, structureValidator);
existingFileHelper = new ExistingFileHelper(existingPacks, structureValidator); existingFileHelper = new ExistingFileHelper(existingPacks, structureValidator);
gatherAndInitializeMods(null); gatherAndInitializeMods(() -> {});
dispatchAndHandleError(LifecycleEventProvider.GATHERDATA, Runnable::run, null); dispatchAndHandleError(LifecycleEventProvider.GATHERDATA, Runnable::run, null);
dataGeneratorConfig.runAll(); dataGeneratorConfig.runAll();
} }

View file

@ -42,7 +42,7 @@ public class ServerModLoader
LogicalSidedProvider.setServer(()->dedicatedServer); LogicalSidedProvider.setServer(()->dedicatedServer);
LanguageHook.loadForgeAndMCLangs(); LanguageHook.loadForgeAndMCLangs();
try { try {
ModLoader.get().gatherAndInitializeMods(null); ModLoader.get().gatherAndInitializeMods(() -> {});
ModLoader.get().loadMods(Runnable::run, (a)->{}, (a)->{}); ModLoader.get().loadMods(Runnable::run, (a)->{}, (a)->{});
} catch (LoadingFailedException e) { } catch (LoadingFailedException e) {
ServerModLoader.hasErrors = true; ServerModLoader.hasErrors = true;