• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EnumTemperature类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getSuitableBiomeIds

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public ArrayList<Integer> getSuitableBiomeIds() {
	EnumTemperature temperature = genome.getPrimaryAsBee().getTemperature();
	EnumTolerance temperatureTolerance = genome.getToleranceTemp();

	ArrayList<EnumTemperature> toleratedTemperatures = ClimateHelper.getToleratedTemperature(temperature, temperatureTolerance);

	EnumHumidity humidity = genome.getPrimaryAsBee().getHumidity();
	EnumTolerance humidityTolerance = genome.getToleranceHumid();

	ArrayList<EnumHumidity> toleratedHumidities = ClimateHelper.getToleratedHumidity(humidity, humidityTolerance);

	ArrayList<Integer> biomeIdsTemp = new ArrayList<Integer>();
	for (EnumTemperature temp : toleratedTemperatures) {
		biomeIdsTemp.addAll(EnumTemperature.getBiomeIds(temp));
	}

	ArrayList<Integer> biomeIdsHumid = new ArrayList<Integer>();
	for (EnumHumidity humid : toleratedHumidities) {
		biomeIdsHumid.addAll(EnumHumidity.getBiomeIds(humid));
	}

	biomeIdsTemp.retainAll(biomeIdsHumid);

	return biomeIdsTemp;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:27,代码来源:Bee.java


示例2: generate

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public boolean generate(World world, Random random, int i, int j, int k) {

	BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
	if (!EnumTemperature.getBiomeIds(EnumTemperature.HOT).contains(biome.biomeID) || !EnumHumidity.getBiomeIds(EnumHumidity.ARID).contains(biome.biomeID))
		return false;

	int i1 = (i + random.nextInt(8)) - random.nextInt(8);
	int j1 = (j + random.nextInt(4)) - random.nextInt(4);
	int k1 = (k + random.nextInt(8)) - random.nextInt(8);
	if (world.isAirBlock(i1, j1, k1) && world.isAirBlock(i1, j1 + 1, k1) && GlobalManager.sandBlockIds.contains(world.getBlockId(i1, j1 - 1, k1))) {
		setHive(world, i1, j1, k1, 3);
		return true;
	}

	return false;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:18,代码来源:WorldGenHiveParched.java


示例3: generate

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public boolean generate(World world, Random random, int i, int j, int k) {

	BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
	if (!EnumTemperature.getBiomeIds(EnumTemperature.NORMAL).contains(biome.biomeID))
		return false;
	if (!EnumHumidity.getBiomeIds(EnumHumidity.DAMP).contains(biome.biomeID))
		return false;

	int i1 = (i + random.nextInt(8)) - random.nextInt(8);
	int j1 = (j + random.nextInt(4)) - random.nextInt(4);
	int k1 = (k + random.nextInt(8)) - random.nextInt(8);
	if (world.isAirBlock(i1, j1, k1) && world.isAirBlock(i1, j1 + 1, k1) && GlobalManager.dirtBlockIds.contains(world.getBlockId(i1, j1 - 1, k1))) {
		setHive(world, i1, j1, k1, 7);
		return true;
	}

	return false;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:20,代码来源:WorldGenHiveSwamp.java


示例4: generate

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public boolean generate(World world, Random random, int i, int j, int k) {

	BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
	if (!EnumTemperature.getBiomeIds(EnumTemperature.NORMAL).contains(biome.biomeID))
		return false;
	if (!EnumHumidity.getBiomeIds(EnumHumidity.NORMAL).contains(biome.biomeID))
		return false;

	int i1 = (i + random.nextInt(8)) - random.nextInt(8);
	int j1 = (j + random.nextInt(4)) - random.nextInt(4);
	int k1 = (k + random.nextInt(8)) - random.nextInt(8);
	if (world.isAirBlock(i1, j1, k1) && world.isAirBlock(i1, j1 + 1, k1) && GlobalManager.dirtBlockIds.contains(world.getBlockId(i1, j1 - 1, k1))) {
		setHive(world, i1, j1, k1, 2);
		return true;
	}

	return false;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:20,代码来源:WorldGenHiveMeadows.java


示例5: generate

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public boolean generate(World world, Random random, int i, int j, int k) {

	BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
	if (!EnumTemperature.getBiomeIds(EnumTemperature.NORMAL).contains(biome.biomeID))
		return false;
	if (!EnumHumidity.getBiomeIds(EnumHumidity.NORMAL).contains(biome.biomeID))
		return false;

	int i1 = (i + random.nextInt(8)) - random.nextInt(8);
	int j1 = (j + random.nextInt(4)) - random.nextInt(4);
	int k1 = (k + random.nextInt(8)) - random.nextInt(8);
	if (!world.isAirBlock(i1, j1, k1))
		return false;

	if (!GlobalManager.leafBlockIds.contains(world.getBlockId(i1, j1 + 1, k1)))
		return false;

	if (world.isAirBlock(i1, j1 - 1, k1)) {
		setHive(world, i1, j1, k1, 1);
		return true;
	}

	return false;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:26,代码来源:WorldGenHiveForest.java


示例6: generate

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public boolean generate(World world, Random random, int i, int j, int k) {

	BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
	if (!EnumTemperature.getBiomeIds(EnumTemperature.WARM).contains(biome.biomeID) || !EnumHumidity.getBiomeIds(EnumHumidity.DAMP).contains(biome.biomeID))
		return false;

	int i1 = (i + random.nextInt(8)) - random.nextInt(8);
	int j1 = (j + random.nextInt(4)) - random.nextInt(4);
	int k1 = (k + random.nextInt(8)) - random.nextInt(8);

	if (!GlobalManager.leafBlockIds.contains(world.getBlockId(i1, j1 + 1, k1)))
		return false;

	if (world.isAirBlock(i1, j1, k1) && world.isAirBlock(i1, j1 - 1, k1) && world.isAirBlock(i1, j1 - 2, k1)) {
		setHive(world, i1, j1, k1, 4);
		return true;
	}

	return false;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:22,代码来源:WorldGenHiveJungle.java


示例7: generate

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public boolean generate(World world, Random random, int i, int j, int k) {

	BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
	if (!EnumTemperature.getBiomeIds(EnumTemperature.ICY).contains(biome.biomeID)
			&& !EnumTemperature.getBiomeIds(EnumTemperature.COLD).contains(biome.biomeID))
		return false;

	int i1 = (i + random.nextInt(8)) - random.nextInt(8);
	int j1 = (j + random.nextInt(4)) - random.nextInt(4);
	int k1 = (k + random.nextInt(8)) - random.nextInt(8);
	if (world.isAirBlock(i1, j1 + 1, k1) && GlobalManager.dirtBlockIds.contains(world.getBlockId(i1, j1 - 1, k1))) {
		setHive(world, i1, j1, k1, 6);
		world.setBlock(i1, j1 + 1, k1, Block.snow.blockID);
		return true;
	}

	return false;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:20,代码来源:WorldGenHiveSnow.java


示例8: draw

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public void draw(int x, int y) {

	EnumTemperature temperature = tile.getTemperature();

	// Draw background
	drawBackground(x, y);

	// Draw icon
	drawIcon(Defaults.TEXTURE_HABITATS, temperature.getIconIndex(), x + 3, y + 4);

	if (!isFullyOpened())
		return;

	manager.minecraft.fontRenderer.drawStringWithShadow(StringUtil.localize("gui.climate"), x + 22, y + 8,
			manager.gui.fontColor.get("ledger.climate.header"));
	manager.minecraft.fontRenderer.drawStringWithShadow(StringUtil.localize("gui.temperature") + ":", x + 22, y + 20,
			manager.gui.fontColor.get("ledger.climate.subheader"));
	manager.minecraft.fontRenderer.drawString(ClimateHelper.toDisplay(temperature) + " " + StringUtil.floatAsPercent(tile.getExactTemperature()), x + 22, y + 32,
			manager.gui.fontColor.get("ledger.climate.text"));
	manager.minecraft.fontRenderer.drawStringWithShadow(StringUtil.localize("gui.humidity") + ":", x + 22, y + 44,
			manager.gui.fontColor.get("ledger.climate.subheader"));
	manager.minecraft.fontRenderer.drawString(
			ClimateHelper.toDisplay(tile.getHumidity()) + " " + StringUtil.floatAsPercent(tile.getExactHumidity()), x + 22, y + 56,
			manager.gui.fontColor.get("ledger.climate.text"));
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:27,代码来源:ClimateLedger.java


示例9: BeeSpecies

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour, int secondColour,
		EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean hasGlowEffect, boolean isSpeciesSecret, boolean isSpeciesCounted,
		boolean isSpeciesDominant, boolean isSpeciesNocturnal) {

	String uid = "magicbees.species" + speciesName;

	this.temperature = preferredTemp;
	this.humidity = preferredHumidity;

	IBeeFactory beeFactory = forestry.api.apiculture.BeeManager.beeFactory;
	this.species = beeFactory.createSpecies(uid, isSpeciesDominant, authority, uid, uid + ".description", classification, genusName, firstColour, secondColour);

	this.species.setTemperature(preferredTemp);
	this.species.setHumidity(preferredHumidity);

	if (isSpeciesNocturnal) {
		this.species.setNocturnal();
	}
	if (hasGlowEffect) {
		this.species.setHasEffect();
	}
	if (isSpeciesSecret) {
		this.species.setIsSecret();
	}
	if (!isSpeciesCounted) {
		this.species.setIsNotCounted();
	}

	classification.addMemberSpecies(species);
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:31,代码来源:BeeSpecies.java


示例10: getTemperature

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public EnumTemperature getTemperature() {
	if(this.biomeId == BiomeGenBase.hell.biomeID)
		return EnumTemperature.HELLISH;
	
	return ClimateHelper.getTemperature(getExactTemperature());
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:8,代码来源:TileFarmPlain.java


示例11: isJubilant

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public boolean isJubilant(IAlleleBeeSpecies species, IBeeGenome genome, IBeeHousing housing) {

	if (!EnumTemperature.getBiomeIds(species.getTemperature()).contains(housing.getBiomeId()))
		return false;

	if (!EnumHumidity.getBiomeIds(species.getHumidity()).contains(housing.getBiomeId()))
		return false;

	return true;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:12,代码来源:JubilanceDefault.java


示例12: getTemperature

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public EnumTemperature getTemperature() {
	if(this.biomeId == BiomeGenBase.hell.biomeID
			&& tempChange >= 0)
		return EnumTemperature.HELLISH;
	
	return ClimateHelper.getTemperature(getExactTemperature());
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:9,代码来源:TileAlvearyPlain.java


示例13: getTemperature

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
public static EnumTemperature getTemperature(float temperature) {
	if (temperature >= 2.0f)
		return EnumTemperature.HOT;
	else if (temperature >= 1.2f)
		return EnumTemperature.WARM;
	else if (temperature >= 0.2f)
		return EnumTemperature.NORMAL;
	else if (temperature >= 0.05f)
		return EnumTemperature.COLD;
	else
		return EnumTemperature.ICY;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:13,代码来源:ClimateHelper.java


示例14: getTemperature

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public EnumTemperature getTemperature() {
	if (machine != null)
		return machine.getTemperature();
	else
		return EnumTemperature.NORMAL;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:8,代码来源:TileMachine.java


示例15: addClimateInfo

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
private static void addClimateInfo()
{
    //Normal Bees
    EnumTemperature.normalBiomeIds.add(Config.biomeLushHillsID);
    EnumHumidity.normalBiomeIds.add(Config.biomeLushHillsID);
    //Hell Bees
    EnumTemperature.hotBiomeIds.add(Config.biomeTreacherousHillsID);
    EnumHumidity.aridBiomeIds.add(Config.biomeTreacherousHillsID);
}
 
开发者ID:JennyLeeP,项目名称:JLPModJam,代码行数:10,代码来源:ForestryCompatibility.java


示例16: getEnumTemperatureFromValue

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
public static EnumTemperature getEnumTemperatureFromValue(float rawTemp) {
	return EnumTemperature.getFromValue(rawTemp);
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:4,代码来源:ForestryHelper.java


示例17: canWorkInTemperature

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
public boolean canWorkInTemperature(EnumTemperature temp) {
	IAlleleTolerance tolerance = (IAlleleTolerance) genomeTemplate[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()];
	return AlleleManager.climateHelper
			.isWithinLimits(temp, EnumHumidity.NORMAL, temperature, tolerance.getValue(), EnumHumidity.NORMAL, EnumTolerance.NONE);
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:6,代码来源:BeeSpecies.java


示例18: canWorkInHumidity

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
public boolean canWorkInHumidity(EnumHumidity humid) {
	IAlleleTolerance tolerance = (IAlleleTolerance) genomeTemplate[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()];
	return AlleleManager.climateHelper.isWithinLimits(EnumTemperature.NORMAL, humid, EnumTemperature.NORMAL, EnumTolerance.NONE, humidity,
			tolerance.getValue());
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:6,代码来源:BeeSpecies.java


示例19: getTemperature

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public EnumTemperature getTemperature() {
    return EnumTemperature.getFromBiome(getBiome(), xCoord, yCoord, zCoord);
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:5,代码来源:TileEntityMagicApiary.java


示例20: getTemperature

import forestry.api.core.EnumTemperature; //导入依赖的package包/类
@Override
public EnumTemperature getTemperature() {
	return EnumTemperature.getFromBiome(biome, jarEntity.xCoord, jarEntity.yCoord, jarEntity.zCoord);
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:5,代码来源:EffectJarHousing.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ClassDef类代码示例发布时间:2022-05-23
下一篇:
Java TextProvider类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap