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


Java VersionRange类代码示例

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


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

示例1: isAcceptibleVersion

import cpw.mods.fml.common.versioning.VersionRange; //导入依赖的package包/类
public boolean isAcceptibleVersion(final String version) {
	try {
		final VersionRange range = VersionRange.createFromVersionSpec(version);
		return range.containsVersion(this.mod.getArtifactVersion());
	} catch (InvalidVersionSpecificationException e) {
		e.printStackTrace();
		return false;
	}
}
 
开发者ID:OreCruncher,项目名称:ThermalRecycling,代码行数:10,代码来源:ModPlugin.java

示例2: isModLoaded

import cpw.mods.fml.common.versioning.VersionRange; //导入依赖的package包/类
public static boolean isModLoaded(String modid, String versionRangeString) {
    if (!isModLoaded(modid)) {
        return false;
    }
    
    ModContainer mod = Loader.instance().getIndexedModList().get(modid);
    VersionRange versionRange = VersionParser.parseRange(versionRangeString);
    DefaultArtifactVersion required = new DefaultArtifactVersion(modid, versionRange);
    
    return required.containsVersion(mod.getProcessedVersion());
}
 
开发者ID:Tonius,项目名称:NEI-Integration,代码行数:12,代码来源:Utils.java

示例3: acceptableMinecraftVersionRange

import cpw.mods.fml.common.versioning.VersionRange; //导入依赖的package包/类
@Override
public VersionRange acceptableMinecraftVersionRange()
{
	return VersionParser.parseRange(MicdoodlePlugin.mcVersion);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:6,代码来源:MicdoodleModContainer.java

示例4: acceptableMinecraftVersionRange

import cpw.mods.fml.common.versioning.VersionRange; //导入依赖的package包/类
@Override
public VersionRange acceptableMinecraftVersionRange() {
    return VersionParser.parseRange(CodeChickenCorePlugin.mcVersion);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:5,代码来源:NEIModContainer.java

示例5: acceptableMinecraftVersionRange

import cpw.mods.fml.common.versioning.VersionRange; //导入依赖的package包/类
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return wrappedContainer.acceptableMinecraftVersionRange();
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:6,代码来源:InjectedModContainer.java

示例6: getStaticVersionRange

import cpw.mods.fml.common.versioning.VersionRange; //导入依赖的package包/类
public VersionRange getStaticVersionRange()
{
    return staticRange;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:5,代码来源:MinecraftDummyContainer.java

示例7: acceptableMinecraftVersionRange

import cpw.mods.fml.common.versioning.VersionRange; //导入依赖的package包/类
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:6,代码来源:DummyModContainer.java

示例8: acceptableMinecraftVersionRange

import cpw.mods.fml.common.versioning.VersionRange; //导入依赖的package包/类
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return minecraftAccepted;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:6,代码来源:FMLModContainer.java

示例9: acceptableMinecraftVersionRange

import cpw.mods.fml.common.versioning.VersionRange; //导入依赖的package包/类
public VersionRange acceptableMinecraftVersionRange() {
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
 
开发者ID:CyberdyneCC,项目名称:ThermosRebased,代码行数:4,代码来源:FanDefaultModContainer.java

示例10: acceptableMinecraftVersionRange

import cpw.mods.fml.common.versioning.VersionRange; //导入依赖的package包/类
public VersionRange acceptableMinecraftVersionRange() {
    return this.mContainer.acceptableMinecraftVersionRange();
}
 
开发者ID:CyberdyneCC,项目名称:ThermosRebased,代码行数:4,代码来源:ModContainerWrapper.java

示例11: createFromVersionSpec

import cpw.mods.fml.common.versioning.VersionRange; //导入依赖的package包/类
public static VersionRange createFromVersionSpec(String label, String spec) throws InvalidVersionSpecificationException {

		if (spec == null) {
			return null;
		}

		List<Restriction> restrictions = new ArrayList<Restriction>();
		String process = spec;
		ArtifactVersion version = null;
		ArtifactVersion upperBound = null;
		ArtifactVersion lowerBound = null;

		while (process.startsWith("[") || process.startsWith("(")) {

			int index1 = process.indexOf(')');
			int index2 = process.indexOf(']');

			int index = index2;
			if (((index2 < 0) | index1 < index2) & index1 >= 0) {
				index = index1;
			}

			if (index < 0) {
				throw new InvalidVersionSpecificationException("Unbounded range: " + spec);
			}

			Restriction restriction = parseRestriction(label, process.substring(0, index + 1));
			if (lowerBound == null) {
				lowerBound = restriction.getLowerBound();
			}
			if (upperBound != null) {
				if (restriction.getLowerBound() == null || restriction.getLowerBound().compareTo(upperBound) < 0) {
					throw new InvalidVersionSpecificationException("Ranges overlap: " + spec);
				}
			}
			restrictions.add(restriction);
			upperBound = restriction.getUpperBound();

			process = process.substring(index + 1).trim();

			if (process.length() > 0 && process.startsWith(",")) {
				process = process.substring(1).trim();
			}
		}

		if (process.length() > 0) {
			if (restrictions.size() > 0) {
				throw new InvalidVersionSpecificationException("Only fully-qualified sets allowed in multiple set scenario: " + spec);
			} else {
				version = getArtifactVersion(label, process);
				restrictions.add(Restriction.EVERYTHING);
			}
		}

		try {
			return VersionRange.newRange(version, restrictions);
		} catch (Throwable e) {
			e.printStackTrace();
		}
		return null;
	}
 
开发者ID:AdvancedMods,项目名称:AMCore,代码行数:62,代码来源:ModRange.java

示例12: acceptableMinecraftVersionRange

import cpw.mods.fml.common.versioning.VersionRange; //导入依赖的package包/类
@Override
public VersionRange acceptableMinecraftVersionRange() {
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
 
开发者ID:CannibalVox,项目名称:TechnicBlocks,代码行数:5,代码来源:TechnicBlockModContainer.java


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