本文整理汇总了Java中forestry.api.core.EnumHumidity类的典型用法代码示例。如果您正苦于以下问题:Java EnumHumidity类的具体用法?Java EnumHumidity怎么用?Java EnumHumidity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EnumHumidity类属于forestry.api.core包,在下文中一共展示了EnumHumidity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getSuitableBiomeIds
import forestry.api.core.EnumHumidity; //导入依赖的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.EnumHumidity; //导入依赖的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.EnumHumidity; //导入依赖的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.EnumHumidity; //导入依赖的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.EnumHumidity; //导入依赖的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.EnumHumidity; //导入依赖的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: BeeSpecies
import forestry.api.core.EnumHumidity; //导入依赖的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
示例8: MachineRaintank
import forestry.api.core.EnumHumidity; //导入依赖的package包/类
public MachineRaintank(TileMachine tile) {
super(tile);
setHints(Config.hints.get("raintank"));
// Raintanks in desert and snow biomes are useless
if (tile.worldObj != null) {
BiomeGenBase biome = tile.worldObj.getBiomeGenForCoords(tile.xCoord, tile.zCoord);
if (ClimateHelper.getHumidity(biome.rainfall) == EnumHumidity.ARID) {
setErrorState(EnumErrorCode.INVALIDBIOME);
isValidBiome = false;
}
}
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:14,代码来源:MachineRaintank.java
示例9: isJubilant
import forestry.api.core.EnumHumidity; //导入依赖的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
示例10: isWorking
import forestry.api.core.EnumHumidity; //导入依赖的package包/类
@Override
public int isWorking(IBeeHousing housing) {
World world = housing.getWorld();
// / Rain needs tolerant flyers
if (world.isRaining() && !genome.getTolerantFlyer() && housing.getHumidity() != EnumHumidity.ARID && !housing.isSealed())
return EnumErrorCode.ISRAINING.ordinal();
// / Night or darkness requires nocturnal species
if (!world.isDaytime() && !genome.getNocturnal() && !housing.isSelfLighted())
return EnumErrorCode.NOTDAY.ordinal();
if (world.getBlockLightValue(housing.getXCoord(), housing.getYCoord() + 2, housing.getZCoord()) <= Defaults.APIARY_MIN_LEVEL_LIGHT
&& !genome.getNocturnal() && !housing.isSelfLighted())
return EnumErrorCode.NOTLUCID.ordinal();
// / No sky, except if in hell
if (housing.getBiomeId() != BiomeGenBase.hell.biomeID && !world.canBlockSeeTheSky(housing.getXCoord(), housing.getYCoord() + 3, housing.getZCoord())
&& !genome.getCaveDwelling() && !housing.isSunlightSimulated())
return EnumErrorCode.NOSKY.ordinal();
// / And finally biome check
if (!checkBiomeHazard(world, housing.getTemperature(), housing.getHumidity(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord()))
return EnumErrorCode.INVALIDBIOME.ordinal();
return EnumErrorCode.OK.ordinal();
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:28,代码来源:Bee.java
示例11: getHumidity
import forestry.api.core.EnumHumidity; //导入依赖的package包/类
public static EnumHumidity getHumidity(float humidity) {
if (humidity >= 0.9f)
return EnumHumidity.DAMP;
else if (humidity >= 0.3f)
return EnumHumidity.NORMAL;
else
return EnumHumidity.ARID;
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:9,代码来源:ClimateHelper.java
示例12: getHumidity
import forestry.api.core.EnumHumidity; //导入依赖的package包/类
@Override
public EnumHumidity getHumidity() {
if (machine != null)
return machine.getHumidity();
else
return EnumHumidity.NORMAL;
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:8,代码来源:TileMachine.java
示例13: addClimateInfo
import forestry.api.core.EnumHumidity; //导入依赖的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
示例14: getEnumHumidityFromValue
import forestry.api.core.EnumHumidity; //导入依赖的package包/类
public static EnumHumidity getEnumHumidityFromValue(float rawHumidity) {
return EnumHumidity.getFromValue(rawHumidity);
}
开发者ID:MagicBees,项目名称:MagicBees,代码行数:4,代码来源:ForestryHelper.java
示例15: canWorkInTemperature
import forestry.api.core.EnumHumidity; //导入依赖的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
示例16: canWorkInHumidity
import forestry.api.core.EnumHumidity; //导入依赖的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
示例17: getHumidity
import forestry.api.core.EnumHumidity; //导入依赖的package包/类
@Override
public EnumHumidity getHumidity() {
return EnumHumidity.getFromValue(getExactHumidity());
}
开发者ID:MagicBees,项目名称:MagicBees,代码行数:5,代码来源:TileEntityMagicApiary.java
示例18: getHumidity
import forestry.api.core.EnumHumidity; //导入依赖的package包/类
@Override
public EnumHumidity getHumidity() {
return EnumHumidity.getFromValue(biome.rainfall);
}
开发者ID:MagicBees,项目名称:MagicBees,代码行数:5,代码来源:EffectJarHousing.java
示例19: restrictHumidity
import forestry.api.core.EnumHumidity; //导入依赖的package包/类
/** Require a specific humidity for this mutation to occur */
IMutationCustom restrictHumidity(EnumHumidity humidity);
开发者ID:ForestryMC,项目名称:ForestryAPI,代码行数:3,代码来源:IMutationCustom.java
示例20: getHumidity
import forestry.api.core.EnumHumidity; //导入依赖的package包/类
@Override
public EnumHumidity getHumidity() {
return EnumHumidity.NORMAL;
}
开发者ID:TeamMetallurgy,项目名称:Metallurgy-Bees,代码行数:5,代码来源:AlleleBeeSpecies.java
注:本文中的forestry.api.core.EnumHumidity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论