Examples of IBee


Examples of forestry.api.apiculture.IBee

    // Breeding done, create new queen if slot available
    if (!ForestryItem.beePrincessGE.isItemEqual(housing.getQueen()))
      return;

    // Replace
    IBee princess = PluginApiculture.beeInterface.getMember(housing.getQueen());
    IBee drone = PluginApiculture.beeInterface.getMember(housing.getDrone());
    princess.mate(drone);

    NBTTagCompound nbttagcompound = new NBTTagCompound();
    princess.writeToNBT(nbttagcompound);
    ItemStack queen = ForestryItem.beeQueenGE.getItemStack();
View Full Code Here

Examples of forestry.api.apiculture.IBee

    IApiaristTracker breedingTracker = PluginApiculture.beeInterface.getBreedingTracker(housing.getWorld(), housing.getOwnerName());

    housing.onQueenDeath(getQueen());

    // Princess
    IBee heiress = queen.spawnPrincess(housing);
    if (heiress != null) {
      ItemStack princess = PluginApiculture.beeInterface.getMemberStack(heiress, EnumBeeType.PRINCESS.ordinal());
      breedingTracker.registerPrincess(heiress);
      offspring.push(princess);
    }
View Full Code Here

Examples of forestry.api.apiculture.IBee

    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

Examples of forestry.api.apiculture.IBee

    // Try to spawn princess
    if (worldObj.rand.nextInt(1000) >= chance)
      return;

    // Queue swarm spawn
    IBee spawn = PluginApiculture.beeInterface.getMember(queenstack);
    spawn.setIsNatural(false);
    pendingSpawns.push(PluginApiculture.beeInterface.getMemberStack(spawn, EnumBeeType.PRINCESS.ordinal()));

  }
View Full Code Here

Examples of forestry.api.apiculture.IBee

  @Override
  public void mate(IIndividual individual) {
    if(!(individual instanceof IBee))
      return;

    IBee drone = (IBee)individual;
    mate = drone.getGenome();
    this.isIrregularMating = drone.isNatural() != this.isNatural;
  }
View Full Code Here

Examples of forestry.api.apiculture.IBee

    if (toCreate <= 0)
      toCreate = 1;

    for (int i = 0; i < toCreate; i++) {
      IBee offspring = createOffspring(housing, -1);
      if (offspring != null) {
        offspring.setIsNatural(true);
        bees.add(offspring);
      }
    }

    if (bees.size() > 0)
View Full Code Here

Examples of forestry.api.apiculture.IBee

    for (int i = 0; i < parent1.length; i++)
      if (parent1[i] != null && parent2[i] != null)
        chromosomes[i] = Chromosome.inheritChromosome(world.rand, parent1[i], parent2[i]);

    IBeekeepingMode mode = PluginApiculture.beeInterface.getBeekeepingMode(world);
    IBee offspring = new Bee(world, new BeeGenome(chromosomes), mode.isNaturalOffspring(this), generation);

    /* Disabling the mutation rate nerf
    // All mutation and no play makes queen a dull girl.
    if(mode.isDegenerating(this, offspring, housing))
      offspring.setIsNatural(false);*/
 
View Full Code Here

Examples of forestry.api.apiculture.IBee

    // Equalize humidity and temperature
    equalizeTemperature();
    equalizeHumidity();

    IBee queen = beekeepingLogic.getQueen();
    if (queen == null)
      return;

    // Add swarm effects
    if (worldObj.getTotalWorldTime() % 200 * 10 == 0)
      onQueenChange(inventory.getStackInSlot(SLOT_QUEEN));
    if (getErrorState() == EnumErrorCode.OK)
      queen.doFX(beekeepingLogic.getEffectData(), this);

    if (getErrorState() == EnumErrorCode.OK && worldObj.getTotalWorldTime() % 50 == 0) {
      float f = xCoord + 0.5F;
      float f1 = yCoord + 0.0F + (worldObj.rand.nextFloat() * 6F) / 16F;
      float f2 = zCoord + 0.5F;
View Full Code Here

Examples of forestry.api.apiculture.IBee

      return;

    // / Multiplayer FX
    if (PluginApiculture.beeInterface.isMated(inventory.getStackInSlot(SLOT_QUEEN)))
      if (getErrorState() == EnumErrorCode.OK && worldObj.getTotalWorldTime() % 2 == 0) {
        IBee displayQueen = PluginApiculture.beeInterface.getMember(inventory.getStackInSlot(SLOT_QUEEN));
        displayQueen.doFX(beekeepingLogic.getEffectData(), this);
      }
    return;

  }
View Full Code Here

Examples of forestry.api.apiculture.IBee

    this.ignobleShare = share;
    return this;
  }
 
  private IBee createBee(World world) {
    IBee bee = PluginApiculture.beeInterface.getBee(world, PluginApiculture.beeInterface.templateAsGenome(template));
    if(world.rand.nextFloat() < ignobleShare)
      bee.setIsNatural(false);
    return bee;
  }
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.