Merge 1.16 into 1.18

This commit is contained in:
embeddedt 2023-07-23 19:23:25 -04:00
commit 000e9746ba
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
5 changed files with 16 additions and 5 deletions

View File

@ -41,7 +41,7 @@ public class ModernFixMixinPlugin implements IMixinConfigPlugin {
if (option.isUserDefined()) { if (option.isUserDefined()) {
source = "user configuration"; source = "user configuration";
} else if (!ModernFixPlatformHooks.isLoadingNormally()) { } else if (!ModernFixPlatformHooks.isEarlyLoadingNormally()) {
source = "load error"; source = "load error";
} else if (option.isModDefined()) { } else if (option.isModDefined()) {
source = "mods [" + String.join(", ", option.getDefiningMods()) + "]"; source = "mods [" + String.join(", ", option.getDefiningMods()) + "]";

View File

@ -242,7 +242,7 @@ public class ModernFixEarlyConfig {
private void disableIfModPresent(String configName, String... ids) { private void disableIfModPresent(String configName, String... ids) {
for(String id : ids) { for(String id : ids) {
if(!ModernFixPlatformHooks.isLoadingNormally() || modPresent(id)) { if(!ModernFixPlatformHooks.isEarlyLoadingNormally() || modPresent(id)) {
Option option = this.options.get(configName); Option option = this.options.get(configName);
if(option != null) if(option != null)
option.addModOverride(false, id); option.addModOverride(false, id);

View File

@ -57,6 +57,11 @@ public class ModernFixPlatformHooks {
throw new AssertionError(); throw new AssertionError();
} }
@ExpectPlatform
public static boolean isEarlyLoadingNormally() {
throw new AssertionError();
}
@ExpectPlatform @ExpectPlatform
public static boolean isLoadingNormally() { public static boolean isLoadingNormally() {
throw new AssertionError(); throw new AssertionError();

View File

@ -59,6 +59,10 @@ public class ModernFixPlatformHooksImpl {
return ModernFixFabric.theServer.get(); return ModernFixFabric.theServer.get();
} }
public static boolean isEarlyLoadingNormally() {
return true;
}
public static boolean isLoadingNormally() { public static boolean isLoadingNormally() {
return true; return true;
} }

View File

@ -71,10 +71,12 @@ public class ModernFixPlatformHooksImpl {
return ServerLifecycleHooks.getCurrentServer(); return ServerLifecycleHooks.getCurrentServer();
} }
public static boolean isEarlyLoadingNormally() {
return LoadingModList.get().getErrors().isEmpty();
}
public static boolean isLoadingNormally() { public static boolean isLoadingNormally() {
if(!LoadingModList.get().getErrors().isEmpty()) return isEarlyLoadingNormally() && ModLoader.isLoadingStateValid();
return false;
return ModLoader.isLoadingStateValid();
} }