public ModContainer build(ASMModParser modParser, File modSource, ModCandidate container) { String className = modParser.getASMType().getClassName(); if (modParser.isBaseMod(container.getRememberedBaseMods()) && modClass.matcher(className).find()) { FMLLog.severe("Found a BaseMod type mod %s", className); FMLLog.severe("This will not be loaded and will be ignored. ModLoader mechanisms are no longer available."); } else if (modClass.matcher(className).find()) { FMLLog.fine("Identified a class %s following modloader naming convention but not directly a BaseMod or currently seen subclass", className); container.rememberModCandidateType(modParser); } else if (modParser.isBaseMod(container.getRememberedBaseMods())) { FMLLog.fine("Found a basemod %s of non-standard naming format", className); container.rememberBaseModType(className); } for (ModAnnotation ann : modParser.getAnnotations()) { if (modTypes.containsKey(ann.getASMType())) { FMLLog.fine("Identified a mod of type %s (%s) - loading", ann.getASMType(), className); try { return modTypes.get(ann.getASMType()).newInstance(className, container, ann.getValues()); } catch (Exception e) { FMLLog.log(Level.ERROR, e, "Unable to construct %s container", ann.getASMType().getClassName()); return null; } } } return null; }
public ModContainer build(ASMModParser modParser, File modSource, ModCandidate container) { String className = modParser.getASMType().getClassName(); if (modParser.isBaseMod(container.getRememberedBaseMods()) && modClass.matcher(className).find()) { FMLLog.severe("Found a BaseMod type mod %s", className); FMLLog.severe("This will not be loaded and will be ignored. ModLoader mechanisms are no longer available."); } else if (modClass.matcher(className).find()) { FMLLog.fine("Identified a class %s following modloader naming convention but not directly a BaseMod or currently seen subclass", className); container.rememberModCandidateType(modParser); } else if (modParser.isBaseMod(container.getRememberedBaseMods())) { FMLLog.fine("Found a basemod %s of non-standard naming format", className); container.rememberBaseModType(className); } // 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.") && container.isClasspath() && !container.isMinecraftJar()) { 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 " + "a new package. Go on. DO IT NOW!",className); } for (ModAnnotation ann : modParser.getAnnotations()) { if (ann.getASMType().equals(Type.getType(Mod.class))) { FMLLog.fine("Identified an FMLMod type mod %s", className); return new FMLModContainer(className, container, ann.getValues()); } } return null; }
public ModContainer build(ASMModParser modParser, File modSource, ModCandidate container) { String className = modParser.getASMType().getClassName(); if (modParser.isBaseMod(container.getRememberedBaseMods()) && modClass.matcher(className).find()) { FMLLog.fine("Identified a BaseMod type mod %s", className); return new ModLoaderModContainer(className, modSource, modParser.getBaseModProperties()); } else if (modClass.matcher(className).find()) { FMLLog.fine("Identified a class %s following modloader naming convention but not directly a BaseMod or currently seen subclass", className); container.rememberModCandidateType(modParser); } else if (modParser.isBaseMod(container.getRememberedBaseMods())) { FMLLog.fine("Found a basemod %s of non-standard naming format", className); container.rememberBaseModType(className); } // 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.") && container.isClasspath() && !container.isMinecraftJar()) { 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 " + "a new package. Go on. DO IT NOW!",className); } for (ModAnnotation ann : modParser.getAnnotations()) { if (ann.getASMType().equals(Type.getType(Mod.class))) { FMLLog.fine("Identified an FMLMod type mod %s", className); return new FMLModContainer(className, container, ann.getValues()); } } return null; }
public void rememberModCandidateType(ASMModParser modParser) { baseModCandidateTypes.add(modParser); }