Skip to content

Commit 2246b79

Browse files
committed
Fix mod mixins not being disabled if there is an early load error
1 parent 4cdf5e6 commit 2246b79

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public ModernFixMixinPlugin() {
4141

4242
if (option.isUserDefined()) {
4343
source = "user configuration";
44+
} else if (!ModernFixPlatformHooks.isLoadingNormally()) {
45+
source = "load error";
4446
} else if (option.isModDefined()) {
4547
source = "mods [" + String.join(", ", option.getDefiningMods()) + "]";
4648
}

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(modPresent(id)) {
248+
if(!ModernFixPlatformHooks.isLoadingNormally() || 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/dynamicresources/ModelBakeryHelpers.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import net.minecraft.world.level.block.state.properties.Property;
2727
import org.embeddedt.modernfix.ModernFix;
2828
import org.embeddedt.modernfix.api.entrypoint.ModernFixClientIntegration;
29+
import org.embeddedt.modernfix.platform.ModernFixPlatformHooks;
2930

3031
import java.io.IOException;
3132
import java.io.InputStream;
@@ -116,6 +117,8 @@ public static void gatherModelMaterials(ResourceManager manager, Predicate<PackR
116117
Set<ResourceLocation> modelFiles, UnbakedModel missingModel,
117118
Function<JsonElement, BlockModel> modelDeserializer,
118119
Function<ResourceLocation, UnbakedModel> bakeryModelGetter) {
120+
if(!ModernFixPlatformHooks.isLoadingNormally())
121+
return;
119122
Stopwatch stopwatch = Stopwatch.createStarted();
120123
final Object2IntOpenHashMap<String> blockstateErrors = new Object2IntOpenHashMap<>();
121124
/*

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ public static MinecraftServer getCurrentServer() {
8686
}
8787

8888
public static boolean isLoadingNormally() {
89+
if(!LoadingModList.get().getErrors().isEmpty())
90+
return false;
8991
return ModLoader.isLoadingStateValid();
9092
}
9193

0 commit comments

Comments
 (0)