本文整理汇总了Java中org.inventivetalent.update.spiget.comparator.VersionComparator类的典型用法代码示例。如果您正苦于以下问题:Java VersionComparator类的具体用法?Java VersionComparator怎么用?Java VersionComparator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VersionComparator类属于org.inventivetalent.update.spiget.comparator包,在下文中一共展示了VersionComparator类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkUpdate
import org.inventivetalent.update.spiget.comparator.VersionComparator; //导入依赖的package包/类
private void checkUpdate(){
SpigetUpdate updater = new SpigetUpdate(this,18431);
updater.setVersionComparator(VersionComparator.SEM_VER);
updater.checkForUpdate(new UpdateCallback() {
@Override
public void updateAvailable(String newVersion, String downloadUrl, boolean hasDirectDownload) {
if(instance.getConfig().getBoolean("AutoUpdate")) {
if (hasDirectDownload) {
if (updater.downloadUpdate()) {
getLogger().info("New version of the plugin downloaded and will be loaded on restart");
} else {
getLogger().warning("Update download failed, reason is " + updater.getFailReason());
}
}
}else{
getLogger().info("There is an update available please go download it");
}
}
@Override
public void upToDate() {
getLogger().info("You are using the latest version thanks");
}
});
}
开发者ID:Qballl,项目名称:WildernessTp,代码行数:26,代码来源:Wild.java
示例2: checker
import org.inventivetalent.update.spiget.comparator.VersionComparator; //导入依赖的package包/类
private void checker() {
SpigetUpdate updater = new SpigetUpdate(this.plugin, 31850);
// This converts a semantic version to an integer and checks if the
// updated version is greater
updater.setVersionComparator(VersionComparator.SEM_VER);
updater.checkForUpdate(new UpdateCallback() {
@Override
public void updateAvailable(String newVersion, String downloadUrl, boolean hasDirectDownload) {
isAvailable = true;
version = newVersion;
plugin.getLogger().info("A new update is available. Version: " + newVersion);
}
@Override
public void upToDate() {
isAvailable = false;
}
});
}
开发者ID:MineGaming,项目名称:cubit,代码行数:24,代码来源:SpigetUpdateCheck.java
示例3: UpdateUtils
import org.inventivetalent.update.spiget.comparator.VersionComparator; //导入依赖的package包/类
public UpdateUtils(Plugin plugin) {
su = new SpigetUpdate(plugin, 20873);
su.setVersionComparator(new VersionComparator() {
@Override
public boolean isNewer(String currentVersion, String checkVersion) {
long currentVersionLong = convertVersionToLong(currentVersion);
long checkVersionLong = convertVersionToLong(checkVersion);
return checkVersionLong > currentVersionLong;
}
});
}
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:13,代码来源:UpdateUtils.java
示例4: onEnable
import org.inventivetalent.update.spiget.comparator.VersionComparator; //导入依赖的package包/类
@Override
public void onEnable() {
saveDefaultConfig();
NPCLib.logger = getLogger();
APIManager.initAPI(NPCLib.class);
pluginNpcRegistry = NPCLib.createRegistry(this);
Bukkit.getPluginManager().registerEvents(this, this);
PluginAnnotations.COMMAND.load(this, new SpawnCommands(this));
new Metrics(this);
SpigetUpdate spigetUpdate = new SpigetUpdate(this, 5853).setUserAgent("NPCLib/" + getDescription().getVersion()).setVersionComparator(VersionComparator.SEM_VER);
spigetUpdate.checkForUpdate(new UpdateCallback() {
@Override
public void updateAvailable(String s, String s1, boolean b) {
getLogger().info("A new version is available (" + s + "). Download it from https://r.spiget.org/5853");
}
@Override
public void upToDate() {
getLogger().info("The plugin is up-to-date.");
}
});
}
开发者ID:InventivetalentDev,项目名称:CompactNPCLib,代码行数:28,代码来源:NPCLibPlugin.java
示例5: setVersionComparator
import org.inventivetalent.update.spiget.comparator.VersionComparator; //导入依赖的package包/类
@Override
public SpigetUpdate setVersionComparator(VersionComparator comparator) {
super.setVersionComparator(comparator);
return this;
}
开发者ID:InventivetalentDev,项目名称:SpigetUpdater,代码行数:6,代码来源:SpigetUpdate.java
示例6: setVersionComparator
import org.inventivetalent.update.spiget.comparator.VersionComparator; //导入依赖的package包/类
public SpigetUpdateAbstract setVersionComparator(VersionComparator comparator) {
this.versionComparator = comparator;
return this;
}
开发者ID:InventivetalentDev,项目名称:SpigetUpdater,代码行数:5,代码来源:SpigetUpdateAbstract.java
示例7: onEnable
import org.inventivetalent.update.spiget.comparator.VersionComparator; //导入依赖的package包/类
@Override
public void onEnable() {
if (!Bukkit.getPluginManager().isPluginEnabled("MapManager")) {
getLogger().warning("**************************************************");
getLogger().warning(" ");
getLogger().warning(" This plugin depends on MapManager ");
getLogger().warning(" https://r.spiget.org/19198 ");
getLogger().warning(" ");
getLogger().warning("**************************************************");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
saveDefaultConfig();
PluginAnnotations.CONFIG.load(this, this);
PluginAnnotations.COMMAND.load(this, new Commands(this));
frameManager = new FrameManager(this);
frameExecutor = Executors.newCachedThreadPool();
Bukkit.getPluginManager().registerEvents(interactListener = new InteractListener(this), this);
Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);
getLogger().fine("Waiting 2 seconds before loading data...");
Bukkit.getScheduler().runTaskLaterAsynchronously(this, new Runnable() {
@Override
public void run() {
getLogger().info("Loading data...");
frameExecutor.execute(new Runnable() {
@Override
public void run() {
frameManager.readFramesFromFile();
getLogger().info("Loaded " + frameManager.size() + " frames.");
}
});
}
}, 40);
new Metrics(this);
spigetUpdate = new SpigetUpdate(this, 5583).setUserAgent("AnimatedFrames/" + getDescription().getVersion()).setVersionComparator(VersionComparator.SEM_VER);
spigetUpdate.checkForUpdate(new UpdateCallback() {
@Override
public void updateAvailable(String s, String s1, boolean b) {
updateAvailable = true;
getLogger().info("A new version is available (" + s + "). Download it from https://r.spiget.org/5583");
// getLogger().info("(If the above version is lower than the installed version, you are probably up-to-date)");
}
@Override
public void upToDate() {
getLogger().info("The plugin is up-to-date.");
}
});
}
开发者ID:InventivetalentDev,项目名称:AnimatedFrames,代码行数:56,代码来源:AnimatedFramesPlugin.java
示例8: setVersionComparator
import org.inventivetalent.update.spiget.comparator.VersionComparator; //导入依赖的package包/类
@Override
public SpigetUpdate setVersionComparator(VersionComparator comparator) {
super.setVersionComparator(comparator);
return this;
}
开发者ID:MineGaming,项目名称:cubit,代码行数:6,代码来源:SpigetUpdate.java
示例9: setVersionComparator
import org.inventivetalent.update.spiget.comparator.VersionComparator; //导入依赖的package包/类
public SpigetUpdateAbstract setVersionComparator(VersionComparator comparator) {
this.versionComparator = comparator;
return this;
}
开发者ID:MineGaming,项目名称:cubit,代码行数:5,代码来源:SpigetUpdateAbstract.java
注:本文中的org.inventivetalent.update.spiget.comparator.VersionComparator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论