Examples of IAlleleBeeSpecies


Examples of forestry.api.apiculture.IAlleleBeeSpecies

        while (it.hasNext()) {
          Entry<String, IAllele> entry = it.next();
          if (!(entry.getValue() instanceof IAlleleBeeSpecies))
            continue;

          IAlleleBeeSpecies species = (IAlleleBeeSpecies) entry.getValue();
          if (!species.getUID().equals(getSpecies().getUID()))
            continue;

          while (it.hasNext()) {
            Entry<String, IAllele> entry2 = it.next();
            if (!(entry2.getValue() instanceof IAlleleBeeSpecies))
              continue;

            IAlleleBeeSpecies next = (IAlleleBeeSpecies) entry2.getValue();
            if (!Config.isDebug && next.isSecret() && !tracker.isDiscovered(next))
              continue;

            change = next;
            break;
          }
View Full Code Here

Examples of forestry.api.apiculture.IAlleleBeeSpecies

    if (arguments.length >= 2) {
      EntityPlayer player = getPlayer(sender, arguments[0]);

      String parameter = arguments[1];

      IAlleleBeeSpecies species = null;

      search: for (String uid : AlleleManager.alleleRegistry.getRegisteredAlleles().keySet()) {

        if (!uid.equals(parameter))
          continue;

        if (AlleleManager.alleleRegistry.getAllele(uid) instanceof IAlleleBeeSpecies) {
          species = (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele(uid);
          break search;
        }
      }

      search: if (species == null)
        for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values())
          if (allele instanceof IAlleleBeeSpecies)
            if (((IAlleleBeeSpecies) allele).getName().equals(parameter)) {
              species = (IAlleleBeeSpecies) allele;
              break search;
            }

      if (species == null)
        throw new SpeciesNotFoundException(parameter);

      IAllele[] template = PluginApiculture.beeInterface.getTemplate(species.getUID());

      if (template == null)
        throw new TemplateNotFoundException(species);

      IBeeGenome genome = PluginApiculture.beeInterface.templateAsGenome(template);
View Full Code Here

Examples of forestry.api.apiculture.IAlleleBeeSpecies

      list.add("<" + StringUtil.localize("gui.unknown") + ">");
      return;
    }

    // You analyzed it? Juicy tooltip coming up!
    IAlleleBeeSpecies primary = genome.getPrimary();
    IAlleleBeeSpecies secondary = genome.getSecondary();
    if (!isPureBred(EnumBeeChromosome.SPECIES.ordinal()))
      list.add("\u00A79" + StringUtil.localize("bees.hybrid").replaceAll("%PRIMARY",primary.getName()).replaceAll("%SECONDARY",secondary.getName()));

    IAllele speed = genome.getActiveAllele(EnumBeeChromosome.SPEED.ordinal());
    String customWorker = "tooltip.worker." + speed.getUnlocalizedName().replaceFirst("gui.", "");
    if (StringUtil.canTranslate(customWorker))
      list.add(StringUtil.localize(customWorker));
View Full Code Here

Examples of forestry.api.apiculture.IAlleleBeeSpecies

  // / PRODUCTION
  @Override
  public ItemStack[] getProduceList() {
    ArrayList<ItemStack> products = new ArrayList<ItemStack>();

    IAlleleBeeSpecies primary = genome.getPrimary();
    IAlleleBeeSpecies secondary = genome.getSecondary();

    products.addAll(primary.getProducts().keySet());

    Set<ItemStack> secondaryProducts = secondary.getProducts().keySet();
    // Remove duplicates
    for (ItemStack second : secondaryProducts) {
      boolean skip = false;

      for (ItemStack compare : products)
View Full Code Here

Examples of forestry.api.apiculture.IAlleleBeeSpecies

      return null;
    }

    ArrayList<ItemStack> products = new ArrayList<ItemStack>();

    IAlleleBeeSpecies primary = genome.getPrimary();
    IAlleleBeeSpecies secondary = genome.getSecondary();

    // All work and no play makes queen a dull girl.
    if(mode.isOverworked(this, housing))
      setIsNatural(false);

    // Bee genetic speed * beehousing * beekeeping mode
    float speed = genome.getSpeed() * housing.getProductionModifier(genome, 1f) * mode.getProductionModifier(genome, 1f);

    // / Primary Products
    for (Map.Entry<ItemStack, Integer> entry : primary.getProducts().entrySet())
      if (housing.getWorld().rand.nextInt(100) < entry.getValue() * speed)
        products.add(entry.getKey().copy());
    // / Secondary Products
    for (Map.Entry<ItemStack, Integer> entry : secondary.getProducts().entrySet())
      if (housing.getWorld().rand.nextInt(100) < Math.round(entry.getValue() / 2) * speed)
        products.add(entry.getKey().copy());

    // We are done if the we are not jubilant.
    if (!primary.isJubilant(genome, housing) || !secondary.isJubilant(genome, housing))
      return products.toArray(StackUtils.EMPTY_STACK_ARRAY);

    // / Specialty products
    for (Map.Entry<ItemStack, Integer> entry : primary.getSpecialty().entrySet())
      if (housing.getWorld().rand.nextInt(100) < entry.getValue() * speed)
 
View Full Code Here

Examples of forestry.api.apiculture.IAlleleBeeSpecies

    super.drawGuiContainerBackgroundLayer(var1, mouseX, mouseY);

    int offset = (138 - fontRendererObj.getStringWidth(StringUtil.localize("gui.imprinter.name"))) / 2;
    fontRendererObj.drawString(StringUtil.localize("gui.imprinter.name"), startX + 8 + offset, startY + 16, fontColor.get("gui.screen"));

    IAlleleBeeSpecies primary = inventory.getPrimary();
    drawBeeSpeciesIcon(primary, startX + 12, startY + 32);
    fontRendererObj.drawString(primary.getName(), startX + 32, startY + 36, fontColor.get("gui.screen"));

    IAlleleBeeSpecies secondary = inventory.getSecondary();
    drawBeeSpeciesIcon(secondary, startX + 12, startY + 52);
    fontRendererObj.drawString(secondary.getName(), startX + 32, startY + 56, fontColor.get("gui.screen"));

    String youCheater = StringUtil.localize("gui.imprinter.cheater");
    offset = (138 - fontRendererObj.getStringWidth(youCheater)) / 2;
    fontRendererObj.drawString(youCheater, startX + 8 + offset, startY + 76, fontColor.get("gui.screen"));
View Full Code Here

Examples of forestry.api.apiculture.IAlleleBeeSpecies

  @SideOnly(Side.CLIENT)
  public IIcon getIconIndexForAlleleId(String uid, int phase) {
    IAllele bSpecies = forestry.api.genetics.AlleleManager.alleleRegistry.getAllele(uid);
    if (!(bSpecies instanceof IAlleleBeeSpecies))
      bSpecies = root.getDefaultTemplate()[forestry.api.apiculture.EnumBeeChromosome.SPECIES.ordinal()];
    IAlleleBeeSpecies species = (IAlleleBeeSpecies) bSpecies;
    return species.getIcon(EnumBeeType.DRONE, phase);
  }
View Full Code Here

Examples of forestry.api.apiculture.IAlleleBeeSpecies

  @Override
  @SideOnly(Side.CLIENT)
  public int getColorForAlleleId(String uid, int phase) {
    if (!(forestry.api.genetics.AlleleManager.alleleRegistry.getAllele(uid) instanceof IAlleleBeeSpecies))
      return 16777215;
    IAlleleBeeSpecies species = (IAlleleBeeSpecies) forestry.api.genetics.AlleleManager.alleleRegistry.getAllele(uid);
    return species.getIconColour(phase);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.