Quote
(Quoting Player)
You are wrong, inform yourself better or stop bugging us with poorly researched nonsense.
The warnings come directly from "if (Loader.instance().getModClassLoader().containsSource(this.getSource()))", which effectively just checks for coremods through the class loader differences.
Well to answer is actually wrong. What you are showing is simply a Duplication preventer in the ModAPI manager. So that a mod can not register the same APIPartName (VariableName: provides) twice, and the part you are showing is simply the preventation that if multible mods share the same API Files like RF API or IC2API that no error gets throwen.
Since all your packageInfo files did have the same Provides name it will throw the error because the mod was already added to the preventation System and it will throw then the error...
Instead of looking at this function:
public void validate(String providedAPI, String apiOwner, String apiVersion)
{
if (Loader.instance().getModClassLoader().containsSource(this.getSource())) {
FMLLog.bigWarning("The API %s from source %s is loaded from an incompatible classloader. THIS WILL NOT WORK!", providedAPI, this.getSource().getAbsolutePath());
}
// TODO Compare this annotation data to the one we first found. Maybe barf if there is inconsistency?
}
You should have lookt at the code behind it and you would have noticed the error you made in your head!
Here is the code that is actually throwing it:
public void registerDataTableAndParseAPI(ASMDataTable dataTable)
{
this.dataTable = dataTable;
Set<ASMData> apiList = dataTable.getAll("net.minecraftforge.fml.common.API");
apiContainers = Maps.newHashMap();
for (ASMData data : apiList)
{
Map<String, Object> annotationInfo = data.getAnnotationInfo();
String apiPackage = data.getClassName().substring(0,data.getClassName().indexOf(".package-info"));
String providedAPI = (String) annotationInfo.get("provides"); //HERE IS THE THING WHERE THEY GET THE PROVIDES NAME!
String apiOwner = (String) annotationInfo.get("owner");
String apiVersion = (String) annotationInfo.get("apiVersion");
APIContainer container = apiContainers.get(providedAPI); //HERE THEY DO CHECK IF THE NAME IS ALREADY PROVIDED
if (container == null) //IF NOT HE IS ADDING IT!
{
container = new APIContainer(providedAPI, apiVersion, data.getCandidate().getModContainer(), VersionParser.parseVersionReference(apiOwner));
apiContainers.put(providedAPI, container);
}
else
{
container.validate(providedAPI, apiOwner, apiVersion); //IF ITS ALREADY ADDED ITS CHECKING IF THE MOD IS ALREADY IN THE LIST
}
container.addOwnedPackage(apiPackage);
for (ModContainer mc : data.getCandidate().getContainedMods())
{
String embeddedIn = mc.getModId();
if (container.currentReferents.contains(embeddedIn))
{
continue;
}
FMLLog.fine("Found API %s (owned by %s providing %s) embedded in %s",apiPackage, apiOwner, providedAPI, embeddedIn);
if (!embeddedIn.equals(apiOwner))
{
container.addAPIReference(embeddedIn);
}
}
}
}
Display More
So please tell me again that i am wrong player? Because you used all the time in the Package.info class the same name causing this issue!