mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-15 17:45:06 +00:00
Don't complain about minecraft source code being in "net.minecraft.src". Derp.
This commit is contained in:
1 parent
b2fdcd7f1c
commit
cf77ffb89d
5 files changed
+12
-6
No files matched your search
@@ -5,6 +5,7 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
import org.objectweb.asm.Type;
|
import org.objectweb.asm.Type;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.discovery.ModCandidate;
|
||||||
import cpw.mods.fml.common.discovery.asm.ASMModParser;
|
import cpw.mods.fml.common.discovery.asm.ASMModParser;
|
||||||
import cpw.mods.fml.common.discovery.asm.ModAnnotation;
|
import cpw.mods.fml.common.discovery.asm.ModAnnotation;
|
||||||
import cpw.mods.fml.common.modloader.ModLoaderModContainer;
|
import cpw.mods.fml.common.modloader.ModLoaderModContainer;
|
||||||
@@ -16,7 +17,7 @@ public class ModContainerFactory
|
|||||||
public static ModContainerFactory instance() {
|
public static ModContainerFactory instance() {
|
||||||
return INSTANCE;
|
return INSTANCE;
|
||||||
}
|
}
|
||||||
public ModContainer build(ASMModParser modParser, File modSource)
|
public ModContainer build(ASMModParser modParser, File modSource, ModCandidate container)
|
||||||
{
|
{
|
||||||
String className = modParser.getASMType().getClassName();
|
String className = modParser.getASMType().getClassName();
|
||||||
if (modParser.isBaseMod() && modClass.matcher(className).find())
|
if (modParser.isBaseMod() && modClass.matcher(className).find())
|
||||||
@@ -26,7 +27,7 @@ public class ModContainerFactory
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We warn if it's not a basemod instance -- compatibility requires it to be in net.minecraft.src *sigh*
|
// We warn if it's not a basemod instance -- compatibility requires it to be in net.minecraft.src *sigh*
|
||||||
if (className.startsWith("net.minecraft.src."))
|
if (className.startsWith("net.minecraft.src.") && container.isClasspath())
|
||||||
{
|
{
|
||||||
FMLLog.severe("FML has detected a mod that is using a package name based on 'net.minecraft.src' : %s. This is generally a severe programming error. "
|
FMLLog.severe("FML has detected a mod that is using a package name based on 'net.minecraft.src' : %s. This is generally a severe programming error. "
|
||||||
+ " There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into "
|
+ " There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into "
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class DirectoryDiscoverer implements ITypeDiscoverer
|
|||||||
|
|
||||||
modParser.validate();
|
modParser.validate();
|
||||||
modParser.sendToTable(table, candidate);
|
modParser.sendToTable(table, candidate);
|
||||||
ModContainer container = ModContainerFactory.instance().build(modParser, candidate.getModContainer());
|
ModContainer container = ModContainerFactory.instance().build(modParser, candidate.getModContainer(), candidate);
|
||||||
if (container!=null)
|
if (container!=null)
|
||||||
{
|
{
|
||||||
harvestedMods.add(container);
|
harvestedMods.add(container);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class JarDiscoverer implements ITypeDiscoverer
|
|||||||
ASMModParser modParser = new ASMModParser(jar.getInputStream(ze));
|
ASMModParser modParser = new ASMModParser(jar.getInputStream(ze));
|
||||||
modParser.validate();
|
modParser.validate();
|
||||||
modParser.sendToTable(table, candidate);
|
modParser.sendToTable(table, candidate);
|
||||||
ModContainer container = ModContainerFactory.instance().build(modParser, candidate.getModContainer());
|
ModContainer container = ModContainerFactory.instance().build(modParser, candidate.getModContainer(), candidate);
|
||||||
if (container!=null)
|
if (container!=null)
|
||||||
{
|
{
|
||||||
table.addContainer(container);
|
table.addContainer(container);
|
||||||
|
|||||||
@@ -43,4 +43,9 @@ public class ModCandidate
|
|||||||
{
|
{
|
||||||
return sourceType.findMods(this, table);
|
return sourceType.findMods(this, table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isClasspath()
|
||||||
|
{
|
||||||
|
return classpath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -47,13 +47,13 @@ public class ModDiscoverer
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
|
FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
|
||||||
candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, true));
|
candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, i!=0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (minecraftSources[i].isDirectory())
|
else if (minecraftSources[i].isDirectory())
|
||||||
{
|
{
|
||||||
FMLLog.fine("Found a minecraft related directory at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
|
FMLLog.fine("Found a minecraft related directory at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
|
||||||
candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.DIR, true));
|
candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.DIR, i!=0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user