本文整理汇总了Java中com.dsh105.echopet.compat.api.util.Version类的典型用法代码示例。如果您正苦于以下问题:Java Version类的具体用法?Java Version怎么用?Java Version使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Version类属于com.dsh105.echopet.compat.api.util包,在下文中一共展示了Version类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onHook
import com.dsh105.echopet.compat.api.util.Version; //导入依赖的package包/类
@Override
public void onHook() {
if(new Version("6.0").isCompatible(getDependency().getDescription().getVersion())){
if (EchoPet.getPlugin().getMainConfig().getBoolean("worldguard.regionEnterCheck", true)) {
this.getHandlingPlugin().getServer().getPluginManager().registerEvents(new RegionListener(), this.getHandlingPlugin());
}
} else {
throw new IllegalStateException("Only WorldGuard 6.0 and after are supported");
}
}
示例2: isValid
import com.dsh105.echopet.compat.api.util.Version; //导入依赖的package包/类
public boolean isValid(){
switch (checkType){
case COMPATIBLE:
return version.isCompatible(new Version());
case SUPPORTED:
return version.isSupported(new Version());
default:
return version.isIdentical(new Version());
}
}
示例3: supportsUuid
import com.dsh105.echopet.compat.api.util.Version; //导入依赖的package包/类
/**
* Returns whether the server version currently running primarily uses UUIDs instead of player names
* <p/>
* UUIDs were introduced into the Bukkit API in 1.7.5
*
* @return true if the server supports the switch to UUIDs
*/
public static boolean supportsUuid() {
try {
Bukkit.class.getDeclaredMethod("getPlayer", UUID.class);
} catch (NoSuchMethodException e) {
return false;
}
return new Version().isCompatible("1.7.5");
}
示例4: onHook
import com.dsh105.echopet.compat.api.util.Version; //导入依赖的package包/类
@Override
public void onHook() {
if (new Version(getDependency().getDescription().getVersion()).isCompatible("6.0")) {
if (EchoPet.getPlugin().getMainConfig().getBoolean("worldguard.regionEnterCheck", true)) {
this.getHandlingPlugin().getServer().getPluginManager().registerEvents(new RegionListener(), this.getHandlingPlugin());
}
} else {
throw new IllegalStateException("Only WorldGuard 6.0 and after are supported");
}
}
示例5: DataMenuType
import com.dsh105.echopet.compat.api.util.Version; //导入依赖的package包/类
private DataMenuType(){
version = new Version();
checkType = VersionCheckType.COMPATIBLE;
}