本文整理汇总了Java中forestry.api.apiculture.IAlleleBeeSpecies类的典型用法代码示例。如果您正苦于以下问题:Java IAlleleBeeSpecies类的具体用法?Java IAlleleBeeSpecies怎么用?Java IAlleleBeeSpecies使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IAlleleBeeSpecies类属于forestry.api.apiculture包,在下文中一共展示了IAlleleBeeSpecies类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateSpeciesListRarity
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
public static void populateSpeciesListRarity() {
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Forest"), 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Meadows"), 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Tropical"), 10.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Modest"), 16.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Wintry"), 10.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Ended"), 0.5));
if (ExtraBeesHelper.isActive()) {
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Water"), 12.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Rock"), 16.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Basalt"), 10.0));
}
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.MYSTICAL.getSpecies(), 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.UNUSUAL.getSpecies(), 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.SORCEROUS.getSpecies(), 13.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.ATTUNED.getSpecies(), 6.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.INFERNAL.getSpecies(), 10.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.OBLIVION.getSpecies(), 1.0));
for (Tuple<IAlleleBeeSpecies, Double> t : worldgenSpeciesWeights) {
worldgenSpeciesWeightsTotal += t.right.doubleValue();
}
}
示例2: getChance
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
@Override
public float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IBeeGenome genome0, IBeeGenome genome1) {
World world = housing.getWorld();
IBeeModifier housingBeeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
IBeeModifier modeBeeModifier = BeeManager.beeRoot.getBeekeepingMode(housing.getWorld()).getBeeModifier();
int processedChance = Math.round(this.chance * housingBeeModifier.getMutationModifier((IBeeGenome) genome0, (IBeeGenome) genome1, 1.0F) * modeBeeModifier.getMutationModifier((IBeeGenome) genome0, (IBeeGenome) genome1, 1.0F));
if(processedChance <= 0.0F) {
return 0.0F;
}
if((this.parent1.getUID().equals(allele0.getUID())) && (this.parent2.getUID().equals(allele1.getUID())))
return processedChance;
if((this.parent2.getUID().equals(allele0.getUID())) && (this.parent1.getUID().equals(allele1.getUID()))) {
return processedChance;
}
return 0.0F;
}
示例3: getBeeSpeciesCount
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
@Override
public int getBeeSpeciesCount() {
if (beeSpeciesCount < 0) {
beeSpeciesCount = 0;
Iterator it = AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet().iterator();
while (it.hasNext()) {
Entry<String, IAllele> entry = (Entry<String, IAllele>) it.next();
if (entry.getValue() instanceof IAlleleBeeSpecies)
if (((IAlleleBeeSpecies) entry.getValue()).isCounted()) {
beeSpeciesCount++;
}
}
}
return beeSpeciesCount;
}
示例4: drawGuiContainerBackgroundLayer
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
container.updateContainer(Proxies.common.getRenderWorld());
drawBackground();
int offset = (138 - fontRenderer.getStringWidth("GENOME IMPRINTER")) / 2;
fontRenderer.drawString("GENOME IMPRINTER", startX + 8 + offset, startY + 16, fontColor.get("gui.screen"));
IAlleleBeeSpecies primary = inventory.getPrimary();
drawBeeSpeciesIcon(primary, startX + 12, startY + 32);
fontRenderer.drawString(primary.getName(), startX + 32, startY + 36, fontColor.get("gui.screen"));
IAlleleBeeSpecies secondary = inventory.getSecondary();
drawBeeSpeciesIcon(secondary, startX + 12, startY + 52);
fontRenderer.drawString(secondary.getName(), startX + 32, startY + 56, fontColor.get("gui.screen"));
String youCheater = "(You Cheater!)";
offset = (138 - fontRenderer.getStringWidth(youCheater)) / 2;
fontRenderer.drawString(youCheater, startX + 8 + offset, startY + 76, fontColor.get("gui.screen"));
}
示例5: drawBeeSpeciesIcon
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
private void drawBeeSpeciesIcon(IAlleleBeeSpecies bee, int x, int y) {
int tex = this.mc.renderEngine.getTexture(Defaults.TEXTURE_BEES);
GL11.glDisable(GL11.GL_LIGHTING);
mc.renderEngine.bindTexture(tex);
for (int i = 0; i < ForestryItem.beeDroneGE.getRenderPasses(0); ++i) {
int iconIndex = ForestryItem.beeDroneGE.getIconIndex(iconStacks.get(bee.getUID()), i);
int color = ((ItemGE) ForestryItem.beeDroneGE).getColorFromItemStack(iconStacks.get(bee.getUID()), i);
float colorR = (color >> 16 & 255) / 255.0F;
float colorG = (color >> 8 & 255) / 255.0F;
float colorB = (color & 255) / 255.0F;
GL11.glColor4f(colorR, colorG, colorB, 1.0F);
drawTexturedModalRect(x, y, iconIndex % 16 * 16, iconIndex / 16 * 16, 16, 16);
}
GL11.glEnable(GL11.GL_LIGHTING);
}
示例6: getSpeciesScaledComplexity
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
private int getSpeciesScaledComplexity(IAlleleBeeSpecies species) {
if (species == null) {
return 0;
}
else {
try {
int halfComplexity = species.getComplexity() / 2;
return (halfComplexity >= 1) ? halfComplexity : 1;
}
catch (NoSuchMethodError error) {
return 1;
}
}
}
示例7: replaceSpecies
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
public static ItemStack replaceSpecies(ItemStack stack, IAlleleBeeSpecies outputSpecies) {
ItemStack copyStack = stack.copy();
NBTTagCompound compound = (NBTTagCompound) copyStack.getTagCompound();
NBTTagCompound genomeCompound = compound.getCompoundTag("Genome");
NBTTagList chromosomeCompoundList = (NBTTagList)genomeCompound.getTag("Chromosomes");
NBTTagCompound speciesCompound = chromosomeCompoundList.getCompoundTagAt(0);
speciesCompound.setString("UID0", outputSpecies.getUID());
speciesCompound.setString("UID1", outputSpecies.getUID());
return copyStack;
}
示例8: getBeeFromSpecies
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
public static IBee getBeeFromSpecies(IAlleleBeeSpecies beeSpecies, boolean applyRainResist) {
IAllele[] speciesTemplate = BeeManager.beeRoot.getTemplate(beeSpecies.getUID());
if (applyRainResist) {
speciesTemplate = BeeGenomeManager.addRainResist(speciesTemplate);
}
IBeeGenome genome = BeeManager.beeRoot.templateAsGenome(speciesTemplate);
return BeeManager.beeRoot.getBee(null, genome);
}
示例9: getRandomWorldgenSpecies
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
public static IAlleleBeeSpecies getRandomWorldgenSpecies(Random r) {
Collections.shuffle(worldgenSpeciesWeights);
double value = r.nextDouble() * worldgenSpeciesWeightsTotal;
IAlleleBeeSpecies species = Allele.getBaseSpecies("Forest");
for (Tuple<IAlleleBeeSpecies, Double> t : worldgenSpeciesWeights) {
value -= t.right.doubleValue();
if (value <= 0.0) {
species = t.left;
break;
}
}
return species;
}
示例10: isJubilant
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
@Override
public boolean isJubilant(IAlleleBeeSpecies species, IBeeGenome genome, IBeeHousing housing) {
if (blockRequired == null)
return true;
int blockid = housing.getWorld().getBlockId(housing.getXCoord(), housing.getYCoord() - 1, housing.getZCoord());
int meta = housing.getWorld().getBlockMetadata(housing.getXCoord(), housing.getYCoord() - 1, housing.getZCoord());
if (blockid == blockRequired.itemID && meta == blockRequired.getItemDamage())
return true;
else
return false;
}
示例11: isJubilant
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的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;
}
示例12: addTooltip
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
@Override
public void addTooltip(List list) {
// No info 4 u!
if (!isAnalyzed) {
list.add("<" + StringUtil.localize("gui.unknown") + ">");
return;
}
// You analyzed it? Juicy tooltip coming up!
IAlleleBeeSpecies primary = genome.getPrimaryAsBee();
IAlleleBeeSpecies secondary = genome.getSecondaryAsBee();
if (!this.isPureBred(EnumBeeChromosome.SPECIES)) {
list.add("\u00A79" + primary.getName() + StringUtil.localize("bees.hyphen.adj.add") + "-" + secondary.getName()
+ StringUtil.localize("bees.hybrid.adj.add") + " " + StringUtil.localize("gui.hybrid"));
}
list.add(rateSpeed(genome.getSpeed()) + " " + StringUtil.localize("gui.worker"));
list.add(rateLifespan(genome.getLifespan()) + " " + StringUtil.localize("gui.life"));
list.add("\u00A7aT: " + ClimateHelper.toDisplay(genome.getPrimaryAsBee().getTemperature()) + " / "
+ StringUtil.capitalize(genome.getToleranceTemp().name()));
list.add("\u00A7aH: " + ClimateHelper.toDisplay(genome.getPrimaryAsBee().getHumidity()) + " / "
+ StringUtil.capitalize(genome.getToleranceHumid().name()));
list.add(StringUtil.localize(genome.getFlowerProvider().getDescription()));
if (genome.getNocturnal()) {
list.add("\u00A7c" + StringUtil.localize("gui.nocturnal"));
}
}
示例13: getProduceList
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
@Override
public ItemStack[] getProduceList() {
ArrayList<ItemStack> products = new ArrayList<ItemStack>();
IAlleleBeeSpecies primary = genome.getPrimaryAsBee();
IAlleleBeeSpecies secondary = genome.getSecondaryAsBee();
products.addAll(primary.getProducts().keySet());
Set<ItemStack> secondaryProducts = secondary.getProducts().keySet();
// Remove duplicates
for (ItemStack second : secondaryProducts) {
boolean skip = false;
for (ItemStack compare : products)
if (second.isItemEqual(compare)) {
skip = true;
break;
}
if (!skip) {
products.add(second);
}
}
return products.toArray(new ItemStack[0]);
}
示例14: isJubilant
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
@Override
public boolean isJubilant(IAlleleBeeSpecies species, IBeeGenome genome, IBeeHousing housing) {
AxisAlignedBB bounding = this.getBounding(genome, housing, 1.0f);
List list = housing.getWorld().getEntitiesWithinAABB(EntityLiving.class, bounding);
if(list.size() > 0)
return false;
return true;
}
示例15: getSpecies
import forestry.api.apiculture.IAlleleBeeSpecies; //导入依赖的package包/类
protected String[] getSpecies() {
List<String> species = new ArrayList<String>();
for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) {
if (allele instanceof IAlleleBeeSpecies) {
species.add(((IAlleleSpecies) allele).getName());
}
}
return species.toArray(new String[] {});
}