本文整理汇总了Java中net.minecraftforge.common.ForgeVersion.Status方法的典型用法代码示例。如果您正苦于以下问题:Java ForgeVersion.Status方法的具体用法?Java ForgeVersion.Status怎么用?Java ForgeVersion.Status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.ForgeVersion
的用法示例。
在下文中一共展示了ForgeVersion.Status方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStatus
import net.minecraftforge.common.ForgeVersion; //导入方法依赖的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;
}
示例2: notify
import net.minecraftforge.common.ForgeVersion; //导入方法依赖的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);
}
}
示例3: getCheckResult
import net.minecraftforge.common.ForgeVersion; //导入方法依赖的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;
}