Package forestry.apiculture.genetics

Examples of forestry.apiculture.genetics.Bee


    ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getBeeItemFromTemplate(BeeTemplates.getCommonTemplate(), EnumBeeType.DRONE), 1, 2, 8));
    ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getBeeItemFromTemplate(BeeTemplates.getMeadowsTemplate(), EnumBeeType.PRINCESS), 1, 1, 5));
  }

  private ItemStack getBeeItemFromTemplate(IAllele[] template, EnumBeeType beeType) {
    IBee bee = new Bee(PluginApiculture.beeInterface.templateAsGenome(template));
    ItemStack beeItem;
    switch (beeType) {
    default:
    case DRONE:
      beeItem = ForestryItem.beeDroneGE.getItemStack();
      break;
    case PRINCESS:
      beeItem = ForestryItem.beePrincessGE.getItemStack();
      break;
    }
    NBTTagCompound nbtTagCompound = new NBTTagCompound();
    bee.writeToNBT(nbtTagCompound);
    beeItem.setTagCompound(nbtTagCompound);

    return beeItem;
  }
View Full Code Here


      setMaxStackSize(1);
  }

  @Override
  protected IIndividual getIndividual(ItemStack itemstack) {
    return new Bee(itemstack.getTagCompound());
  }
View Full Code Here

  public String getItemStackDisplayName(ItemStack itemstack) {

    if (itemstack.getTagCompound() == null)
      return super.getItemStackDisplayName(itemstack);

    IBee individual = new Bee(itemstack.getTagCompound());
    String customBeeKey = "bees.custom." + type.getName() + "." + individual.getGenome().getPrimary().getUnlocalizedName().replace("bees.species.","");
    if(StringUtil.canTranslate(customBeeKey)){
      return StringUtil.localize(customBeeKey);
    }
    String beeGrammar = StringUtil.localize("bees.grammar." + type.getName());
    String beeSpecies = individual.getDisplayName();
    String beeType = StringUtil.localize("bees.grammar." + type.getName() + ".type");
    return beeGrammar.replaceAll("%SPECIES", beeSpecies).replaceAll("%TYPE", beeType);
  }
View Full Code Here

  public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) {
    if(!itemstack.hasTagCompound())
      return;

    if(type != EnumBeeType.DRONE) {
      IBee individual = new Bee(itemstack.getTagCompound());
      if (individual.isNatural())
        list.add("\u00A7e\u00A7o" + StringUtil.localize("bees.stock.pristine"));
      else
        list.add("\u00A7e" + StringUtil.localize("bees.stock.ignoble"));
    }
View Full Code Here

    public IAlleleBeeSpecies getSecondary() {
      return PluginApiculture.beeInterface.getIndividualTemplates().get(secondaryIndex).getGenome().getPrimary();
    }

    public IBee getSelectedBee() {
      return new Bee(PluginApiculture.beeInterface.templateAsGenome(
          PluginApiculture.beeInterface.getGenomeTemplates().get(PluginApiculture.beeInterface.getIndividualTemplates().get(primaryIndex).getIdent()),
          PluginApiculture.beeInterface.getGenomeTemplates().get(PluginApiculture.beeInterface.getIndividualTemplates().get(secondaryIndex).getIdent())));
    }
View Full Code Here

TOP

Related Classes of forestry.apiculture.genetics.Bee

Copyright © 2018 www.massapicom. 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.