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


Java IPollinatable类代码示例

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


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

示例1: isAcceptedPollinatable

import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
	return 0 < pollinatable.getPlantType().size();
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:5,代码来源:FlowerProviderThaumcraftFlower.java

示例2: isAcceptedPollinatable

import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
	return pollinatable.getPlantType().size() > 0;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:5,代码来源:FlowerProviderAuraNode.java

示例3: isAcceptedPollinatable

import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
	EnumSet<EnumPlantType> types = pollinatable.getPlantType();
	return types.size() > 0 && !types.contains(EnumPlantType.Nether) && !types.contains(EnumPlantType.Water);
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:6,代码来源:FlowerProviderBookshelf.java

示例4: isAcceptedPollinatable

import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
	return pollinatable.getPlantType().size() > 1;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:5,代码来源:FlowerProviderArsMagicaFlower.java

示例5: isAcceptedPollinatable

import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
	EnumSet<EnumPlantType> types = pollinatable.getPlantType();
	return (types.size() > 1) || (!types.contains(EnumPlantType.Nether));
}
 
开发者ID:TeamMetallurgy,项目名称:Metallurgy-Bees,代码行数:6,代码来源:FlowerProviderStone.java

示例6: retrievePollen

import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public IIndividual retrievePollen(IBeeHousing housing) {
	
	int chance = (int) (genome.getFlowering()*housing.getFloweringModifier(getGenome()));
	
	// Correct speed
	if (housing.getWorld().rand.nextInt(100) >= chance)
		return null;

	int[] areaAr = genome.getTerritory();
	Vect area = new Vect(areaAr[0], areaAr[1], areaAr[2]).multiply(housing.getTerritoryModifier(genome)).multiply(3.0f);
	Vect offset = new Vect(-Math.round(area.x / 2), -Math.round(area.y / 2), -Math.round(area.z / 2));

	if (area.x < 1) {
		area.x = 1;
	}
	if (area.y < 1) {
		area.y = 1;
	}
	if (area.z < 1) {
		area.z = 1;
	}

	// We have up to ten attempts
	for (int i = 0; i < 20; i++) {

		Vect randomPos = new Vect(housing.getWorld().rand.nextInt(area.x), housing.getWorld().rand.nextInt(area.y), housing.getWorld().rand.nextInt(area.z));

		Vect posBlock = randomPos.add(new Vect(housing.getXCoord(), housing.getYCoord(), housing.getZCoord()));
		posBlock = posBlock.add(offset);
		
		TileEntity tile = housing.getWorld().getBlockTileEntity(posBlock.x, posBlock.y, posBlock.z);
		if(!(tile instanceof IPollinatable)) {
			if(housing.getWorld().isAirBlock(posBlock.x, posBlock.y, posBlock.z))
				continue;
			
			// Test for ersatz genomes
			for(Map.Entry<ItemStack, IIndividual> entry : AlleleManager.ersatzSpecimen.entrySet()) {
				if(entry.getKey().itemID != housing.getWorld().getBlockId(posBlock.x, posBlock.y, posBlock.z))
					continue;
				if(entry.getKey().getItemDamage() != housing.getWorld().getBlockMetadata(posBlock.x, posBlock.y, posBlock.z))
					continue;
				
				// We matched, return ersatz genome
				return entry.getValue().copy();
			}
			
			continue;
		}
		
		IPollinatable pitcher = (IPollinatable)tile;
		if(!genome.getFlowerProvider().isAcceptedPollinatable(housing.getWorld(), pitcher))
			continue;
		
		IIndividual pollen = pitcher.getPollen();

		if(pollen != null)
			return pollen;
	}
	
	return null;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:63,代码来源:Bee.java

示例7: isAcceptedPollinatable

import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
	EnumSet<EnumPlantType> types = pollinatable.getPlantType();
	return types.size() > 1 || !types.contains(EnumPlantType.Nether);
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:6,代码来源:FlowerProviderMushroom.java

示例8: isAcceptedPollinatable

import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
	return pollinatable.getPlantType().contains(EnumPlantType.Desert);
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:5,代码来源:FlowerProviderCacti.java

示例9: isAcceptedPollinatable

import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
	return pollinatable.getPlantType().contains(EnumPlantType.Nether);
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:5,代码来源:FlowerProviderNetherwart.java

示例10: isAcceptedPollinatable

import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
boolean isAcceptedPollinatable(World world, IPollinatable pollinatable); 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:2,代码来源:IFlowerProvider.java


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