本文整理汇总了Java中codechicken.core.CCUpdateChecker类的典型用法代码示例。如果您正苦于以下问题:Java CCUpdateChecker类的具体用法?Java CCUpdateChecker怎么用?Java CCUpdateChecker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CCUpdateChecker类属于codechicken.core包,在下文中一共展示了CCUpdateChecker类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import codechicken.core.CCUpdateChecker; //导入依赖的package包/类
@Subscribe
public void init(FMLInitializationEvent event) {
if (event.getSide().isClient()) {
if (config.getTag("checkUpdates").getBooleanValue(true))
CCUpdateChecker.updateCheck(getModId());
notificationCheck();
FMLCommonHandler.instance().bus().register(new CCCEventHandler());
}
}
示例2: notificationCheck
import codechicken.core.CCUpdateChecker; //导入依赖的package包/类
private void notificationCheck() {
final ConfigTag tag = config.getTag("checkNotifications").setComment("The most recent notification number recieved. -1 to disable");
final int notify = tag.getIntValue(0);
if(notify < 0)
return;
CCUpdateChecker.updateCheck(
"http://www.chickenbones.net/Files/notification/general.php",
new Function<String, Void>()
{
@Override
public Void apply(String ret) {
Matcher m = Pattern.compile("Ret \\((\\d+)\\): (.+)").matcher(ret);
if (!m.matches()) {
CodeChickenCorePlugin.logger.error("Failed to check notifications: " + ret);
return null;
}
int index = Integer.parseInt(m.group(1));
if(index > notify) {
tag.setIntValue(index);
CCUpdateChecker.addUpdateMessage(m.group(2));
}
return null;
}
});
}
示例3: clientTick
import codechicken.core.CCUpdateChecker; //导入依赖的package包/类
@SubscribeEvent
public void clientTick(TickEvent.ClientTickEvent event) {
if(event.phase == Phase.END) {
CCUpdateChecker.tick();
renderTime++;
}
}
示例4: init
import codechicken.core.CCUpdateChecker; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
if (event.getSide().isClient()) {
if (config.getTag("checkUpdates").getBooleanValue(true)) {
CCUpdateChecker.updateCheck("CodeChickenCore");
}
MinecraftForge.EVENT_BUS.register(new CCCEventHandler());
}
}
示例5: clientTick
import codechicken.core.CCUpdateChecker; //导入依赖的package包/类
@SubscribeEvent
public void clientTick(TickEvent.ClientTickEvent event) {
if (event.phase == Phase.END) {
CCUpdateChecker.tick();
}
}