Skip to content

Commit 7fa6c45

Browse files
committed
Fix dragging in ModLoader too early
1 parent 2246b79 commit 7fa6c45

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

common/src/main/java/org/embeddedt/modernfix/core/ModernFixMixinPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public ModernFixMixinPlugin() {
4141

4242
if (option.isUserDefined()) {
4343
source = "user configuration";
44-
} else if (!ModernFixPlatformHooks.isLoadingNormally()) {
44+
} else if (!ModernFixPlatformHooks.isEarlyLoadingNormally()) {
4545
source = "load error";
4646
} else if (option.isModDefined()) {
4747
source = "mods [" + String.join(", ", option.getDefiningMods()) + "]";

common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ private ModernFixEarlyConfig(File file) {
245245

246246
private void disableIfModPresent(String configName, String... ids) {
247247
for(String id : ids) {
248-
if(!ModernFixPlatformHooks.isLoadingNormally() || modPresent(id)) {
248+
if(!ModernFixPlatformHooks.isEarlyLoadingNormally() || modPresent(id)) {
249249
Option option = this.options.get(configName);
250250
if(option != null)
251251
option.addModOverride(false, id);

common/src/main/java/org/embeddedt/modernfix/platform/ModernFixPlatformHooks.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ public static MinecraftServer getCurrentServer() {
5757
throw new AssertionError();
5858
}
5959

60+
@ExpectPlatform
61+
public static boolean isEarlyLoadingNormally() {
62+
throw new AssertionError();
63+
}
64+
6065
@ExpectPlatform
6166
public static boolean isLoadingNormally() {
6267
throw new AssertionError();

fabric/src/main/java/org/embeddedt/modernfix/platform/fabric/ModernFixPlatformHooksImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ public static MinecraftServer getCurrentServer() {
5959
return ModernFixFabric.theServer.get();
6060
}
6161

62+
public static boolean isEarlyLoadingNormally() {
63+
return true;
64+
}
65+
6266
public static boolean isLoadingNormally() {
6367
return true;
6468
}

forge/src/main/java/org/embeddedt/modernfix/platform/forge/ModernFixPlatformHooksImpl.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ public static MinecraftServer getCurrentServer() {
8585
return ServerLifecycleHooks.getCurrentServer();
8686
}
8787

88+
public static boolean isEarlyLoadingNormally() {
89+
return LoadingModList.get().getErrors().isEmpty();
90+
}
91+
8892
public static boolean isLoadingNormally() {
89-
if(!LoadingModList.get().getErrors().isEmpty())
90-
return false;
91-
return ModLoader.isLoadingStateValid();
93+
return isEarlyLoadingNormally() && ModLoader.isLoadingStateValid();
9294
}
9395

9496

0 commit comments

Comments
 (0)