本文整理汇总了Java中net.minecraftforge.common.ForgeVersion.Status类的典型用法代码示例。如果您正苦于以下问题:Java Status类的具体用法?Java Status怎么用?Java Status使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Status类属于net.minecraftforge.common.ForgeVersion包,在下文中一共展示了Status类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initGui
import net.minecraftforge.common.ForgeVersion.Status; //导入依赖的package包/类
/**
* Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
* window resizes, the buttonList is cleared beforehand.
*/
@Override
public void initGui()
{
if (!hasCheckedForUpdates)
{
if (modButton != null)
{
for (ModContainer mod : Loader.instance().getModList())
{
Status status = ForgeVersion.getResult(mod).status;
if (status == Status.OUTDATED || status == Status.BETA_OUTDATED)
{
// TODO: Needs better visualization, maybe stacked icons
// drawn in a terrace-like pattern?
showNotification = Status.OUTDATED;
}
}
}
hasCheckedForUpdates = true;
}
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:26,代码来源:NotificationModUpdateScreen.java
示例2: onPlayerLoggedIn
import net.minecraftforge.common.ForgeVersion.Status; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLoggedIn(PlayerLoggedInEvent event)
{
EntityPlayer player = event.player;
if (player != null) {
if (ARKCraft.instance().isDebugger()) {
player.sendMessage(new TextComponentString(ChatFormatting.RED + "You are running a decompiled version of ARKCraft!"));
}
else if (ARKCraft.versionCheckResult != null && ARKCraft.versionCheckResult.status == Status.OUTDATED || ARKCraft.versionCheckResult.status == Status.BETA_OUTDATED) {
player.sendMessage(new TextComponentString(ChatFormatting.RED + I18n.translate("chat.notification.outdated")));
player.sendMessage(new TextComponentString(ChatFormatting.RED + I18n.format("chat.notification.outdatedversion", ARKCraft.instance().version())));
}
else if (ARKCraft.versionCheckResult == null) {
player.sendMessage(new TextComponentString(ChatFormatting.RED + "No Internet access"));
}
}
}
开发者ID:BubbleTrouble14,项目名称:ARKCraft,代码行数:19,代码来源:VersionDetectionHandler.java
示例3: setUpdateStatus
import net.minecraftforge.common.ForgeVersion.Status; //导入依赖的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: checkVersion
import net.minecraftforge.common.ForgeVersion.Status; //导入依赖的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
示例5: dontPrintMessage
import net.minecraftforge.common.ForgeVersion.Status; //导入依赖的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: PostLoad
import net.minecraftforge.common.ForgeVersion.Status; //导入依赖的package包/类
@EventHandler
public static void PostLoad(FMLPostInitializationEvent PostEvent) {
log.info("Start Post Initialization");
long tM = System.currentTimeMillis();
proxy.postInit();
TomsModAPIMain.init();
log.info("Setting Max Stack Size of Minecarts to " + Config.minecartMaxStackSize + ".");
Items.MINECART.setMaxStackSize(Config.minecartMaxStackSize);
Items.CHEST_MINECART.setMaxStackSize(Config.minecartMaxStackSize);
Items.TNT_MINECART.setMaxStackSize(Config.minecartMaxStackSize);
Items.FURNACE_MINECART.setMaxStackSize(Config.minecartMaxStackSize);
Items.HOPPER_MINECART.setMaxStackSize(Config.minecartMaxStackSize);
versionCheckResult = ForgeVersion.getResult(mc);
Logger vcLog = LogManager.getLogger(Configs.ModName + "] [Version Checker");
if (versionCheckResult.status == Status.OUTDATED) {
vcLog.warn("****************************************");
vcLog.warn("* Tom's Mod is OUTDATED!!");
vcLog.warn("* Current version: " + Configs.version);
vcLog.warn("* Online version: " + versionCheckResult.target.toString());
vcLog.warn("****************************************");
} else if (versionCheckResult.status == Status.AHEAD) {
vcLog.warn("??? status == AHEAD ???");
vcLog.warn("?? Current version: " + Configs.version);
} else if (versionCheckResult.status == Status.PENDING || versionCheckResult.status == Status.FAILED) {
vcLog.warn("Tom's Mod version checking failed.");
} else {
vcLog.info("Tom's Mod is up to date");
}
String[] tools = new String[]{"!_axe", "!_pickaxe", "!_shovel", "!_sword", "!_hoe"};
List<String> toNerf = new ArrayList<>();
if (Config.nerfedTools != null && Config.nerfedTools.length > 0)
Stream.of(Config.nerfedTools).map(ResourceLocation::new).filter(Item.REGISTRY::containsKey).map(ResourceLocation::toString).forEach(toNerf::add);
if (Config.disableWoodenTools) {
log.info("Nerfing wooden tools");
Stream.of(tools).map(t -> t.replace("!", "wooden")).forEach(toNerf::add);
}
if (Config.disableStoneTools) {
log.info("Nerfing stone tools");
Stream.of(tools).map(t -> t.replace("!", "stone")).forEach(toNerf::add);
}
if (Config.disableIronTools) {
log.info("Nerfing iron tools");
Stream.of(tools).map(t -> t.replace("!", "iron")).forEach(toNerf::add);
}
if (Config.disableGoldTools) {
log.info("Nerfing gold tools");
Stream.of(tools).map(t -> t.replace("!", "gold")).forEach(toNerf::add);
}
if (Config.disableDiamondTools) {
log.info("Nerfing diamond tools");
Stream.of(tools).map(t -> t.replace("!", "diamond")).forEach(toNerf::add);
}
if (Config.enableHardModeStarting) {
log.info("Overwriting Wood Harvest Levels");
hackedWood = new HackedWoodMaterial();
List<ItemStack> list = new ArrayList<>(OreDictionary.getOres("logWood"));
list.addAll(OreDictionary.getOres("plankWood"));
list.addAll(OreDictionary.getOres("slabWood"));
list.addAll(OreDictionary.getOres("stairWood"));
for (ItemStack stack : list) {
Block block = Block.getBlockFromItem(stack.getItem());
if (block != Blocks.AIR) {
block.setHarvestLevel("axe", 0);
TomsModUtils.trySetFinalField(Block.class, Material.class, block, hackedWood, log, "Failed to set Material value for " + block.getUnlocalizedName());
}
}
}
toNerf.stream().map(ResourceLocation::new).map(Item.REGISTRY::getObject).filter(i -> i != null).forEach(CoreInit::nerfTool);
Config.initFluids();
Config.printWarnings();
long time = System.currentTimeMillis() - tM;
log.info("Post Initialization took in " + time + " milliseconds");
}
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:74,代码来源:CoreInit.java
示例7: updateCheckResult
import net.minecraftforge.common.ForgeVersion.Status; //导入依赖的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.Status类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论