mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 18:45:09 +00:00
Add UI for warnings that occurred during loading (#5530)
This commit is contained in:
1 parent
7113f4400c
commit
00845d5252
8 files changed
+192
-31
No files matched your search
@@ -19,6 +19,7 @@
|
||||
|
||||
package net.minecraftforge.fml;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import cpw.mods.modlauncher.TransformingClassLoader;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
@@ -40,6 +41,7 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
@@ -93,6 +95,7 @@ public class ModLoader
|
||||
private final LoadingModList loadingModList;
|
||||
|
||||
private final List<ModLoadingException> loadingExceptions;
|
||||
private final List<ModLoadingWarning> loadingWarnings;
|
||||
private ModLoader()
|
||||
{
|
||||
INSTANCE = this;
|
||||
@@ -100,6 +103,8 @@ public class ModLoader
|
||||
this.loadingModList = FMLLoader.getLoadingModList();
|
||||
this.loadingExceptions = FMLLoader.getLoadingModList().
|
||||
getErrors().stream().flatMap(ModLoadingException::fromEarlyException).collect(Collectors.toList());
|
||||
this.loadingWarnings = FMLLoader.getLoadingModList().
|
||||
getBrokenFiles().stream().map(file -> new ModLoadingWarning(null, ModLoadingStage.VALIDATE, "fml.modloading.brokenfile", file.getFileName())).collect(Collectors.toList());
|
||||
LOGGER.info(CORE, "Loading Network data for FML net version: {}", FMLNetworkConstants.NETVERSION);
|
||||
}
|
||||
|
||||
@@ -179,7 +184,6 @@ public class ModLoader
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void finishMods()
|
||||
{
|
||||
dispatchAndHandleError(LifecycleEventProvider.ENQUEUE_IMC);
|
||||
@@ -188,4 +192,13 @@ public class ModLoader
|
||||
GameData.freezeData();
|
||||
}
|
||||
|
||||
public List<ModLoadingWarning> getWarnings()
|
||||
{
|
||||
return ImmutableList.copyOf(this.loadingWarnings);
|
||||
}
|
||||
|
||||
public void addWarning(ModLoadingWarning warning)
|
||||
{
|
||||
this.loadingWarnings.add(warning);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user