本文整理汇总了Java中forestry.api.arboriculture.ITreeGenome类的典型用法代码示例。如果您正苦于以下问题:Java ITreeGenome类的具体用法?Java ITreeGenome怎么用?Java ITreeGenome使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITreeGenome类属于forestry.api.arboriculture包,在下文中一共展示了ITreeGenome类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addGenome
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
protected void addGenome(ItemStack stack, IGenome origGenome, HashMap<String, Object> ret) {
ITreeGenome genome = (ITreeGenome) origGenome;
ret.put("speciesPrimary", genome.getPrimary().getName());
ret.put("speciesSecondary", genome.getSecondary().getName());
ret.put("height", genome.getHeight());
ret.put("fertility", genome.getFertility());
ret.put("yield", genome.getYield());
ret.put("sappiness", genome.getSappiness());
ret.put("matures", genome.getMaturationTime());
ret.put("fruit", genome.getFruitProvider().getDescription());
ret.put("growth", genome.getGrowthProvider().getDescription());
ret.put("girth", genome.getGirth());
ret.put("plant", Util.EnumSetToMap(genome.getPlantTypes()));
ret.put("effect", genome.getEffect().getUID());
}
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:17,代码来源:TileEntityAnalyzerTree.java
示例2: addGenome
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
protected void addGenome(ItemStack stack, IGenome origGenome, Map<String, Object> ret) {
ITreeGenome genome = (ITreeGenome) origGenome;
ret.put("speciesPrimary", genome.getPrimary().getName());
ret.put("speciesSecondary", genome.getSecondary().getName());
ret.put("height", genome.getHeight());
ret.put("fertility", genome.getFertility());
ret.put("yield", genome.getYield());
ret.put("sappiness", genome.getSappiness());
ret.put("matures", genome.getMaturationTime());
ret.put("fruit", genome.getFruitProvider().getDescription());
ret.put("growth", genome.getGrowthProvider().getDescription());
ret.put("girth", genome.getGirth());
ret.put("plant", Util.iterableToMap(genome.getPlantTypes()));
}
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:17,代码来源:TileTreeAnalyzer.java
示例3: hasSufficientSaplings
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
protected boolean hasSufficientSaplings(ITreeGenome genome, World world, int xPos, int yPos, int zPos, int expectedGirth) {
if(expectedGirth == 1)
return true;
int offset = (expectedGirth - 1) / 2;
for (int x = xPos - offset; x < xPos - offset + expectedGirth; x++) {
for (int z = zPos - offset; z < zPos - offset + expectedGirth; z++) {
if(world.isAirBlock(x, yPos, z))
return false;
TileEntity tile = world.getBlockTileEntity(x, yPos, z);
if(!(tile instanceof TileSapling))
return false;
ITree tree = ((TileSapling)tile).getTree();
if(!tree.getGenome().getPrimary().getUID().equals(genome.getPrimary().getUID()))
return false;
}
}
return true;
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:26,代码来源:GrowthProvider.java
示例4: getGrowthConditions
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public EnumGrowthConditions getGrowthConditions(ITreeGenome genome, World world, int xPos, int yPos, int zPos) {
EnumGrowthConditions light = getConditionFromLight(world, xPos, yPos, zPos);
EnumGrowthConditions moisture = getConditionsFromRainfall(world, xPos, yPos, zPos, 0.9f, 2.0f);
EnumGrowthConditions temperature = getConditionsFromTemperature(world, xPos, yPos, zPos, 1.2f, 1.9f);
EnumSet<EnumGrowthConditions> conditions = EnumSet.of(light, moisture, temperature);
EnumGrowthConditions result = EnumGrowthConditions.HOSTILE;
for(EnumGrowthConditions cond : conditions) {
if(cond == EnumGrowthConditions.HOSTILE)
return EnumGrowthConditions.HOSTILE;
if(cond.ordinal() > result.ordinal())
result = cond;
}
return result;
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:20,代码来源:GrowthProviderTropical.java
示例5: hasRoom
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
protected boolean hasRoom(ITreeGenome genome, World world, int xPos, int yPos, int zPos, int expectedGirth, int expectedHeight) {
int offset = (expectedGirth - 1) / 2;
//if(offset <= 0)
// offset = 1;
return checkArea(world, new Vect(xPos - offset, yPos + 1, zPos + offset), new Vect(-offset + expectedGirth, expectedHeight + 1, -offset + expectedGirth));
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:9,代码来源:GrowthProvider.java
示例6: getFruits
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public ItemStack[] getFruits(ITreeGenome genome, World world, int x, int y, int z, int ripeningTime) {
ArrayList<ItemStack> product = new ArrayList<ItemStack>();
float stage = getRipeningStage(ripeningTime);
if(stage < 0.5f)
return new ItemStack[0];
for(Map.Entry<ItemStack, Float> entry : products.entrySet()) {
if(world.rand.nextFloat() <= genome.getYield() * entry.getValue() * 5.0f * stage)
product.add(entry.getKey().copy());
}
return product.toArray(new ItemStack[0]);
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:16,代码来源:FruitProviderRipening.java
示例7: getColour
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public int getColour(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime) {
float stage = getRipeningStage(ripeningTime);
int r = (colourCallow >> 16 & 255) + (int)(diffR*stage);
int g = (colourCallow >> 8 & 255) + (int)(diffG*stage);
int b = (colourCallow & 255) + (int)(diffB*stage);
//System.out.println(String.format("Calcultated rgb %s/%s/%s from %s and %s, resulting in %s",
// r, g, b, colourCallow, stage, (r & 255) << 16 | (g & 255) << 8 | b & 255));
return (r & 255) << 16 | (g & 255) << 8 | b & 255;
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:13,代码来源:FruitProviderRipening.java
示例8: getFruits
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public ItemStack[] getFruits(ITreeGenome genome, World world, int x, int y, int z, int ripeningTime) {
ArrayList<ItemStack> product = new ArrayList<ItemStack>();
for(Map.Entry<ItemStack, Float> entry : products.entrySet()) {
if(world.rand.nextFloat() <= genome.getYield() * entry.getValue())
product.add(entry.getKey().copy());
}
return product.toArray(new ItemStack[0]);
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:12,代码来源:FruitProviderRandom.java
示例9: TreeGenomeReader
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
public TreeGenomeReader(ITreeGenome genome) {
super(genome);
}
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:4,代码来源:ConverterIIndividual.java
示例10: canGrow
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public boolean canGrow(ITreeGenome genome, World world, int xPos, int yPos, int zPos, int expectedGirth, int expectedHeight) {
return hasRoom(genome, world, xPos, yPos, zPos, expectedGirth, expectedHeight)
&& getGrowthConditions(genome, world, xPos, yPos, zPos) != EnumGrowthConditions.HOSTILE
&& hasSufficientSaplings(genome, world, xPos, yPos, zPos, expectedGirth);
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:7,代码来源:GrowthProvider.java
示例11: getGrowthConditions
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public EnumGrowthConditions getGrowthConditions(ITreeGenome genome, World world, int xPos, int yPos, int zPos) {
return getConditionFromLight(world, xPos, yPos, zPos);
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:5,代码来源:GrowthProvider.java
示例12: Tree
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
public Tree(ITreeGenome genome) {
this.genome = genome;
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:4,代码来源:Tree.java
示例13: getMate
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public ITreeGenome getMate() {
return this.mate;
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:5,代码来源:Tree.java
示例14: getGenome
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public ITreeGenome getGenome() {
return this.genome;
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:5,代码来源:Tree.java
示例15: getTree
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public ITree getTree(World world, ITreeGenome genome) {
return new Tree(genome);
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:5,代码来源:TreeHelper.java
示例16: templateAsGenome
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public ITreeGenome templateAsGenome(IAllele[] template) {
return new TreeGenome(templateAsChromosomes(template));
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:5,代码来源:TreeHelper.java
示例17: templateAsGenome
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
public static ITreeGenome templateAsGenome(IAllele[] template) {
return new TreeGenome(templateAsChromosomes(template));
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:4,代码来源:TreeTemplates.java
示例18: markAsFruitLeaf
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public boolean markAsFruitLeaf(ITreeGenome genome, World world, int x, int y, int z) {
return true;
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:5,代码来源:FruitProviderRipening.java
示例19: getTextureIndex
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public int getTextureIndex(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime, boolean fancy) {
return textureIndex;
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:5,代码来源:FruitProviderRipening.java
示例20: getColour
import forestry.api.arboriculture.ITreeGenome; //导入依赖的package包/类
@Override
public int getColour(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime) {
return colour;
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:5,代码来源:FruitProviderRandom.java
注:本文中的forestry.api.arboriculture.ITreeGenome类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论