本文整理汇总了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();
}
示例2: isAcceptedPollinatable
import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
return pollinatable.getPlantType().size() > 0;
}
示例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);
}
示例4: isAcceptedPollinatable
import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
return pollinatable.getPlantType().size() > 1;
}
示例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));
}
示例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;
}
示例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);
}
示例8: isAcceptedPollinatable
import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
return pollinatable.getPlantType().contains(EnumPlantType.Desert);
}
示例9: isAcceptedPollinatable
import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
return pollinatable.getPlantType().contains(EnumPlantType.Nether);
}
示例10: isAcceptedPollinatable
import forestry.api.genetics.IPollinatable; //导入依赖的package包/类
boolean isAcceptedPollinatable(World world, IPollinatable pollinatable);