mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Cleaning up some derpy names
This commit is contained in:
1 parent
8c5038c301
commit
c5a980f8a4
4 files changed
+16
-52
No files matched your search
@@ -44,7 +44,7 @@ public class TracingPrintStream extends PrintStream {
|
||||
if (elem.getClassName().startsWith("kotlin.io.")) {
|
||||
elem = elems[BASE_DEPTH + 2]; // Kotlins IoPackage masks origins 2 deeper in the stack.
|
||||
} else if (elem.getClassName().startsWith("java.lang.Throwable")) {
|
||||
elem = elems[BASE_DEPTH + 1];
|
||||
elem = elems[BASE_DEPTH + 2];
|
||||
}
|
||||
return "[" + elem.getClassName() + ":" + elem.getMethodName() + ":" + elem.getLineNumber() + "]: ";
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import net.minecraftforge.fml.common.ModClassLoader;
|
||||
import net.minecraftforge.fml.common.ModContainer;
|
||||
import net.minecraftforge.fml.relauncher.CoreModManager;
|
||||
import net.minecraftforge.fml.relauncher.FileListHelper;
|
||||
import net.minecraftforge.fml.relauncher.ModListHelper;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
@@ -48,7 +47,7 @@ public class ModDiscoverer
|
||||
// skip default libs
|
||||
.addAll(modClassLoader.getDefaultLibraries())
|
||||
// skip loaded coremods
|
||||
.addAll(CoreModManager.getLoadedCoremods())
|
||||
.addAll(CoreModManager.getIgnoredMods())
|
||||
// skip reparse coremods here
|
||||
.addAll(CoreModManager.getReparseableCoremods())
|
||||
.build();
|
||||
@@ -98,7 +97,7 @@ public class ModDiscoverer
|
||||
for (File modFile : modList)
|
||||
{
|
||||
// skip loaded coremods
|
||||
if (CoreModManager.getLoadedCoremods().contains(modFile.getName()))
|
||||
if (CoreModManager.getIgnoredMods().contains(modFile.getName()))
|
||||
{
|
||||
FMLLog.finer("Skipping already parsed coremod or tweaker %s", modFile.getName());
|
||||
}
|
||||
|
||||
@@ -34,12 +34,10 @@ import java.util.jar.JarFile;
|
||||
import net.minecraft.launchwrapper.ITweaker;
|
||||
import net.minecraft.launchwrapper.Launch;
|
||||
import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.asm.ASMTransformerWrapper;
|
||||
import net.minecraftforge.fml.common.asm.transformers.ModAccessTransformer;
|
||||
import net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker;
|
||||
import net.minecraftforge.fml.common.launcher.FMLTweaker;
|
||||
import net.minecraftforge.fml.common.toposort.TopologicalSort;
|
||||
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.DependsOn;
|
||||
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.MCVersion;
|
||||
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.Name;
|
||||
@@ -62,13 +60,13 @@ public class CoreModManager {
|
||||
private static final Attributes.Name MODTYPE = new Attributes.Name("ModType");
|
||||
private static final Attributes.Name MODSIDE = new Attributes.Name("ModSide");
|
||||
private static String[] rootPlugins = { "net.minecraftforge.fml.relauncher.FMLCorePlugin", "net.minecraftforge.classloading.FMLForgePlugin" };
|
||||
private static List<String> loadedCoremods = Lists.newArrayList();
|
||||
private static List<String> ignoredModFiles = Lists.newArrayList();
|
||||
private static Map<String, List<String>> transformers = Maps.newHashMap();
|
||||
private static List<FMLPluginWrapper> loadPlugins;
|
||||
private static boolean deobfuscatedEnvironment;
|
||||
private static FMLTweaker tweaker;
|
||||
private static File mcDir;
|
||||
private static List<String> reparsedCoremods = Lists.newArrayList();
|
||||
private static List<String> candidateModFiles = Lists.newArrayList();
|
||||
private static List<String> accessTransformers = Lists.newArrayList();
|
||||
private static Set<String> rootNames = Sets.newHashSet();
|
||||
|
||||
@@ -196,6 +194,7 @@ public class CoreModManager {
|
||||
}
|
||||
catch (IOException e1)
|
||||
{
|
||||
// NOOP
|
||||
}
|
||||
|
||||
if (!deobfuscatedEnvironment)
|
||||
@@ -360,7 +359,7 @@ public class CoreModManager {
|
||||
Integer sortOrder = Ints.tryParse(Strings.nullToEmpty(mfAttributes.getValue("TweakOrder")));
|
||||
sortOrder = (sortOrder == null ? Integer.valueOf(0) : sortOrder);
|
||||
handleCascadingTweak(coreMod, jar, cascadedTweaker, classLoader, sortOrder);
|
||||
loadedCoremods.add(coreMod.getName());
|
||||
ignoredModFiles.add(coreMod.getName());
|
||||
continue;
|
||||
}
|
||||
List<String> modTypes = mfAttributes.containsKey(MODTYPE) ? Arrays.asList(mfAttributes.getValue(MODTYPE).split(",")) : ImmutableList.of("FML");
|
||||
@@ -368,14 +367,14 @@ public class CoreModManager {
|
||||
if (!modTypes.contains("FML"))
|
||||
{
|
||||
FMLRelaunchLog.fine("Adding %s to the list of things to skip. It is not an FML mod, it has types %s", coreMod.getName(), modTypes);
|
||||
loadedCoremods.add(coreMod.getName());
|
||||
ignoredModFiles.add(coreMod.getName());
|
||||
continue;
|
||||
}
|
||||
String modSide = mfAttributes.containsKey(MODSIDE) ? mfAttributes.getValue(MODSIDE) : "BOTH";
|
||||
if (! ("BOTH".equals(modSide) || FMLLaunchHandler.side.name().equals(modSide)))
|
||||
{
|
||||
FMLRelaunchLog.fine("Mod %s has ModSide meta-inf value %s, and we're %s. It will be ignored", coreMod.getName(), modSide, FMLLaunchHandler.side.name());
|
||||
loadedCoremods.add(coreMod.getName());
|
||||
ignoredModFiles.add(coreMod.getName());
|
||||
continue;
|
||||
}
|
||||
String fmlCorePlugin = mfAttributes.getValue("FMLCorePlugin");
|
||||
@@ -392,13 +391,13 @@ public class CoreModManager {
|
||||
if (!mfAttributes.containsKey(COREMODCONTAINSFMLMOD))
|
||||
{
|
||||
FMLRelaunchLog.finer("Adding %s to the list of known coremods, it will not be examined again", coreMod.getName());
|
||||
loadedCoremods.add(coreMod.getName());
|
||||
ignoredModFiles.add(coreMod.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLRelaunchLog.finer("Found FMLCorePluginContainsFMLMod marker in %s, it will be examined later for regular @Mod instances",
|
||||
coreMod.getName());
|
||||
reparsedCoremods.add(coreMod.getName());
|
||||
candidateModFiles.add(coreMod.getName());
|
||||
}
|
||||
}
|
||||
catch (MalformedURLException e)
|
||||
@@ -460,9 +459,9 @@ public class CoreModManager {
|
||||
return coreModDir;
|
||||
}
|
||||
|
||||
public static List<String> getLoadedCoremods()
|
||||
public static List<String> getIgnoredMods()
|
||||
{
|
||||
return loadedCoremods;
|
||||
return ignoredModFiles;
|
||||
}
|
||||
|
||||
public static Map<String, List<String>> getTransformers()
|
||||
@@ -472,7 +471,7 @@ public class CoreModManager {
|
||||
|
||||
public static List<String> getReparseableCoremods()
|
||||
{
|
||||
return reparsedCoremods;
|
||||
return candidateModFiles;
|
||||
}
|
||||
|
||||
private static FMLPluginWrapper loadCoreMod(LaunchClassLoader classLoader, String coreModClass, File location)
|
||||
@@ -557,40 +556,6 @@ public class CoreModManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void sortCoreMods()
|
||||
{
|
||||
TopologicalSort.DirectedGraph<FMLPluginWrapper> sortGraph = new TopologicalSort.DirectedGraph<FMLPluginWrapper>();
|
||||
Map<String, FMLPluginWrapper> pluginMap = Maps.newHashMap();
|
||||
for (FMLPluginWrapper plug : loadPlugins)
|
||||
{
|
||||
sortGraph.addNode(plug);
|
||||
pluginMap.put(plug.name, plug);
|
||||
}
|
||||
|
||||
for (FMLPluginWrapper plug : loadPlugins)
|
||||
{
|
||||
for (String dep : plug.predepends)
|
||||
{
|
||||
if (!pluginMap.containsKey(dep))
|
||||
{
|
||||
FMLRelaunchLog.log(Level.ERROR, "Missing coremod dependency - the coremod %s depends on coremod %s which isn't present.", plug.name, dep);
|
||||
throw new RuntimeException();
|
||||
}
|
||||
sortGraph.addEdge(plug, pluginMap.get(dep));
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
loadPlugins = TopologicalSort.topologicalSort(sortGraph);
|
||||
FMLRelaunchLog.fine("Sorted coremod list %s", loadPlugins);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FMLLog.log(Level.ERROR, e, "There was a problem performing the coremod sort");
|
||||
throw Throwables.propagate(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void injectTransformers(LaunchClassLoader classLoader)
|
||||
{
|
||||
|
||||
@@ -677,7 +642,7 @@ public class CoreModManager {
|
||||
|
||||
public static void onCrash(StringBuilder builder)
|
||||
{
|
||||
if(!loadedCoremods.isEmpty() || !reparsedCoremods.isEmpty())
|
||||
if(!ignoredModFiles.isEmpty() || !candidateModFiles.isEmpty())
|
||||
{
|
||||
builder.append("\nWARNING: coremods are present:\n");
|
||||
for(String coreMod : transformers.keySet())
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
|
||||
public final class FileListHelper {
|
||||
private static enum CaseInsensitiveFileComparator implements Comparator<File>
|
||||
private enum CaseInsensitiveFileComparator implements Comparator<File>
|
||||
{
|
||||
INSTANCE;
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user