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


Java IAlleleBeeSpecies类代码示例

本文整理汇总了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();
	}
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:26,代码来源:BeeManager.java

示例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;
}
 
开发者ID:TeamMetallurgy,项目名称:Metallurgy-Bees,代码行数:20,代码来源:BeeMutation.java

示例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;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:17,代码来源:BreedingManager.java

示例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"));

}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:24,代码来源:GuiImprinter.java

示例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);

	}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:22,代码来源:GuiImprinter.java

示例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;
		}
	}
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:15,代码来源:SubTileBeegonia.java

示例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;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:12,代码来源:ForestryHelper.java

示例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);
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:11,代码来源:BeeManager.java

示例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;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:16,代码来源:BeeManager.java

示例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;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:14,代码来源:JubilanceReqRes.java

示例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;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:12,代码来源:JubilanceDefault.java

示例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"));
	}
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:28,代码来源:Bee.java

示例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]);
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:29,代码来源:Bee.java

示例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;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:11,代码来源:JubilanceProviderHermit.java

示例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[] {});
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:12,代码来源:CommandGiveBee.java


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