本文整理汇总了Java中cpw.mods.fml.common.versioning.ComparableVersion类的典型用法代码示例。如果您正苦于以下问题:Java ComparableVersion类的具体用法?Java ComparableVersion怎么用?Java ComparableVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComparableVersion类属于cpw.mods.fml.common.versioning包,在下文中一共展示了ComparableVersion类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: VersionedFile
import cpw.mods.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
public VersionedFile(String filename, Pattern pattern)
{
this.pattern = pattern;
this.filename = filename;
Matcher m = pattern.matcher(filename);
if (m.matches())
{
name = m.group(1);
version = new ComparableVersion(m.group(2));
}
else
{
name = null;
version = null;
}
}
开发者ID:4Space,项目名称:4Space-5,代码行数:17,代码来源:DepLoader.java
示例2: updateCheck
import cpw.mods.fml.common.versioning.ComparableVersion; //导入依赖的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;
}
});
}
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:CCUpdateChecker.java
示例3: VersionedFile
import cpw.mods.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
public VersionedFile(String filename, Pattern pattern) {
this.pattern = pattern;
this.filename = filename;
Matcher m = pattern.matcher(filename);
if(m.matches()) {
name = m.group(1);
version = new ComparableVersion(m.group(2));
}
else {
name = null;
version = null;
}
}
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:DepLoader.java
示例4: check
import cpw.mods.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
private void check(ModContainer modContainer)
{
try
{
ComparableVersion current = new ComparableVersion(modContainer.getVersion());
URL url = new URL(NOConstants.URL_MAVEN + modContainer.getMod().getClass().getCanonicalName().replace('.', '/') + "/maven-metadata.xml");
MetadataXpp3Reader metadataXpp3Reader = new MetadataXpp3Reader();
Metadata metadata = metadataXpp3Reader.read(url.openStream());
ComparableVersion latest = null;
for (String versionString : metadata.getVersioning().getVersions())
{
if (versionString.contains(MCVERSION + "-"))
{
versionString = versionString.replace(MCVERSION + "-", "");
ComparableVersion version = new ComparableVersion(versionString);
if (latest == null || version.compareTo(latest) > 0) latest = version;
}
}
if (latest != null && latest.compareTo(current) > 0) modsToUpdate.put(modContainer, latest.toString());
}
catch (Exception ignored)
{
// We don't really care, a lot of things can go wrong...
NucleumOmnium.getLogger().info("Something went wrong when version checking " + modContainer.getModId() + ", check manually.");
}
}
开发者ID:CCM-Modding,项目名称:Nucleum-Omnium,代码行数:29,代码来源:VersionChecker.java
示例5: checkIsNewer
import cpw.mods.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
private boolean checkIsNewer(String current, String received) {
return new ComparableVersion(received).compareTo(new ComparableVersion(current)) > 0;
}
开发者ID:EnderWizards,项目名称:libsandstone,代码行数:4,代码来源:DataSender.java
示例6: getVersion
import cpw.mods.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
public ComparableVersion getVersion() {
return file.getVersion();
}
开发者ID:MyEssentials,项目名称:MyEssentials-Core,代码行数:4,代码来源:Dependency.java
示例7: getVersion
import cpw.mods.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
public ComparableVersion getVersion() {
return version;
}
开发者ID:MyEssentials,项目名称:MyEssentials-Core,代码行数:4,代码来源:VersionedFile.java
注:本文中的cpw.mods.fml.common.versioning.ComparableVersion类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论