本文整理汇总了Java中net.minecraftforge.fml.common.versioning.ComparableVersion类的典型用法代码示例。如果您正苦于以下问题:Java ComparableVersion类的具体用法?Java ComparableVersion怎么用?Java ComparableVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComparableVersion类属于net.minecraftforge.fml.common.versioning包,在下文中一共展示了ComparableVersion类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: updateCheck
import net.minecraftforge.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) {
ModDescriptionEnhancer.setUpdateStatus(mod, ForgeVersion.Status.OUTDATED, newVersion);
addUpdateMessage("Version " + newVersion + " of " + mod + " is available");
}
return null;
}
});
}
开发者ID:TheCBProject,项目名称:CodeChickenCore,代码行数:20,代码来源:CCUpdateChecker.java
示例2: getAllChanges
import net.minecraftforge.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
public Map<ComparableVersion, String> getAllChanges() {
final LinkedHashMap<ComparableVersion, String> changes = new LinkedHashMap<ComparableVersion, String>();
if (this.builds != null) {
Collections.sort(this.builds, new Comparator<BuildData>() {
@Override
public int compare(final BuildData a, final BuildData b) {
return b.getVersion().compareTo(a.getVersion());
}
});
for (final BuildData build : this.builds) {
changes.put(build.getVersion(), build.getChanges());
}
return changes;
}
if (this.latest != null) {
changes.put(this.latest.getVersion(), this.latest.getChanges());
return changes;
}
return changes;
}
开发者ID:Lunatrius,项目名称:LunatriusCore,代码行数:27,代码来源:VersionChecker.java
示例3: CheckResult
import net.minecraftforge.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
private CheckResult(Status status, ComparableVersion target, Map<ComparableVersion, String> changes, String url)
{
this.status = status;
this.target = target;
this.changes = changes == null ? null : Collections.unmodifiableMap(changes);
this.url = url;
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:ForgeVersion.java
示例4: VersionedFile
import net.minecraftforge.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:TheCBProject,项目名称:CodeChickenCore,代码行数:13,代码来源:DepLoader.java
示例5: setUpdateStatus
import net.minecraftforge.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
public static void setUpdateStatus(String modId, Status status, ComparableVersion version) {
try {
ModContainer modContainer = FMLCommonHandler.instance().findContainerFor(modId);
Map<ComparableVersion, String> changes = new HashMap<ComparableVersion, String>();
CheckResult result = ReflectionManager.newInstance(CheckResult.class, status, version, changes, "");
setUpdateStatus(modContainer, result);
} catch (Exception e) {
e.printStackTrace();
}
}
开发者ID:TheCBProject,项目名称:CodeChickenCore,代码行数:11,代码来源:ModDescriptionEnhancer.java
示例6: compareVersions
import net.minecraftforge.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
public static int compareVersions(@Nonnull final String v1, @Nonnull final String v2) {
if (StringUtils.isNullOrEmpty(v1) || v1.charAt(0) == '@')
return -1;
else if (StringUtils.isNullOrEmpty(v2) || v2.charAt(0) == '@')
return 1;
final ComparableVersion ver1 = new ComparableVersion(v1);
final ComparableVersion ver2 = new ComparableVersion(v2);
return ver1.compareTo(ver2);
}
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:11,代码来源:VersionHelper.java
示例7: updateCheck
import net.minecraftforge.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
private static void updateCheck() {
final ComparableVersion ccv = new ComparableVersion(R.MF_VERSION);
try {
final JsonObject je = MCFluxNetwork.downloadGistJSON("97a48d6a61b29171938abf2f6bf9f985", "versions.json");
final String v = je.getAsJsonObject("mc").getAsJsonPrimitive(Loader.MC_VERSION).getAsString();
if (new ComparableVersion(v).compareTo(ccv) > 0) {
L.info("A newer Minecraft-Flux version is available (" + v + ")");
NEWER_VERSION = v;
}
UPDATE_CHECK_FINISHED = true;
} catch (Throwable t) {
MCFluxReport.sendException(t, "Update Check");
}
}
开发者ID:Szewek,项目名称:Minecraft-Flux,代码行数:15,代码来源:MCFlux.java
示例8: getStatus
import net.minecraftforge.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
public static ForgeVersion.Status getStatus(final ComparableVersion versionRemote, final ComparableVersion versionLocal) {
final int diff = versionRemote.compareTo(versionLocal);
if (diff == 0) {
return ForgeVersion.Status.UP_TO_DATE;
}
if (diff > 0) {
return ForgeVersion.Status.OUTDATED;
}
return ForgeVersion.Status.AHEAD;
}
开发者ID:Lunatrius,项目名称:LunatriusCore,代码行数:14,代码来源:ForgeVersionCheck.java
示例9: notify
import net.minecraftforge.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
public static void notify(final ModContainer container, final ForgeVersion.Status status, final ComparableVersion target, final Map<ComparableVersion, String> changes, final String url) {
try {
final Map<ModContainer, ForgeVersion.CheckResult> versionMap = getVersionMap();
final ForgeVersion.CheckResult checkResult = getCheckResult(status, target, changes, url);
if (versionMap != null && checkResult != null) {
versionMap.put(container, checkResult);
}
} catch (final Throwable t) {
Reference.logger.error("Failed to notify Forge!", t);
}
}
开发者ID:Lunatrius,项目名称:LunatriusCore,代码行数:13,代码来源:ForgeVersionCheck.java
示例10: getCheckResult
import net.minecraftforge.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
private static ForgeVersion.CheckResult getCheckResult(final ForgeVersion.Status status, final ComparableVersion target, final Map<ComparableVersion, String> changes, final String url) throws ReflectiveOperationException {
try {
final Constructor<?> constructor = ForgeVersion.CheckResult.class.getDeclaredConstructor(ForgeVersion.Status.class, ComparableVersion.class, Map.class, String.class);
constructor.setAccessible(true);
return (ForgeVersion.CheckResult) constructor.newInstance(status, target, changes, url);
} catch (final Throwable t) {
Reference.logger.error("Failed to construct the CheckResult object!", t);
}
return null;
}
开发者ID:Lunatrius,项目名称:LunatriusCore,代码行数:12,代码来源:ForgeVersionCheck.java
示例11: getVersion
import net.minecraftforge.fml.common.versioning.ComparableVersion; //导入依赖的package包/类
public ComparableVersion getVersion() {
return new ComparableVersion(this.version);
}
开发者ID:Lunatrius,项目名称:LunatriusCore,代码行数:4,代码来源:VersionChecker.java
注:本文中的net.minecraftforge.fml.common.versioning.ComparableVersion类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论