3
0
KCauldronX/patches/cpw/mods/fml/relauncher/CoreModManager.java.patch

86 lines
4.6 KiB
Diff
Raw Normal View History

2015-03-22 17:38:04 +00:00
--- ../src-base/minecraft/cpw/mods/fml/relauncher/CoreModManager.java
+++ ../src-work/minecraft/cpw/mods/fml/relauncher/CoreModManager.java
2015-06-27 12:47:27 +00:00
@@ -60,7 +60,7 @@
private static final Attributes.Name COREMODCONTAINSFMLMOD = new Attributes.Name("FMLCorePluginContainsFMLMod");
private static final Attributes.Name MODTYPE = new Attributes.Name("ModType");
private static final Attributes.Name MODSIDE = new Attributes.Name("ModSide");
- private static String[] rootPlugins = { "cpw.mods.fml.relauncher.FMLCorePlugin", "net.minecraftforge.classloading.FMLForgePlugin" };
+ private static String[] rootPlugins = { "cpw.mods.fml.relauncher.FMLCorePlugin", "net.minecraftforge.classloading.FMLForgePlugin", "pw.prok.imagine.ImagineLoadingPlugin" };
private static List<String> loadedCoremods = Lists.newArrayList();
private static List<FMLPluginWrapper> loadPlugins;
private static boolean deobfuscatedEnvironment;
2015-06-27 12:47:27 +00:00
@@ -101,6 +101,7 @@
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
2015-06-01 14:32:10 +00:00
+ // Cauldron end
FMLRelaunchLog.fine("Injecting coremod %s {%s} class transformers", name, coreModInstance.getClass().getName());
if (coreModInstance.getASMTransformerClass() != null) for (String transformer : coreModInstance.getASMTransformerClass())
{
2015-06-27 12:47:27 +00:00
@@ -160,6 +161,9 @@
2015-03-22 17:38:04 +00:00
}
+ // Cauldron - group output of @MCVersion warnings
+ private static List<String> noVersionAnnotationCoreMods = new ArrayList<String>();
+
public static void handleLaunch(File mcDir, LaunchClassLoader classLoader, FMLTweaker tweaker)
{
CoreModManager.mcDir = mcDir;
2015-06-27 12:47:27 +00:00
@@ -219,6 +223,19 @@
2015-03-22 17:38:04 +00:00
loadCoreMod(classLoader, coreModClassName, null);
}
discoverCoreMods(mcDir, classLoader);
+ // Cauldron start - group output of @MCVersion warnings
+ if (!noVersionAnnotationCoreMods.isEmpty())
+ {
+ FMLRelaunchLog
+ .warning("The following coremods do not have a @MCVersion annotation. They may cause problems if this is not the correct version of Minecraft for them.");
+ StringBuilder sb = new StringBuilder("Missing @MCVersion: ");
+ for (String className : noVersionAnnotationCoreMods)
+ {
+ sb.append(className).append(" ");
+ }
+ FMLRelaunchLog.warning(sb.toString());
+ }
+ // Cauldron end
2015-04-14 10:49:32 +00:00
2015-03-22 17:38:04 +00:00
}
2015-06-27 12:47:27 +00:00
@@ -336,6 +353,10 @@
2015-05-29 10:24:31 +00:00
String cascadedTweaker = mfAttributes.getValue("TweakClass");
if (cascadedTweaker != null)
{
2015-06-01 14:32:10 +00:00
+ if ("fastcraft.Tweaker".equals(cascadedTweaker) && !"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) {
2015-06-08 16:18:24 +00:00
+ FMLRelaunchLog.info("Found FastCraft tweaker, skipping...");
+ continue;
2015-06-01 14:32:10 +00:00
+ }
2015-05-29 10:24:31 +00:00
FMLRelaunchLog.info("Loading tweaker %s from %s", cascadedTweaker, coreMod.getName());
Integer sortOrder = Ints.tryParse(Strings.nullToEmpty(mfAttributes.getValue("TweakOrder")));
sortOrder = (sortOrder == null ? Integer.valueOf(0) : sortOrder);
2015-06-27 12:47:27 +00:00
@@ -365,6 +386,10 @@
FMLRelaunchLog.fine("Not found coremod data in %s", coreMod.getName());
continue;
}
2015-05-29 10:24:31 +00:00
+ if ("fastcraft.LoadingPlugin".equals(fmlCorePlugin) && !"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) {
+ FMLRelaunchLog.warning("Found FastCraft coremod, skipping...");
2015-06-01 14:32:10 +00:00
+ continue;
+ }
// Support things that are mod jars, but not FML mod jars
try
{
2015-06-27 12:47:27 +00:00
@@ -467,8 +492,11 @@
2015-03-22 17:38:04 +00:00
MCVersion requiredMCVersion = coreModClazz.getAnnotation(IFMLLoadingPlugin.MCVersion.class);
if (!Arrays.asList(rootPlugins).contains(coreModClass) && (requiredMCVersion == null || Strings.isNullOrEmpty(requiredMCVersion.value())))
{
- FMLRelaunchLog.log(Level.WARN, "The coremod %s does not have a MCVersion annotation, it may cause issues with this version of Minecraft",
- coreModClass);
+ // Cauldron start - group output of @MCVersion warnings
+ // FMLRelaunchLog.log(Level.WARN, "The coremod %s does not have a MCVersion annotation, it may cause issues with this version of Minecraft",
+ // coreModClass);
+ noVersionAnnotationCoreMods.add(coreModClass);
+ // Cauldron end
}
else if (requiredMCVersion != null && !FMLInjectionData.mccversion.equals(requiredMCVersion.value()))
{