当前位置: 首页>>代码示例>>Java>>正文


Java CheckResult类代码示例

本文整理汇总了Java中net.minecraftforge.common.ForgeVersion.CheckResult的典型用法代码示例。如果您正苦于以下问题:Java CheckResult类的具体用法?Java CheckResult怎么用?Java CheckResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CheckResult类属于net.minecraftforge.common.ForgeVersion包,在下文中一共展示了CheckResult类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkVersion

import net.minecraftforge.common.ForgeVersion.CheckResult; //导入依赖的package包/类
/**
 * Checks the current version against the git-hub version.
 */
public static void checkVersion()
{
	// Pull the repository information.
	ModContainer prefabMod = null;
	
	for (ModContainer modContainer : Loader.instance().getModList())
	{
		if (modContainer.getName().toLowerCase().equals(Prefab.MODID.toLowerCase()))
		{
			prefabMod = modContainer;
			break;
		}
	}
	
	if (prefabMod != null)
	{
		CheckResult result = ForgeVersion.getResult(prefabMod);
		
		if (result != null && result.status == Status.OUTDATED)
		{
			// Current version is out dated, show the message when the user is logged in.
			UpdateChecker.messageToShow = "[Prefab] There is a new version available! New Version: [" + result.target.toString() + "] Your Version: ["
					+ Prefab.VERSION + "]";
			
			UpdateChecker.showMessage = true;
		}
	}
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:32,代码来源:UpdateChecker.java

示例2: drawSlot

import net.minecraftforge.common.ForgeVersion.CheckResult; //导入依赖的package包/类
@Override
protected void drawSlot(int idx, int right, int top, int height, Tessellator tess)
{
    ModContainer mc       = mods.get(idx);
    String       name     = StringUtils.stripControlCodes(mc.getName());
    String       version  = StringUtils.stripControlCodes(mc.getDisplayVersion());
    FontRenderer font     = this.parent.getFontRenderer();
    CheckResult  vercheck = ForgeVersion.getResult(mc);

    if (Loader.instance().getModState(mc) == ModState.DISABLED)
    {
        font.drawString(font.trimStringToWidth(name,       listWidth - 10), this.left + 3 , top +  2, 0xFF2222);
        font.drawString(font.trimStringToWidth(version,    listWidth - (5 + height)), this.left + 3 , top + 12, 0xFF2222);
        font.drawString(font.trimStringToWidth("DISABLED", listWidth - 10), this.left + 3 , top + 22, 0xFF2222);
    }
    else
    {
        font.drawString(font.trimStringToWidth(name,    listWidth - 10), this.left + 3 , top +  2, 0xFFFFFF);
        font.drawString(font.trimStringToWidth(version, listWidth - (5 + height)), this.left + 3 , top + 12, 0xCCCCCC);
        font.drawString(font.trimStringToWidth(mc.getMetadata() != null ? mc.getMetadata().getChildModCountString() : "Metadata not found", listWidth - 10), this.left + 3 , top + 22, 0xCCCCCC);

        if (vercheck.status.shouldDraw())
        {
            //TODO: Consider adding more icons for visualization
            Minecraft.getMinecraft().getTextureManager().bindTexture(VERSION_CHECK_ICONS);
            GlStateManager.color(1, 1, 1, 1);
            GlStateManager.pushMatrix();
            Gui.drawModalRectWithCustomSizedTexture(right - (height / 2 + 4), top + (height / 2 - 4), vercheck.status.getSheetOffset() * 8, (vercheck.status.isAnimated() && ((System.currentTimeMillis() / 800 & 1)) == 1) ? 8 : 0, 8, 8, 64, 16);
            GlStateManager.popMatrix();
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:33,代码来源:GuiSlotModList.java

示例3: setUpdateStatus

import net.minecraftforge.common.ForgeVersion.CheckResult; //导入依赖的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

示例4: getUpdateMessage

import net.minecraftforge.common.ForgeVersion.CheckResult; //导入依赖的package包/类
@Nullable
private String getUpdateMessage(@Nonnull final String modId) {
	final ModContainer mod = ForgeUtils.findModContainer(modId);
	if (mod == null)
		return null;
	final CheckResult result = ForgeVersion.getResult(mod);
	if (dontPrintMessage(result))
		return null;
	final String t = result.target.toString();
	final String u = result.url.toString();
	return Localization.format(this.messageId, mod.getName(), t, u);
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:13,代码来源:VersionChecker.java

示例5: dontPrintMessage

import net.minecraftforge.common.ForgeVersion.CheckResult; //导入依赖的package包/类
private static boolean dontPrintMessage(@Nonnull final CheckResult result) {
	return result == null || result.status == null || result.target == null || result.url == null
			|| result.status == Status.UP_TO_DATE || result.status == Status.AHEAD
			|| result.status == Status.PENDING || result.status == Status.FAILED;
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:6,代码来源:VersionChecker.java

示例6: getVersionCheckResult

import net.minecraftforge.common.ForgeVersion.CheckResult; //导入依赖的package包/类
public static CheckResult getVersionCheckResult() {
	return versionCheckResult;
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:4,代码来源:CoreInit.java

示例7: updateCheckResult

import net.minecraftforge.common.ForgeVersion.CheckResult; //导入依赖的package包/类
public static void updateCheckResult()
{
	CheckResult r = ForgeVersion.getResult(modContainer);
	if (r != null && r.status != Status.PENDING) versionCheckResult = r;
}
 
开发者ID:BubbleTrouble14,项目名称:ARKCraft,代码行数:6,代码来源:ARKCraft.java


注:本文中的net.minecraftforge.common.ForgeVersion.CheckResult类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。