本文整理汇总了Java中codechicken.core.launch.CodeChickenCorePlugin类的典型用法代码示例。如果您正苦于以下问题:Java CodeChickenCorePlugin类的具体用法?Java CodeChickenCorePlugin怎么用?Java CodeChickenCorePlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CodeChickenCorePlugin类属于codechicken.core.launch包,在下文中一共展示了CodeChickenCorePlugin类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateCheck
import codechicken.core.launch.CodeChickenCorePlugin; //导入依赖的package包/类
public static void updateCheck(final String mod, final String version) {
updateCheck("http://www.chickenbones.net/Files/notification/version.php?" +
"version=" + mcVersion() + "&" +
"file=" + mod,
new Function<String, Void>()
{
@Override public Void apply(String ret) {
if (!ret.startsWith("Ret: ")) {
CodeChickenCorePlugin.logger.error("Failed to check update for " + mod + " returned: " + ret);
return null;
}
ComparableVersion newversion = new ComparableVersion(ret.substring(5));
if (newversion.compareTo(new ComparableVersion(version)) > 0)
addUpdateMessage("Version " + newversion + " of " + mod + " is available");
return null;
}
});
}
示例2: notificationCheck
import codechicken.core.launch.CodeChickenCorePlugin; //导入依赖的package包/类
private void notificationCheck() {
final ConfigTag tag = config.getTag("checkNotifications").setComment("The most recent notification number recieved. -1 to disable");
final int notify = tag.getIntValue(0);
if(notify < 0)
return;
CCUpdateChecker.updateCheck(
"http://www.chickenbones.net/Files/notification/general.php",
new Function<String, Void>()
{
@Override
public Void apply(String ret) {
Matcher m = Pattern.compile("Ret \\((\\d+)\\): (.+)").matcher(ret);
if (!m.matches()) {
CodeChickenCorePlugin.logger.error("Failed to check notifications: " + ret);
return null;
}
int index = Integer.parseInt(m.group(1));
if(index > notify) {
tag.setIntValue(index);
CCUpdateChecker.addUpdateMessage(m.group(2));
}
return null;
}
});
}
示例3: load
import codechicken.core.launch.CodeChickenCorePlugin; //导入依赖的package包/类
public static void load() {
CodeChickenCoreModContainer.loadConfig();
ConfigFile config = CodeChickenCoreModContainer.config;
File mcDir = CodeChickenCorePlugin.minecraftDir;
if (config.getTag("dev.deobfuscate")
.setComment("set to true to completely deobfuscate mcp names")
.getBooleanValue(!ObfMapping.obfuscated)) {
run = new ObfuscationRun(false, ObfMapping.MCPRemapper.getConfFiles(),
ObfuscationRun.fillDefaults(new HashMap<String, String>()));
run.obf.setHeirachyEvaluator(instance);
run.setQuiet().parseMappings();
for (String pkg : run.config.get("excludedPackages").split(";"))
excludedPackages.add(pkg);
if (ObfMapping.obfuscated) {
ObfMapping.loadMCPRemapper();
run.setSeargeConstants();
getTransformers().add(instance);
} else {
getTransformers().add(0, instance);//insert transformer as first.
}
}
}
示例4: checkAddClass
import codechicken.core.launch.CodeChickenCorePlugin; //导入依赖的package包/类
private void checkAddClass(String resource) {
try {
String classname = resource.replace(".class", "").replace("\\", ".").replace("/", ".");
byte[] bytes = Launch.classLoader.getClassBytes(classname);
if (bytes == null)
return;
ClassNode cnode = ASMHelper.createClassNode(bytes);
for (String superclass : superclasses)
if (!cnode.interfaces.contains(superclass) && !cnode.superName.equals(superclass))
return;
addClass(classname);
} catch (IOException e) {
CodeChickenCorePlugin.logger.error("Unable to load class: " + resource, e);
}
}
示例5: findClasspathMods
import codechicken.core.launch.CodeChickenCorePlugin; //导入依赖的package包/类
private void findClasspathMods() {
List<String> knownLibraries = ImmutableList.<String>builder()
.addAll(modClassLoader.getDefaultLibraries())
.addAll(CoreModManager.getLoadedCoremods()).build();
File[] minecraftSources = modClassLoader.getParentSources();
HashSet<String> searchedSources = new HashSet<String>();
for (File minecraftSource : minecraftSources) {
if (searchedSources.contains(minecraftSource.getAbsolutePath()))
continue;
searchedSources.add(minecraftSource.getAbsolutePath());
if (minecraftSource.isFile()) {
if (!knownLibraries.contains(minecraftSource.getName())) {
FMLLog.fine("Found a minecraft related file at %s, examining for codechicken classes", minecraftSource.getAbsolutePath());
try {
readFromZipFile(minecraftSource);
} catch (Exception e) {
CodeChickenCorePlugin.logger.error("Failed to scan " + minecraftSource.getAbsolutePath() + ", the zip file is invalid", e);
}
}
} else if (minecraftSource.isDirectory()) {
FMLLog.fine("Found a minecraft related directory at %s, examining for codechicken classes", minecraftSource.getAbsolutePath());
readFromDirectory(minecraftSource, minecraftSource);
}
}
}
示例6: updateCheck
import codechicken.core.launch.CodeChickenCorePlugin; //导入依赖的package包/类
public static void updateCheck(final String mod, final String version) {
updateCheck("http://www.chickenbones.net/Files/notification/version.php?" +
"version=" + mcVersion() + "&" +
"file=" + mod, new Function<String, Void>() {
@Override
public Void apply(String ret) {
if (!ret.startsWith("Ret: ")) {
CodeChickenCorePlugin.logger.error("Failed to check update for " + mod + " returned: " + ret);
return null;
}
ComparableVersion newVersion = new ComparableVersion(ret.substring(5));
if (newVersion.compareTo(new ComparableVersion(version)) > 0) {
ModDescriptionEnhancer.setUpdateStatus(mod, ForgeVersion.Status.OUTDATED, newVersion);
addUpdateMessage("Version " + newVersion + " of " + mod + " is available");
}
return null;
}
});
}
示例7: readMapFile
import codechicken.core.launch.CodeChickenCorePlugin; //导入依赖的package包/类
private void readMapFile(String mapFile)
{
CodeChickenCorePlugin.logger.debug("Adding Accesstransformer map: " + mapFile);
try
{
Method parentMapFile = AccessTransformer.class.getDeclaredMethod("readMapFile", String.class);
parentMapFile.setAccessible(true);
parentMapFile.invoke(this, mapFile);
}
catch(Exception e)
{
throw new RuntimeException(e);
}
}
示例8: addClass
import codechicken.core.launch.CodeChickenCorePlugin; //导入依赖的package包/类
private void addClass(String classname) {
try {
Class<?> class1 = Class.forName(classname, true, modClassLoader);
classes.add(class1);
} catch (Throwable t) {
CodeChickenCorePlugin.logger.error("Unable to load class: " + classname, t);
}
}
示例9: getASMTransformerClass
import codechicken.core.launch.CodeChickenCorePlugin; //导入依赖的package包/类
@Override
public String[] getASMTransformerClass() {
CodeChickenCorePlugin.versionCheck(CodeChickenCorePlugin.mcVersion, "NotEnoughItems");
return new String[]{"codechicken.nei.asm.NEITransformer"};
}
示例10: acceptableMinecraftVersionRange
import codechicken.core.launch.CodeChickenCorePlugin; //导入依赖的package包/类
@Override
public VersionRange acceptableMinecraftVersionRange() {
return VersionParser.parseRange(CodeChickenCorePlugin.mcVersion);
}
示例11: loadConfig
import codechicken.core.launch.CodeChickenCorePlugin; //导入依赖的package包/类
public static void loadConfig() {
if(config == null)
config = new ConfigFile(new File(CodeChickenCorePlugin.minecraftDir, "config/CodeChickenCore.cfg")).setComment("CodeChickenCore configuration file.");
}
示例12: getRequirements
import codechicken.core.launch.CodeChickenCorePlugin; //导入依赖的package包/类
@Override
public Set<ArtifactVersion> getRequirements() {
Set<ArtifactVersion> deps = new HashSet<ArtifactVersion>();
deps.add(VersionParser.parseVersionReference("[email protected]["+CodeChickenCorePlugin.version+",)"));
return deps;
}